/*
 * 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_flockIManageableWebService_h__
#include "flockIManageableWebService.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 "249fbe6e-3e63-4339-bea2-67a72149d89f"

#define FLOCKIWEBSERVICEACCOUNTLISTENER_IID \
  {0x249fbe6e, 0x3e63, 0x4339, \
    { 0xbe, 0xa2, 0x67, 0xa7, 0x21, 0x49, 0xd8, 0x9f }}

/**
 * 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 flockIWebService
 */
class NS_NO_VTABLE flockIWebServiceAccountListener : public nsISupports {
 public: 

  NS_DEFINE_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_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 flockIManageableWebService aService, in nsIDOMDocument aDocument); */
  NS_IMETHOD OnAccountPasswordMissing(flockIManageableWebService *aService, nsIDOMDocument *aDocument) = 0;

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

  /**
   * 
   * This will be called to notify that the WSM has created removed an account
   * @param aAccount (in) flockIWebServiceAccount, the account that was logged in/out
   */
  /* void onAccountAuthChange (in flockIWebServiceAccount aAccount); */
  NS_IMETHOD OnAccountAuthChange(flockIWebServiceAccount *aAccount) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIWEBSERVICEACCOUNTLISTENER \
  NS_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument); \
  NS_IMETHOD OnAccountPasswordMissing(flockIManageableWebService *aService, nsIDOMDocument *aDocument); \
  NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount); \
  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_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument) { return _to OnAccountCreated(aAccount, aDocument); } \
  NS_IMETHOD OnAccountPasswordMissing(flockIManageableWebService *aService, nsIDOMDocument *aDocument) { return _to OnAccountPasswordMissing(aService, aDocument); } \
  NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount) { return _to OnAccountRemoved(aAccount); } \
  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_IMETHOD OnAccountCreated(flockIWebServiceAccount *aAccount, nsIDOMDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountCreated(aAccount, aDocument); } \
  NS_IMETHOD OnAccountPasswordMissing(flockIManageableWebService *aService, nsIDOMDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountPasswordMissing(aService, aDocument); } \
  NS_IMETHOD OnAccountRemoved(flockIWebServiceAccount *aAccount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAccountRemoved(aAccount); } \
  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 flockIManageableWebService aService, in nsIDOMDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::OnAccountPasswordMissing(flockIManageableWebService *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 "9d7e9cfa-6144-490a-bd86-9178e8f025c6"

#define FLOCKIWEBSERVICEMANAGER_IID \
  {0x9d7e9cfa, 0x6144, 0x490a, \
    { 0xbd, 0x86, 0x91, 0x78, 0xe8, 0xf0, 0x25, 0xc6 }}

/**
 * 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 flockIManageableWebService interface.  It
 * must also call registerWebService().
 *
 * More documentation here:
 * http://wiki.flock.com/index.php?title=Danphe:AccountsAndServices
 *
 * @see flockIManageableWebService
 */
class NS_NO_VTABLE flockIWebServiceManager : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(FLOCKIWEBSERVICEMANAGER_IID)

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

  /**
   * Registers a flockIManageableWebService to be managed.
   *
   * PRECONDITION:
   *  - The service MUST have its .urn property set before calling this.
   *
   * @param aService (in) The service to be managed.
   */
  /* void registerWebService (in flockIManageableWebService aService); */
  NS_IMETHOD RegisterWebService(flockIManageableWebService *aService) = 0;

  /**
   * Un-registers a service, meaning that the Web Service Manager will STOP
   * managing that service.
   *
   * @param aService (in) The service to stop managing.
   */
  /* void unregisterWebService (in flockIManageableWebService aService); */
  NS_IMETHOD UnregisterWebService(flockIManageableWebService *aService) = 0;

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

  /**
   * Removes the account listener for listening for onAccountCreated, onAccountRemoved,
   * and onAccountAuthChange events on an account.
   *
   * @param aListener (in) The listener callback object to be removed.
   */
  /* void removeListener (in flockIWebServiceAccountListener aListener); */
  NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aListener) = 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_IMETHOD AutoKeepAccountForService(const nsAString & aServiceURN) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIWEBSERVICEMANAGER \
  NS_IMETHOD InstantiateAll(void); \
  NS_IMETHOD RegisterWebService(flockIManageableWebService *aService); \
  NS_IMETHOD UnregisterWebService(flockIManageableWebService *aService); \
  NS_IMETHOD AddListener(flockIWebServiceAccountListener *aListener); \
  NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aListener); \
  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_IMETHOD InstantiateAll(void) { return _to InstantiateAll(); } \
  NS_IMETHOD RegisterWebService(flockIManageableWebService *aService) { return _to RegisterWebService(aService); } \
  NS_IMETHOD UnregisterWebService(flockIManageableWebService *aService) { return _to UnregisterWebService(aService); } \
  NS_IMETHOD AddListener(flockIWebServiceAccountListener *aListener) { return _to AddListener(aListener); } \
  NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aListener) { return _to RemoveListener(aListener); } \
  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_IMETHOD InstantiateAll(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->InstantiateAll(); } \
  NS_IMETHOD RegisterWebService(flockIManageableWebService *aService) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterWebService(aService); } \
  NS_IMETHOD UnregisterWebService(flockIManageableWebService *aService) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterWebService(aService); } \
  NS_IMETHOD AddListener(flockIWebServiceAccountListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aListener); } \
  NS_IMETHOD RemoveListener(flockIWebServiceAccountListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aListener); } \
  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 registerWebService (in flockIManageableWebService aService); */
NS_IMETHODIMP _MYCLASS_::RegisterWebService(flockIManageableWebService *aService)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void unregisterWebService (in flockIManageableWebService aService); */
NS_IMETHODIMP _MYCLASS_::UnregisterWebService(flockIManageableWebService *aService)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

/* void removeListener (in flockIWebServiceAccountListener aListener); */
NS_IMETHODIMP _MYCLASS_::RemoveListener(flockIWebServiceAccountListener *aListener)
{
    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__ */
