/*
 * 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

/* 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 "52f2e1a0-866e-472e-8230-f3e8ffa37a38"

#define FLOCKIAUTHENTICATIONMANAGER_IID \
  {0x52f2e1a0, 0x866e, 0x472e, \
    { 0x82, 0x30, 0xf3, 0xe8, 0xff, 0xa3, 0x7a, 0x38 }}

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

  NS_DEFINE_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_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
   */
  /* flockIPassword findPasswordFromRelatedAccount (in AString aServiceID, in AString aAccountID); */
  NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountID, flockIPassword **_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 AString aAccountURN, in boolean aIsLoggedIn); */
  NS_IMETHOD ReportAccountAuthState(const nsAString & aAccountURN, 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 AString aAccountURN); */
  NS_IMETHOD ReportCompleteLoginToNetwork(const nsAString & aAccountURN) = 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_IMETHOD ReportCompleteLogoutFromNetwork(const nsAString & aServiceID) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIAUTHENTICATIONMANAGER \
  NS_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName); \
  NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountID, flockIPassword **_retval); \
  NS_IMETHOD ReportAccountAuthState(const nsAString & aAccountURN, PRBool aIsLoggedIn); \
  NS_IMETHOD ReportCompleteLoginToNetwork(const nsAString & aAccountURN); \
  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_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName) { return _to JoinNetwork(aServiceID, aNetworkName); } \
  NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountID, flockIPassword **_retval) { return _to FindPasswordFromRelatedAccount(aServiceID, aAccountID, _retval); } \
  NS_IMETHOD ReportAccountAuthState(const nsAString & aAccountURN, PRBool aIsLoggedIn) { return _to ReportAccountAuthState(aAccountURN, aIsLoggedIn); } \
  NS_IMETHOD ReportCompleteLoginToNetwork(const nsAString & aAccountURN) { return _to ReportCompleteLoginToNetwork(aAccountURN); } \
  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_IMETHOD JoinNetwork(const nsAString & aServiceID, const nsAString & aNetworkName) { return !_to ? NS_ERROR_NULL_POINTER : _to->JoinNetwork(aServiceID, aNetworkName); } \
  NS_IMETHOD FindPasswordFromRelatedAccount(const nsAString & aServiceID, const nsAString & aAccountID, flockIPassword **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindPasswordFromRelatedAccount(aServiceID, aAccountID, _retval); } \
  NS_IMETHOD ReportAccountAuthState(const nsAString & aAccountURN, PRBool aIsLoggedIn) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReportAccountAuthState(aAccountURN, aIsLoggedIn); } \
  NS_IMETHOD ReportCompleteLoginToNetwork(const nsAString & aAccountURN) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReportCompleteLoginToNetwork(aAccountURN); } \
  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;
}

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

/* void reportAccountAuthState (in AString aAccountURN, in boolean aIsLoggedIn); */
NS_IMETHODIMP _MYCLASS_::ReportAccountAuthState(const nsAString & aAccountURN, PRBool aIsLoggedIn)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void reportCompleteLoginToNetwork (in AString aAccountURN); */
NS_IMETHODIMP _MYCLASS_::ReportCompleteLoginToNetwork(const nsAString & aAccountURN)
{
    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__ */
