<?xml version="1.0" encoding="UTF-8" ?>

<node name="/cx.ring.Ring.PresenceManager" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
    <interface name="cx.ring.Ring.PresenceManager">
        <!-- METHODS !-->
        <method name="publish" tp:name-for-bindings="publish">
            <tp:added version="1.3.0"/>
            <arg type="s" name="accountID" direction="in">
                <tp:docstring>
                    The account from which the presence will be emitted
                </tp:docstring>
            </arg>
            <arg type="b" name="status" direction="in">
                <tp:docstring>
                    Is this account present or not
                </tp:docstring>
            </arg>
            <arg type="s" name="note" direction="in">
                <tp:docstring>
                    A message transmitted by the server to other users
                </tp:docstring>
            </arg>
        </method>

        <method name="answerServerRequest" tp:name-for-bindings="answerServerRequest">
            <tp:docstring>
                Answer a presence request from the server
            </tp:docstring>
            <tp:added version="1.3.0"/>
            <arg type="s" name="uri" direction="in">
                <tp:docstring>
                </tp:docstring>
            </arg>
            <arg type="b" name="flag" direction="in">
                <tp:docstring>
                    Is the request granted or denied
                </tp:docstring>
            </arg>
        </method>

        <method name="subscribeBuddy" tp:name-for-bindings="subscribeBuddy">
            <tp:docstring>
                Ask be be notified when 'uri' presence change
            </tp:docstring>
            <tp:added version="1.3.0"/>
            <arg type="s" name="accountID" direction="in">
                <tp:docstring>
                    An account from which get request presence informations
                </tp:docstring>
            </arg>
            <arg type="s" name="uri" direction="in">
                <tp:docstring>
                    A SIP uri to watch
                </tp:docstring>
            </arg>
            <arg type="b" name="flag" direction="in">
                <tp:docstring>
                </tp:docstring>
            </arg>
        </method>

        <method name="getSubscriptions" tp:name-for-bindings="getSubscriptions">
            <tp:added version="1.3.0"/>
            <tp:rationale>
                New clients connecting to existing daemon need to be aware of active
                subscriptions.
            </tp:rationale>
            <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="VectorMapStringString">
                While there is more status than "Online" or "Offline", only those
            </annotation>
            <arg type="s" name="accountID" direction="in">
            </arg>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorMapStringString"/>
            <arg type="aa{ss}" name="credentialInformation" direction="out" tp:type="String_String_Map">
                <tp:docstring>
                   List of hashes map with the following key-value pairs:
                    * Buddy:      URI of the contact
                    * Status:     "Online" or "Offline"
                    * LineStatus: String
               </tp:docstring>
            </arg>
        </method>

        <method name="setSubscriptions" tp:name-for-bindings="setSubscriptions">
            <tp:added version="1.3.0"/>
            <tp:rationale>Calling "subscribeClient" in a loop is too slow</tp:rationale>
            <arg type="s" name="accountID" direction="in">
            </arg>
            <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="VectorString"/>
            <arg type="as" name="uriList" direction="in">
                <tp:docstring>
                   A list of SIP URIs
               </tp:docstring>
           </arg>
            <!--TODO<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorString"/>
            <arg type="as" name="invalidUris" direction="out">
                <tp:docstring>
                   List of invalid URIs. An URI must be a valid SIP URI. Clients should purge
                   the list from all invalid URIs
               </tp:docstring>
            </arg>-->
        </method>

        <!-- SIGNALS !-->

        <signal name="newBuddyNotification" tp:name-for-bindings="newBuddyNotification">
            <tp:added version="1.3.0"/>
            <tp:docstring>
                Notify when a registered presence uri presence informations changes
            </tp:docstring>
            <arg type="s" name="accountID">
                <tp:docstring>
                    The associated account
                </tp:docstring>
            </arg>
            <arg type="s" name="buddyUri">
                <tp:docstring>
                    The registered URI
                </tp:docstring>
            </arg>
            <arg type="i" name="status">
                <tp:docstring>
                    Is the URI present or not
                </tp:docstring>
            </arg>
            <arg type="s" name="lineStatus">
                <tp:docstring>
                    A string containing informations from the user (human readable)
                </tp:docstring>
            </arg>
        </signal>

        <signal name="nearbyPeerNotification" tp:name-for-bindings="nearbyPeerNotification">
            <tp:added version="1.3.0"/>
            <tp:docstring>
                Notify when a new local peer is discovered
            </tp:docstring>
            <arg type="s" name="accountID">
                <tp:docstring>
                    The associated account
                </tp:docstring>
            </arg>
            <arg type="s" name="buddyUri">
                <tp:docstring>
                    The registered URI
                </tp:docstring>
            </arg>
            <arg type="i" name="status">
                <tp:docstring>
                    Is delete or addition
                </tp:docstring>
            </arg>
            <arg type="s" name="displayname">
                <tp:docstring>
                    A string containing informations from the user (human readable)
                </tp:docstring>
            </arg>
        </signal>

        <signal name="subscriptionStateChanged" tp:name-for-bindings="subscriptionStateChanged">
            <tp:added version="1.3.0"/>
            <tp:docstring>
                Notify when a the server changes the state of a subscription.
            </tp:docstring>
            <arg type="s" name="accountID">
                <tp:docstring>
                    The associated account
                </tp:docstring>
            </arg>
            <arg type="s" name="buddyUri">
                <tp:docstring>
                    The registered URI
                </tp:docstring>
            </arg>
            <arg type="b" name="state">
                <tp:docstring>
                    True/ false when the subscription is active/termintated.
                </tp:docstring>
            </arg>
        </signal>

        <signal name="newServerSubscriptionRequest" tp:name-for-bindings="newServerSubscriptionRequest">
            <tp:added version="1.3.0"/>
            <arg type="s" name="buddyUri">
                <tp:docstring>
                    Notify when an other user (or the server) request your presence informations
                </tp:docstring>
            </arg>
        </signal>

      <signal name="serverError" tp:name-for-bindings="serverError">
            <tp:added version="1.3.0"/>
            <arg type="s" name="accountID">
                <tp:docstring>
                    Associated account
                </tp:docstring>
            </arg>
             <arg type="s" name="error">
                <tp:docstring>
                    Code returned by the server
                </tp:docstring>
            </arg>
            <arg type="s" name="msg">
                <tp:docstring>
                    Error explain
                </tp:docstring>
            </arg>
      </signal>

    </interface>
</node>
