<?xml version="1.0" ?>
<node name="/Connection_Manager_Interface_Account_Storage"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">

  <tp:copyright>Copyright © 2011 Collabora Ltd.</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 Street, Fifth Floor, Boston, MA
      02110-1301, USA.</p>
  </tp:license>

  <interface name="org.freedesktop.Telepathy.ConnectionManager.Interface.AccountStorage.DRAFT"
    tp:causes-havoc="experimental">
    <tp:added version="0.21.10">(draft 1)</tp:added>
    <tp:requires interface="org.freedesktop.Telepathy.ConnectionManager"/>

    <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
      <p>An interface for connection managers that store account details
        internally.  At the moment this consists only of storing an account's
        credentials, but other functionality may be added in the future.</p>

      <p><tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> objects
        representing accounts on a connection manager that implements this
        interface should implement the
	<tp:dbus-ref namespace="ofdT.Account.Interface">ExternalPasswordStorage.DRAFT</tp:dbus-ref>
        interface.</p>
    </tp:docstring>

    <tp:flags name="Account_Flags" value-prefix="Account_Flag" type="u">
      <tp:docstring>
        A set of flags representing the status of the Account stored in the
        Connection Manager.
      </tp:docstring>

      <tp:flag suffix="Credentials_Stored" value="1">
        <tp:docstring>
          The associated account has its authentication credentials (password)
          stored in the connection manager
        </tp:docstring>
      </tp:flag>
    </tp:flags>

    <tp:mapping name="Account_Flags_Map" array-name="Account_Flags_Map_List">
      <tp:docstring>A mapping from Account_Ids to account flags.
      </tp:docstring>
      <tp:member type="s" name="Account_Id"/>
      <tp:member type="u" tp:type="Account_Flags" name="Flags"/>
    </tp:mapping>

    <property name="Accounts"
      tp:name-for-bindings="Accounts"
      type="a{su}" tp:type="Account_Flags_Map" access="read">
      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
        <p>The set of Accounts stored in this Connection Manager, and flags
          indicating their status.</p>

        <p>Change notification for this property is provided by the standard
          D-Bus <code>PropertiesChanged</code> signal.</p>
      </tp:docstring>
    </property>

    <method name="ForgetCredentials" tp:name-for-bindings="Forget_Credentials">
      <tp:docstring>
        Clears any saved credentials associated with the specified Account_Id.
        Any other saved data related to the account will be unaffected.
      </tp:docstring>

      <arg direction="in" name="Account_Id"
        type="s">
        <tp:docstring>
          An account id as returned from
	  <tp:dbus-ref namespace="ofdT">Protocol.IdentifyAccount</tp:dbus-ref>.
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
          <tp:docstring>
            The account id is invalid.
          </tp:docstring>
        </tp:error>
      </tp:possible-errors>
    </method>

    <method name="RemoveAccount" tp:name-for-bindings="Remove_Account">
      <tp:docstring>
        Completely removes all data associated with an account from the
        connection manager's internal storage.
      </tp:docstring>

      <arg direction="in" name="Account_Id"
        type="s">
        <tp:docstring>
          An account id as returned from
	  <tp:dbus-ref namespace="ofdT">Protocol.IdentifyAccount</tp:dbus-ref>.
        </tp:docstring>
      </arg>

      <tp:possible-errors>
        <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument">
          <tp:docstring>
            The account id is invalid.
          </tp:docstring>
        </tp:error>
      </tp:possible-errors>
    </method>

  </interface>
</node>
