[Telepathy-commits] [telepathy-gabble/master] first draft of the requestotronification of the View API

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Oct 3 08:38:47 PDT 2008


---
 extensions/Makefile.am                        |    4 +-
 extensions/OLPC_Channel_Interface_View.xml    |   96 +++++++++++++++++++++
 extensions/OLPC_Channel_Type_ActivityView.xml |   49 +++++++++++
 extensions/OLPC_Channel_Type_BuddyView.xml    |   48 ++++++++++
 extensions/OLPC_View.xml                      |  115 -------------------------
 extensions/all.xml                            |    6 +-
 6 files changed, 201 insertions(+), 117 deletions(-)
 create mode 100644 extensions/OLPC_Channel_Interface_View.xml
 create mode 100644 extensions/OLPC_Channel_Type_ActivityView.xml
 create mode 100644 extensions/OLPC_Channel_Type_BuddyView.xml
 delete mode 100644 extensions/OLPC_View.xml

diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index f5e9866..81a7dbb 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -7,7 +7,9 @@ EXTRA_DIST = \
     OLPC_Activity_Properties.xml \
     OLPC_Buddy_Info.xml \
     OLPC_Gadget.xml \
-    OLPC_View.xml
+    OLPC_Channel_Interface_View.xml \
+    OLPC_Channel_Type_BuddyView.xml \
+    OLPC_Channel_Type_ActivityView.xml
 
 noinst_LTLIBRARIES = libgabble-extensions.la
 
