/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM flockIWebServiceManager.idl
 */

#ifndef __gen_flockIWebServiceManager_h__
#define __gen_flockIWebServiceManager_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nsIDOMDocument_h__
#include "nsIDOMDocument.h"
#endif

#ifndef __gen_flockIBookmarkWebService_h__
#include "flockIBookmarkWebService.h"
#endif

#ifndef __gen_flockIWebService_h__
#include "flockIWebService.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    flockIWebServiceAccountListener */
#define FLOCKIWEBSERVICEACCOUNTLISTENER_IID_STR "b338bb3e-482d-49f9-8e56-cbbf5c164ba5"

#define FLOCKIWEBSERVICEACCOUNTLISTENER_IID \
  {0xb338bb3e, 0x482d, 0x49f9, \
    { 0x8e, 0x56, 0xcb, 0xbf, 0x5c, 0x16, 0x4b, 0xa5 }}

/**
 * This is the listener object to signal account events to listening parties.
 * Things we are interested in are : new account creation, account auth
 * change, and account removal. This is useful for UI especially.
 *
 * @see flockILoginWebService
 */
class NS_NO_VTABLE NS_SCRIPTABLE flockIWebServiceAccountListener : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(FLOCKIWEBSERVICEACCOUNTLISTENER_IID)

  /**
   * This will be called to notify that the WSM has created a new account
   *
   * @param aAccount (in) flockIWebServiceAccount, the newly created account
   * @param aDocument (in) nsIDOMDocument, the document that was used to
   *        confirm the account, which will be used to determine which tab to
   *        show the user notification in 
   */
  /* void onAccountCreated (in flockIWebServiceAccount aAccount, in nsIDOMDocument aDocument); */
  NS_SCRIPTABLE NS_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument) = 0;

  /**
   * This will be called to notify that the WSM has found an account,
   * but couldn't create it because the password is missing (bug 6404).
   *
   * @param aService (in) flockIWebService, the service found
   * @param aDocument (in) nsIDOMDocument, the document where the account
   *        was detected, which will be used to determine which tab to
   *        show the user notification in 
   */
  /* void onAccountPasswordMissing (in flockILoginWebService aService, in nsIDOMDocument aDocument); */
  NS_SCRIPTABLE NS_IMETHOD OnAccountPasswordMissing(flockILoginWebService *aService, nsIDOMDocument *aDocument) = 0;

  /**
   * This will be called to notify that the WSM has removed an account.
   * NOTE: THIS IS NOT IMPLEMENTED YET
   *
   * @param aAccount (in) flockIWebServiceAccount, the removed account
   */
  /* void onAccountRemoved (in flockIWebServiceAccount aAccount); */
  NS_SCRIPTABLE NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount) = 0;

  /**
   * This will be called to notify that the auth state of an account has
   * changed.
   *
   * @param aAccount (in) flockIWebServiceAccount, the account that was logged
   *        in/out
   */
  /* void onAccountAuthChange (in flockIWebServiceAccount aAccount); */
  NS_SCRIPTABLE NS_IMETHOD OnAccountAuthChange(flockIWebServiceAccount *aAccount) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(flockIWebServiceAccountListener, FLOCKIWEBSERVICEACCOUNTLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIWEBSERVICEACCOUNTLISTENER \
  NS_SCRIPTABLE NS_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument); \
  NS_SCRIPTABLE NS_IMETHOD OnAccountPasswordMissing(flockILoginWebService *aService, nsIDOMDocument *aDocument); \
  NS_SCRIPTABLE NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount); \
  NS_SCRIPTABLE NS_IMETHOD OnAccountAuthChange(flockIWebServiceAccount *aAccount); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_FLOCKIWEBSERVICEACCOUNTLISTENER(_to) \
  NS_SCRIPTABLE NS_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument) { return _to OnAccountCreated(aAccount, aDocument); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountPasswordMissing(flockILoginWebService *aService, nsIDOMDocument *aDocument) { return _to OnAccountPasswordMissing(aService, aDocument); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount) { return _to OnAccountRemoved(aAccount); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountAuthChange(flockIWebServiceAccount *aAccount) { return _to OnAccountAuthChange(aAccount); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_FLOCKIWEBSERVICEACCOUNTLISTENER(_to) \
  NS_SCRIPTABLE NS_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountCreated(aAccount, aDocument); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountPasswordMissing(flockILoginWebService *aService, nsIDOMDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountPasswordMissing(aService, aDocument); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountRemoved(aAccount); } \
  NS_SCRIPTABLE NS_IMETHOD OnAccountAuthChange(flockIWebServiceAccount *aAccount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountAuthChange(aAccount); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public flockIWebServiceAccountListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKIWEBSERVICEACCOUNTLISTENER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, flockIWebServiceAccountListener)

_MYCLASS_::_MYCLASS_()
{
  /* member initializers and constructor code */
}

_MYCLASS_::~_MYCLASS_()
{
  /* destructor code */
}

/* void onAccountCreated (in flockIWebServiceAccount aAccount, in nsIDOMDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onAccountPasswordMissing (in flockILoginWebService aService, in nsIDOMDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::OnAccountPasswordMissing(flockILoginWebService *aService, nsIDOMDocument *aDocument)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onAccountRemoved (in flockIWebServiceAccount aAccount); */
NS_IMETHODIMP _MYCLASS_::OnAccountRemoved(flockIWebServiceAccount *aAccount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onAccountAuthChange (in flockIWebServiceAccount aAccount); */
NS_IMETHODIMP _MYCLASS_::OnAccountAuthChange(flockIWebServiceAccount *aAccount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    flockIWebServiceManager */
#define FLOCKIWEBSERVICEMANAGER_IID_STR "bd22190c-28e9-11dd-880c-856955d89593"

#define FLOCKIWEBSERVICEMANAGER_IID \
  {0xbd22190c, 0x28e9, 0x11dd, \
    { 0x88, 0x0c, 0x85, 0x69, 0x55, 0xd8, 0x95, 0x93 }}

/**
 * The Web Service Manager is a singleton service for managing web service
 * components.
 *
 * "Management" in this case means providing some common workflow logic for
 * login detection and account creation.  It also means designating certain
 * web service components as special handlers -- for example designating a
 * primary bookmark service account, since only one bookmark account can be
 * used at a time to synchronize a user's bookmarks.
 *
 * In order to be managed by the Web Service Manager, the web service component
 * in question must implement the flockILoginWebService interface.
 *
 * More documentation here:
 * http://developer.flock.com/wiki/Accounts_Management
 *
 * @see flockILoginWebService
 */
class NS_NO_VTABLE NS_SCRIPTABLE flockIWebServiceManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(FLOCKIWEBSERVICEMANAGER_IID)

  /**
   * Starts up all web service componentents in the "wsm-startup" category.
   */
  /* void instantiateAll (); */
  NS_SCRIPTABLE NS_IMETHOD InstantiateAll(void) = 0;

  /**
   * Adds an account to the list of accounts for which notifications
   * are to be suppressed.
   *
   * @param aAccountUrn (in) URN of Account
   */
  /* void suppressNotiesForAccount (in AString aAccountUrn); */
  NS_SCRIPTABLE NS_IMETHOD SuppressNotiesForAccount(const nsAString & aAccountUrn) = 0;

  /**
   * Returns whether notifications may be shown for the given account.
   *
   * @param aAccountUrn (in) URN of Account
   */
  /* boolean isShowingNotiesForAccount (in AString aAccountUrn); */
  NS_SCRIPTABLE NS_IMETHOD IsShowingNotiesForAccount(const nsAString & aAccountUrn, PRBool *_retval) = 0;

  /**
   * Adds an account listener to listen for onAccountCreated, onAccountRemoved,
   * and onAccountAuthChange events on an account.
   *
   * @param aWSAccountListener (in) The listener callback object.
   */
  /* void addListener (in flockIWebServiceAccountListener aWSAccountListener); */
  NS_SCRIPTABLE NS_IMETHOD AddListener(flockIWebServiceAccountListener *aWSAccountListener) = 0;

  /**
   * Removes the account listener for listening for onAccountCreated, onAccountRemoved,
   * and onAccountAuthChange events on an account.
   *
   * @param aWSAccountListener (in) The listener
                                     callback object to be removed.
   */
  /* void removeListener (in flockIWebServiceAccountListener aWSAccountListener); */
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aWSAccountListener) = 0;

  /**
   * Tells WSM to automatically make accounts with the specified service
   * permanent (non-transient), as long as the account is created within a
   * period of one hour from the time this function was called.
   */
  /* void autoKeepAccountForService (in AString aServiceURN); */
  NS_SCRIPTABLE NS_IMETHOD AutoKeepAccountForService(const nsAString & aServiceURN) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(flockIWebServiceManager, FLOCKIWEBSERVICEMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIWEBSERVICEMANAGER \
  NS_SCRIPTABLE NS_IMETHOD InstantiateAll(void); \
  NS_SCRIPTABLE NS_IMETHOD SuppressNotiesForAccount(const nsAString & aAccountUrn); \
  NS_SCRIPTABLE NS_IMETHOD IsShowingNotiesForAccount(const nsAString & aAccountUrn, PRBool *_retval); \
  NS_SCRIPTABLE NS_IMETHOD AddListener(flockIWebServiceAccountListener *aWSAccountListener); \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aWSAccountListener); \
  NS_SCRIPTABLE NS_IMETHOD AutoKeepAccountForService(const nsAString & aServiceURN); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_FLOCKIWEBSERVICEMANAGER(_to) \
  NS_SCRIPTABLE NS_IMETHOD InstantiateAll(void) { return _to InstantiateAll(); } \
  NS_SCRIPTABLE NS_IMETHOD SuppressNotiesForAccount(const nsAString & aAccountUrn) { return _to SuppressNotiesForAccount(aAccountUrn); } \
  NS_SCRIPTABLE NS_IMETHOD IsShowingNotiesForAccount(const nsAString & aAccountUrn, PRBool *_retval) { return _to IsShowingNotiesForAccount(aAccountUrn, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD AddListener(flockIWebServiceAccountListener *aWSAccountListener) { return _to AddListener(aWSAccountListener); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aWSAccountListener) { return _to RemoveListener(aWSAccountListener); } \
  NS_SCRIPTABLE NS_IMETHOD AutoKeepAccountForService(const nsAString & aServiceURN) { return _to AutoKeepAccountForService(aServiceURN); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_FLOCKIWEBSERVICEMANAGER(_to) \
  NS_SCRIPTABLE NS_IMETHOD InstantiateAll(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->InstantiateAll(); } \
  NS_SCRIPTABLE NS_IMETHOD SuppressNotiesForAccount(const nsAString & aAccountUrn) { return !_to ? NS_ERROR_NULL_POINTER : _to->SuppressNotiesForAccount(aAccountUrn); } \
  NS_SCRIPTABLE NS_IMETHOD IsShowingNotiesForAccount(const nsAString & aAccountUrn, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsShowingNotiesForAccount(aAccountUrn, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD AddListener(flockIWebServiceAccountListener *aWSAccountListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aWSAccountListener); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aWSAccountListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aWSAccountListener); } \
  NS_SCRIPTABLE NS_IMETHOD AutoKeepAccountForService(const nsAString & aServiceURN) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoKeepAccountForService(aServiceURN); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public flockIWebServiceManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKIWEBSERVICEMANAGER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, flockIWebServiceManager)

_MYCLASS_::_MYCLASS_()
{
  /* member initializers and constructor code */
}

_MYCLASS_::~_MYCLASS_()
{
  /* destructor code */
}

/* void instantiateAll (); */
NS_IMETHODIMP _MYCLASS_::InstantiateAll()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void suppressNotiesForAccount (in AString aAccountUrn); */
NS_IMETHODIMP _MYCLASS_::SuppressNotiesForAccount(const nsAString & aAccountUrn)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean isShowingNotiesForAccount (in AString aAccountUrn); */
NS_IMETHODIMP _MYCLASS_::IsShowingNotiesForAccount(const nsAString & aAccountUrn, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addListener (in flockIWebServiceAccountListener aWSAccountListener); */
NS_IMETHODIMP _MYCLASS_::AddListener(flockIWebServiceAccountListener *aWSAccountListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeListener (in flockIWebServiceAccountListener aWSAccountListener); */
NS_IMETHODIMP _MYCLASS_::RemoveListener(flockIWebServiceAccountListener *aWSAccountListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void autoKeepAccountForService (in AString aServiceURN); */
NS_IMETHODIMP _MYCLASS_::AutoKeepAccountForService(const nsAString & aServiceURN)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_flockIWebServiceManager_h__ */
