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

#ifndef __gen_flockIAuthenticationManager_h__
#define __gen_flockIAuthenticationManager_h__


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

#ifndef __gen_flockIAccountUtils_h__
#include "flockIAccountUtils.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:    flockIAuthenticationManager */
#define FLOCKIAUTHENTICATIONMANAGER_IID_STR "22397448-c6fc-4bc4-8317-76f3fc391234"

#define FLOCKIAUTHENTICATIONMANAGER_IID \
  {0x22397448, 0xc6fc, 0x4bc4, \
    { 0x83, 0x17, 0x76, 0xf3, 0xfc, 0x39, 0x12, 0x34 }}

/**
 * An authentication manager is responsible for coordinating the auth states of
 * multiple related accounts according to known sets of rules.
 *
 * @see flockILoginWebService
 * @see flockIWebServiceAccount
 */
class NS_NO_VTABLE NS_SCRIPTABLE flockIAuthenticationManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(FLOCKIAUTHENTICATIONMANAGER_IID)

  /**
   * Designates a particular service as belonging to a particular network.  This
   * means that account auth states for aServiceID are related to account auth
   * states for other services sharing the same aNetworkName.
   */
  /* void joinNetwork (in AString aServiceID, in AString aNetworkName); */
  NS_SCRIPTABLE NS_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName) = 0;

  /**
   * Checks to see if we already have a known password for a given account ID
   * within a given network.
   *
   * @param aServiceID (in) Contract ID of the service that has been logged out,
   *        from which the network is derived.
   * @param aAccountId (in) ID of the account, which will be common across all
   *        services in the same network.
   * @return null if no matching password was found
   */
  /* flockILoginInfo findPasswordFromRelatedAccount (in AString aServiceID, in AString aAccountId); */
  NS_SCRIPTABLE NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountId, flockILoginInfo **_retval) = 0;

  /**
   * Tells the authentication manager that a particular account is either
   * logged in or logged out.  The authentication manager is then responsible
   * for determining whether any other configured accounts need to have their
   * auth states updated as a result.
   */
  /* void reportAccountAuthState (in flockIWebServiceAccount aAccount, in boolean aIsLoggedIn); */
  NS_SCRIPTABLE NS_IMETHOD ReportAccountAuthState(flockIWebServiceAccount *aAccount, PRBool aIsLoggedIn) = 0;

  /**
   * Tells the authentication manager that a complete authentication has been
   * detected, meaning that ALL accounts with the same ID in that network are
   * logged in.
   */
  /* void reportCompleteLoginToNetwork (in flockIWebServiceAccount aAccount); */
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLoginToNetwork(flockIWebServiceAccount *aAccount) = 0;

  /**
   * Tells the authentication manager that a complete de-authentication has been
   * detected.  The authentication manager is then responsible for ensuring that
   * all related accounts are logged out.
   *
   * @param aServiceID (in) Contract ID of the service that has been logged out,
   *        from which the network is derived.
   */
  /* void reportCompleteLogoutFromNetwork (in AString aServiceID); */
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLogoutFromNetwork(const nsAString & aServiceID) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(flockIAuthenticationManager, FLOCKIAUTHENTICATIONMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIAUTHENTICATIONMANAGER \
  NS_SCRIPTABLE NS_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName); \
  NS_SCRIPTABLE NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountId, flockILoginInfo **_retval); \
  NS_SCRIPTABLE NS_IMETHOD ReportAccountAuthState(flockIWebServiceAccount *aAccount, PRBool aIsLoggedIn); \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLoginToNetwork(flockIWebServiceAccount *aAccount); \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLogoutFromNetwork(const nsAString & aServiceID); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_FLOCKIAUTHENTICATIONMANAGER(_to) \
  NS_SCRIPTABLE NS_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName) { return _to JoinNetwork(aServiceID, aNetworkName); } \
  NS_SCRIPTABLE NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountId, flockILoginInfo **_retval) { return _to FindPasswordFromRelatedAccount(aServiceID, aAccountId, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ReportAccountAuthState(flockIWebServiceAccount *aAccount, PRBool aIsLoggedIn) { return _to ReportAccountAuthState(aAccount, aIsLoggedIn); } \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLoginToNetwork(flockIWebServiceAccount *aAccount) { return _to ReportCompleteLoginToNetwork(aAccount); } \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLogoutFromNetwork(const nsAString & aServiceID) { return _to ReportCompleteLogoutFromNetwork(aServiceID); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_FLOCKIAUTHENTICATIONMANAGER(_to) \
  NS_SCRIPTABLE NS_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName) { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinNetwork(aServiceID, aNetworkName); } \
  NS_SCRIPTABLE NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountId, flockILoginInfo **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindPasswordFromRelatedAccount(aServiceID, aAccountId, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ReportAccountAuthState(flockIWebServiceAccount *aAccount, PRBool aIsLoggedIn) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReportAccountAuthState(aAccount, aIsLoggedIn); } \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLoginToNetwork(flockIWebServiceAccount *aAccount) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReportCompleteLoginToNetwork(aAccount); } \
  NS_SCRIPTABLE NS_IMETHOD ReportCompleteLogoutFromNetwork(const nsAString & aServiceID) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReportCompleteLogoutFromNetwork(aServiceID); } 

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

/* Header file */
class _MYCLASS_ : public flockIAuthenticationManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKIAUTHENTICATIONMANAGER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* void joinNetwork (in AString aServiceID, in AString aNetworkName); */
NS_IMETHODIMP _MYCLASS_::JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* flockILoginInfo findPasswordFromRelatedAccount (in AString aServiceID, in AString aAccountId); */
NS_IMETHODIMP _MYCLASS_::FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountId, flockILoginInfo **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void reportAccountAuthState (in flockIWebServiceAccount aAccount, in boolean aIsLoggedIn); */
NS_IMETHODIMP _MYCLASS_::ReportAccountAuthState(flockIWebServiceAccount *aAccount, PRBool aIsLoggedIn)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

/* void reportCompleteLogoutFromNetwork (in AString aServiceID); */
NS_IMETHODIMP _MYCLASS_::ReportCompleteLogoutFromNetwork(const nsAString & aServiceID)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_flockIAuthenticationManager_h__ */