diff --git a/extensions/OLPC_Channel_Interface_View.xml b/extensions/OLPC_Channel_Interface_View.xml
new file mode 100644
index 0000000..3dc6a33
--- /dev/null
+++ b/extensions/OLPC_Channel_Interface_View.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" ?>
+<node name="/OLPC_Channel_Interface_View" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <tp:copyright> Copyright (C) 2008 Collabora Limited </tp:copyright>
+  <tp:license xmlns="http://www.w3.org/1999/xhtml">
+    <p>This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.</p>
+
+<p>This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.</p>
+
+<p>You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
+  </tp:license>
+  <interface name="org.laptop.Telepathy.Channel.Interface.View">
+  <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
+
+    <signal name="ActivitiesChanged">
+      <arg name="added" type="a(su)" tp:type="Activity[]">
+        <tp:docstring>
+          Room handles of the added activities
+        </tp:docstring>
+      </arg>
+      <arg name="removed" type="a(su)" tp:type="Activity[]">
+        <tp:docstring>
+          Room handles of the removed activities
+        </tp:docstring>
+      </arg>
+      <tp:docstring>
+        Signal emitted when the activities in the view are changed.
+      </tp:docstring>
+    </signal>
+
+    <signal name="BuddiesChanged">
+      <arg name="added" type="au">
+        <tp:docstring>
+          Handles of the added buddies
+        </tp:docstring>
+      </arg>
+      <arg name="removed" type="au">
+        <tp:docstring>
+          Handles of the removed buddies
+        </tp:docstring>
+      </arg>
+      <tp:docstring>
+        Signal emitted when the buddies in the view are changed.
+      </tp:docstring>
+    </signal>
+
+    <property name="Size" type="u" access="read"
+              tp:name-for-bindings="Size">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>The maximum number of elements that Gadget has to return to the search request.</p>
+        <p>When requesting a channel with 
+          <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref>,
+          this property MUST be included in the request.</p>
+      </tp:docstring>
+    </property>
+
+    <property name="Buddies" type="au" access="read"
+              tp:name-for-bindings="Buddies" tp:type="Contact_Handle[]">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>The buddies who are in this view channel.</p>
+
+        <p>It does not make sense for this property to be in channel requests.</p>
+      </tp:docstring>
+    </property>
+
+    <property name="Activities" type="a(su)" access="read"
+              tp:name-for-bindings="Activities" tp:type="Activity[]">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>The activities which are in this view channel.</p>
+
+        <p>It does not make sense for this property to be in channel requests.</p>
+      </tp:docstring>
+    </property>
+
+    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+      <p>An interface for channels representing the result of a Gadget search.</p>
+      <p>Buddy properties changes are notified on the Connection object using the
+        <code>org.laptop.Telepathy.BuddyInfo</code> interface while the view object
+        is alive.</p>
+      <p>Activity properties changes are notified on the Connection object using the
+        <code>org.laptop.Telepathy.ActivityProperties</code> interface while the view object
+        is alive.</p>
+      <p>Activities membership is notified on the Connection object using the
+        <code>org.laptop.Telepathy.BuddyInfo</code> properties while the view object
+        is alive.</p>
+    </tp:docstring>
+  </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/OLPC_Channel_Type_ActivityView.xml b/extensions/OLPC_Channel_Type_ActivityView.xml
new file mode 100644
index 0000000..4551a9e
--- /dev/null
+++ b/extensions/OLPC_Channel_Type_ActivityView.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" ?>
+<node name="/OLPC_Channel_Type_ActivityView" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <tp:copyright> Copyright (C) 2008 Collabora Limited </tp:copyright>
+  <tp:license xmlns="http://www.w3.org/1999/xhtml">
+    <p>This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.</p>
+
+<p>This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.</p>
+
+<p>You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
+  </tp:license>
+  <interface name="org.laptop.Telepathy.Channel.Type.ActivityView">
+  <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
+  <tp:requires interface="org.laptop.Telepathy.Channel.Interface.View"/>
+
+    <property name="Properties" type="a{sv}" access="read"
+              tp:name-for-bindings="Properties">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>If set when requesting the channel, Gadget will search for activities
+          having these properties.</p>
+      </tp:docstring>
+    </property>
+
+    <property name="Participants" type="a(su)" access="read"
+              tp:name-for-bindings="Participants">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>If set when requesting the channel, Gadget will search for activities
+          in which the given buddies are participating.</p>
+      </tp:docstring>
+    </property>
+
+    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+      <p>A channel used to search Activities using Gadget.</p>
+      <p>The result of the search is available in the Activities property
+        and the participants of these activities are stored in the
+        Buddies property of this channel.</p>
+      <p>If no search criteria is defined then Gadget will return
+        random activities, up to the size of the view channel.</p>
+    </tp:docstring>
+  </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/OLPC_Channel_Type_BuddyView.xml b/extensions/OLPC_Channel_Type_BuddyView.xml
new file mode 100644
index 0000000..0e8c295
--- /dev/null
+++ b/extensions/OLPC_Channel_Type_BuddyView.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" ?>
+<node name="/OLPC_Channel_Type_BuddyView" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+  <tp:copyright> Copyright (C) 2008 Collabora Limited </tp:copyright>
+  <tp:license xmlns="http://www.w3.org/1999/xhtml">
+    <p>This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.</p>
+
+<p>This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.</p>
+
+<p>You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
+  </tp:license>
+  <interface name="org.laptop.Telepathy.Channel.Type.BuddyView">
+  <tp:requires interface="org.freedesktop.Telepathy.Channel"/>
+  <tp:requires interface="org.laptop.Telepathy.Channel.Interface.View"/>
+
+    <property name="Properties" type="a{sv}" access="read"
+              tp:name-for-bindings="Properties">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>If set when requesting the channel, Gadget will search for buddies
+          having these properties.</p>
+      </tp:docstring>
+    </property>
+
+    <property name="Alias" type="s" access="read"
+              tp:name-for-bindings="Alias">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>If set when requesting the channel, Gadget will search for buddies
+          having this alias.</p>
+      </tp:docstring>
+    </property>
+
+    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+      <p>A channel used to search Buddies using Gadget.</p>
+      <p>The result of the search is available in the Buddies property
+        of the channel. The Activities property should stay empty.</p>
+      <p>If no search criteria is defined then Gadget will return
+        random buddies, up to the size of the view channel.</p>
+    </tp:docstring>
+  </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/OLPC_View.xml b/extensions/OLPC_View.xml
deleted file mode 100644
index b8400b9..0000000
--- a/extensions/OLPC_View.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" ?>
-<node name="/OLPC_View" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright> Copyright (C) 2008 Collabora Limited </tp:copyright>
-  <tp:license xmlns="http://www.w3.org/1999/xhtml">
-    <p>This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.</p>
-
-<p>This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.</p>
-
-<p>You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
-  </tp:license>
-  <interface name="org.laptop.Telepathy.View">
-
-  <method name="GetActivities">
-    <arg direction="out" name="activities" type="a(su)" tp:type="Activity[]">
-       <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-          An array of structs containing:
-          <ul>
-            <li>the identifier of the activity</li>
-            <li>the room handle of the activity channel</li>
-          </ul>
-       </tp:docstring>
-    </arg>
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p>Return all the activities of this view</p>
-      </tp:docstring>
-      <tp:possible-errors>
-      </tp:possible-errors>
-    </method>
-
-  <method name="GetBuddies">
-    <arg direction="out" name="buddies" type="au">
-      <tp:docstring>
-        An array of buddies handles
-      </tp:docstring>
-    </arg>
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p>Return all the buddies of this view</p>
-      </tp:docstring>
-      <tp:possible-errors>
-      </tp:possible-errors>
-    </method>
-
-    <method name="Close">
-      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-        <p>Close the view so we won't receive notifications about its
-          result anymore. Method calls on the view are no longer valid after
-          this call, and the connection manager may remove the object from
-          the bus at any point.</p>
-      </tp:docstring>
-      <tp:possible-errors>
-      </tp:possible-errors>
-    </method>
-
-    <signal name="ActivitiesChanged">
-      <arg name="added" type="a(su)" tp:type="Activity[]">
-        <tp:docstring>
-          Room handles of the added activities
-        </tp:docstring>
-      </arg>
-      <arg name="removed" type="a(su)" tp:type="Activity[]">
-        <tp:docstring>
-          Room handles of the removed activities
-        </tp:docstring>
-      </arg>
-      <tp:docstring>
-        Signal emitted when the activities in the view are changed.
-      </tp:docstring>
-    </signal>
-
-    <signal name="BuddiesChanged">
-      <arg name="added" type="au">
-        <tp:docstring>
-          Handles of the added buddies
-        </tp:docstring>
-      </arg>
-      <arg name="removed" type="au">
-        <tp:docstring>
-          Handles of the removed buddies
-        </tp:docstring>
-      </arg>
-      <tp:docstring>
-        Signal emitted when the buddies in the view are changed.
-      </tp:docstring>
-    </signal>
-
-    <signal name="Closed">
-      <tp:docstring>
-        Signal emitted when the view is closed. Views are closed on users request (Close method) or
-        if the gadget server component is restarted.
-      </tp:docstring>
-    </signal>
-
-    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
-      <p>An object representing the result of an search.</p>
-      <p>Buddy properties changes are notified on the Connection object using the
-        <code>org.laptop.Telepathy.BuddyInfo</code> interface while the view object
-        is alive.</p>
-      <p>Activity properties changes are notified on the Connection object using the
-        <code>org.laptop.Telepathy.ActivityProperties</code> interface while the view object
-        is alive.</p>
-      <p>Activities membership is notified on the Connection object using the
-        <code>org.laptop.Telepathy.BuddyInfo</code> properties while the view object
-        is alive.</p>
-    </tp:docstring>
-  </interface>
-</node>
-<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/all.xml b/extensions/all.xml
index 4a76a88..1140f8b 100644
--- a/extensions/all.xml
+++ b/extensions/all.xml
@@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
 <tp:generic-types>
   <tp:external-type name="Room_Handle" type="u"
     from="Telepathy specification"/>
+  <tp:external-type name="Contact_Handle" type="u"
+    from="Telepathy specification"/>
 </tp:generic-types>
 
 <xi:include href="Channel_Bundle.xml"/>
@@ -32,7 +34,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>
 <xi:include href="OLPC_Buddy_Info.xml"/>
 <xi:include href="OLPC_Activity_Properties.xml"/>
 <xi:include href="OLPC_Gadget.xml"/>
-<xi:include href="OLPC_View.xml"/>
+<xi:include href="OLPC_Channel_Interface_View.xml"/>
+<xi:include href="OLPC_Channel_Type_BuddyView.xml"/>
+<xi:include href="OLPC_Channel_Type_ActivityView.xml"/>
 
 <tp:generic-types>
   <tp:external-type name="Contact_Handle" type="u"
-- 
1.5.6.5




More information about the Telepathy-commits mailing list