/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * 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"
#include "flockISocialWebService.idl"
 
[scriptable, uuid(8548ef3c-4569-4aba-bbd0-dc53d5463999)]
interface flockIPeopleObserver : nsIObserver
{
  /**
   * onFriendRemove
   * Functionality to be performed when PeopleService observes that a friend
   * has been removed
   * @param aFriendUrn : URN of Friend that has been removed
   */
  void onFriendRemove(in AString aFriendUrn);
  
  /**
   * onFriendUpdate
   * Functionality to be performed when PeopleService observes that a friend
   * has been updated. There is no guarantee that the FriendActivityLog
   * is updated at this point, if you plan to use it use onActivityUpdate.
   * @param aFriendUrn : URN of Friend that has been removed
   */
  void onFriendUpdate(in AString AFriendUrn);
  
  /**
   * onInsertFriend
   * Functionality to be performed when PeopleService observes that account
   * aAccountId has a new friend
   * @param aFriendUrn : URN of Friend that has been removed
   */
  void onInsertFriend(in AString aFriendUrn);

  /**
   * Called when a friend has a new activity (status change, new photo...)
   * This will be called after onFriendUpdate
   * @param aActivityUrn: URN of the new activity
   */
  void onNewActivity(in AString aActivityUrn);
};

[scriptable, uuid(47271700-0C08-11DD-9079-E51956D89593)]
interface flockIPeopleService : nsISupports
{
  /**
   * peopleIconLit
   * Indicates the highlight state of the people icon.
   */
  readonly attribute boolean peopleIconLit;

  /**
   * AddObserver
   * Registers a given listener for a notifications regarding the specified
   * topic.
   * @param anObserve : The interface pointer which will receive notifications.
   */
  void addObserver(in flockIPeopleObserver aObserver);

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

  /**
   * togglePeopleIcon
   * Toggle the people icon between highlighted and unhighlighted state.
   * @param aToggleOn : A toggle value of true will set the icon to a
   *                    highlighted state.
   */
  void togglePeopleIcon(in boolean aToggleOn);

  /**
   * numObservers
   * return the number of observers (people sidebar and My World when opened).
   */
  PRUint16 numObservers();

};
