/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2008
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "nsISupports.idl"
#include "nsIObserver.idl"

[scriptable, uuid(04f22e98-9599-11dc-8314-0800200c9a66)]
interface flockIAccountObserver : nsIObserver
{
  /**
   * onAccountAuthenticated
   * Functionality to be performed when AccountService observes that an account
   * has been authenticated
   * @param aAccountUrn : URN of Account that has been authenticated
   */
  void onAccountAuthenticated(in AString aAccountUrn);
  
  /**
    * onAccountUnauthenticated
    * Functionality to be performed when AccountService observes that an account
    * has just been unauthenticated
    * @param aAccountUrn: URN of Account that has been unauthenticated
    */
  void onAccountUnauthenticated(in AString aAccountUrn);
  
  /**
   * onAccountRefresh
   * Functionality to be performed when AccountService observes that an account
   * has just been unauthenticated
   * @param aAccountUrn: URN of Account that has started refreshing
   */
  void onAccountRefreshing(in AString aAccountUrn);
  
  /**
   * onAccountNoLongerRefreshing
   * Functionality to be performed when AccountService observes that an account
   * has just been unauthenticated
   * @param aAccountUrn: URN of Account that has finished refreshing
   */
  void onAccountNoLongerRefreshing(in AString aAccountUrn);
};

[scriptable, uuid(1700acd6-9599-11dc-8314-0800200c9a66)]
interface flockIAccountService : nsISupports
{
  /**
   * addObserver
   * Registers a given listener for a notifications regarding the specified
   * topic.
   * @param aObserver : The interface pointer which will receive notifications.
   */
  void addObserver(in flockIAccountObserver aObserver);

  /**
   * removeObserver
   * Unregisters a given listener from notifications regarding the specified
   * topic.
   * @param aObserver : The interface pointer which will stop receiving
   *                    notifications.
   */
  void removeObserver(in flockIAccountObserver aObserver);
};
