/**
 * 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 "nsISimpleEnumerator.idl"
#include "nsIDOMHTMLElement.idl"
#include "nsIWritablePropertyBag2.idl"
#include "flockIError.idl"

interface flockIMediaWebService;

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

[scriptable, uuid(90ebb22d-c468-4db2-979d-9c32f5d65d78)]
interface flockIPhotoAPIManagerListener: nsISupports
{
  void onAPIStateChange(in flockIMediaWebService aAPI);
  void onError(in flockIError aError);
};

[scriptable, uuid(a9911f5e-2efa-4ae8-9a8e-43bf66d69512)]
interface flockIPhotoAPIManager: nsISupports
{
  readonly attribute boolean hasNewMedia;
  readonly attribute nsISimpleEnumerator services;

  void addListener(in flockIPhotoAPIManagerListener aListener);
  void doLogin(in AString aAccountURN);
  void doLogout(in ACString aShortname);
  flockIMediaWebService getAPIFromShortname(in ACString aShortname);
  flockIMediaWebService getDefaultService();
  void processPhotoStream(in AString aQueryUrn, in nsISimpleEnumerator aEnum, in boolean bMarkUnseen);
  boolean destroyPhotos(in AString aQueryUrn);
  void removeListener(in flockIPhotoAPIManagerListener aListener);
  void setDefaultService(in ACString aShortname);

  /**
   * Handles retrieving the content url and title.
   *
   * @param aSrc (in) Source element.
   * @param aProp (in) Container for retrieved property results.
   * @returns true if a service handled the request.
   */
  boolean getSharingContent(in nsIDOMHTMLElement aSrc,
                            in nsIWritablePropertyBag2 aProp);
};

