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

#ifndef __gen_flockIManageableWebService_h__
#define __gen_flockIManageableWebService_h__


#ifndef __gen_nsIDOMHTMLDocument_h__
#include "nsIDOMHTMLDocument.h"
#endif

#ifndef __gen_nsIDOMHTMLFormElement_h__
#include "nsIDOMHTMLFormElement.h"
#endif

#ifndef __gen_nsIPassword_h__
#include "nsIPassword.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:    flockIManageableWebService */
#define FLOCKIMANAGEABLEWEBSERVICE_IID_STR "b2c2757f-f41e-4c71-bf20-b5da1ee3f5b4"

#define FLOCKIMANAGEABLEWEBSERVICE_IID \
  {0xb2c2757f, 0xf41e, 0x4c71, \
    { 0xbf, 0x20, 0xb5, 0xda, 0x1e, 0xe3, 0xf5, 0xb4 }}

/**
 * Represents a web service that can be managed by the Web Service Manager.
 *
 * Implementing this interface is insufficient for a web service component to
 * be managed by the Web Service Manager.  The component must also explicitly
 * register itself by calling the registerWebService() method of
 * flockIWebServiceManager.
 *
 * More documentation here:
 * http://wiki.flock.com/index.php?title=Danphe:AccountsAndServices
 *
 * @see flockIWebServiceManager
 */
class NS_NO_VTABLE flockIManageableWebService : public flockIWebService {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(FLOCKIMANAGEABLEWEBSERVICE_IID)

  /** Comma-separated list of web domains owned by the service */
  /* readonly attribute AString domains; */
  NS_IMETHOD GetDomains(nsAString & aDomains) = 0;

  /** URL to redirect the user when we want him to log in */
  /* readonly attribute AString loginURL; */
  NS_IMETHOD GetLoginURL(nsAString & aLoginURL) = 0;

  /**
   * Determine whether the specified document represents a successful login.
   * No distinction is made between the first login landing page and subsequent
   * pages.  In other words, this function should return TRUE as long as the
   * aDocument represents a page in a logged-in state.
   *
   * This function may assume that .ownsDocument() has already been called on
   * the document in question, and has returned TRUE.
   *
   * @return TRUE iff aDocument reveals that the use is logged in to this
   *         web service.
   * @see ownsDocument
   */
  /* boolean docRepresentsSuccessfulLogin (in nsIDOMHTMLDocument aDocument); */
  NS_IMETHOD DocRepresentsSuccessfulLogin(nsIDOMHTMLDocument *aDocument, PRBool *_retval) = 0;

  /**
   * Retrieve the account ID represented by aDocument.  The account in question
   * may or may not be known by Flock.
   *
   * This function may assume that .docRepresentsSuccessfulLogin() has already
   * been called on the same document, and has returned TRUE.
   *
   * @param aDocument (in) an HTML document object
   * @return The account ID as a string, or else null if an account ID can not
   *         be determined.
   * @see docRepresentsSuccessfulLogin
   */
  /* AString getAccountIDFromDocument (in nsIDOMHTMLDocument aDocument); */
  NS_IMETHOD GetAccountIDFromDocument(nsIDOMHTMLDocument *aDocument, nsAString & _retval) = 0;

  /**
   * Retrieve the login credentials from an HTML form.
   *
   * This function may assume that .ownsLoginForm() has already been called on
   * the form in question, and has returned TRUE.
   *
   * @param aForm (in) the HTML form to check
   * @return An nsIPassword object with the login/password, or else null if the
   *         login/password can not be determined.
   * @see ownsLoginForm
   */
  /* nsIPassword getCredentialsFromForm (in nsIDOMHTMLFormElement aForm); */
  NS_IMETHOD GetCredentialsFromForm(nsIDOMHTMLFormElement *aForm, nsIPassword **_retval) = 0;

  /**
   * Indicates whether the specified document is one that the service 'owns' or
   * cares about.
   *
   * Note that if the service has provided a value for the 'domains' attribute,
   * then this function will only get called for documents whose URL falls
   * within the specified domains... so doing a domain check again in this
   * function would be redundant.
   *
   * @param aDocument (in) an HTML document to check
   * @return TRUE iff the service cares about this document/URL, else FALSE
   * @see domains
   */
  /* boolean ownsDocument (in nsIDOMHTMLDocument aDocument); */
  NS_IMETHOD OwnsDocument(nsIDOMHTMLDocument *aDocument, PRBool *_retval) = 0;

  /**
   * Indicated whether the specified HTML form is one that the service 'owns'
   * or cares about.  This could be because it's a login, sign-up or
   * change-password form.
   *
   * NOTE: it is incorrect to assume that ownsDocument has already passed for
   * the form's document, or that the form's domain has been checked.  This
   * function must do all necessary checks to ensure that the form in question
   * is actually a login form for this service.
   *
   * @param aForm (in) an HTML form to check
   * @return TRUE iff this is a login form for this service, else FALSE
   */
  /* boolean ownsLoginForm (in nsIDOMHTMLFormElement aForm); */
  NS_IMETHOD OwnsLoginForm(nsIDOMHTMLFormElement *aForm, PRBool *_retval) = 0;

  /**
   * Gives the service an opportunity to update the status of it's account(s).
   * In particular, this should detect whether account(s) are logged in or
   * logged out, and update the isAuthenticated RDF property of those accounts
   * as appropriate.
   *
   * This function may assume that .ownsDocument() has already been called for
   * the document in question, and has returned TRUE.
   *
   * @param aDocument (in) an HTML document to check
   * @param aAcctURN (in) the RDF node ID of an account which has already been
   *        detected as logged in on this page.  If not provided, then no
   *        account was detected as being logged in for aDocument.
   * @see ownsDocument
   */
  /* void updateAccountStatusFromDocument (in nsIDOMHTMLDocument aDocument, in AString aAcctURN); */
  NS_IMETHOD UpdateAccountStatusFromDocument(nsIDOMHTMLDocument *aDocument, const nsAString & aAcctURN) = 0;

  /**
   * Returns a string derived from the current state of session cookies for
   * service.  This is used to determine whether the user is still logged in
   * to the same account, in cases where we can't tell that simply by looking
   * at the document.
   */
  /* AString getSessionValue (); */
  NS_IMETHOD GetSessionValue(nsAString & _retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKIMANAGEABLEWEBSERVICE \
  NS_IMETHOD GetDomains(nsAString & aDomains); \
  NS_IMETHOD GetLoginURL(nsAString & aLoginURL); \
  NS_IMETHOD DocRepresentsSuccessfulLogin(nsIDOMHTMLDocument *aDocument, PRBool *_retval); \
  NS_IMETHOD GetAccountIDFromDocument(nsIDOMHTMLDocument *aDocument, nsAString & _retval); \
  NS_IMETHOD GetCredentialsFromForm(nsIDOMHTMLFormElement *aForm, nsIPassword **_retval); \
  NS_IMETHOD OwnsDocument(nsIDOMHTMLDocument *aDocument, PRBool *_retval); \
  NS_IMETHOD OwnsLoginForm(nsIDOMHTMLFormElement *aForm, PRBool *_retval); \
  NS_IMETHOD UpdateAccountStatusFromDocument(nsIDOMHTMLDocument *aDocument, const nsAString & aAcctURN); \
  NS_IMETHOD GetSessionValue(nsAString & _retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_FLOCKIMANAGEABLEWEBSERVICE(_to) \
  NS_IMETHOD GetDomains(nsAString & aDomains) { return _to GetDomains(aDomains); } \
  NS_IMETHOD GetLoginURL(nsAString & aLoginURL) { return _to GetLoginURL(aLoginURL); } \
  NS_IMETHOD DocRepresentsSuccessfulLogin(nsIDOMHTMLDocument *aDocument, PRBool *_retval) { return _to DocRepresentsSuccessfulLogin(aDocument, _retval); } \
  NS_IMETHOD GetAccountIDFromDocument(nsIDOMHTMLDocument *aDocument, nsAString & _retval) { return _to GetAccountIDFromDocument(aDocument, _retval); } \
  NS_IMETHOD GetCredentialsFromForm(nsIDOMHTMLFormElement *aForm, nsIPassword **_retval) { return _to GetCredentialsFromForm(aForm, _retval); } \
  NS_IMETHOD OwnsDocument(nsIDOMHTMLDocument *aDocument, PRBool *_retval) { return _to OwnsDocument(aDocument, _retval); } \
  NS_IMETHOD OwnsLoginForm(nsIDOMHTMLFormElement *aForm, PRBool *_retval) { return _to OwnsLoginForm(aForm, _retval); } \
  NS_IMETHOD UpdateAccountStatusFromDocument(nsIDOMHTMLDocument *aDocument, const nsAString & aAcctURN) { return _to UpdateAccountStatusFromDocument(aDocument, aAcctURN); } \
  NS_IMETHOD GetSessionValue(nsAString & _retval) { return _to GetSessionValue(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_FLOCKIMANAGEABLEWEBSERVICE(_to) \
  NS_IMETHOD GetDomains(nsAString & aDomains) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDomains(aDomains); } \
  NS_IMETHOD GetLoginURL(nsAString & aLoginURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoginURL(aLoginURL); } \
  NS_IMETHOD DocRepresentsSuccessfulLogin(nsIDOMHTMLDocument *aDocument, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->DocRepresentsSuccessfulLogin(aDocument, _retval); } \
  NS_IMETHOD GetAccountIDFromDocument(nsIDOMHTMLDocument *aDocument, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAccountIDFromDocument(aDocument, _retval); } \
  NS_IMETHOD GetCredentialsFromForm(nsIDOMHTMLFormElement *aForm, nsIPassword **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCredentialsFromForm(aForm, _retval); } \
  NS_IMETHOD OwnsDocument(nsIDOMHTMLDocument *aDocument, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OwnsDocument(aDocument, _retval); } \
  NS_IMETHOD OwnsLoginForm(nsIDOMHTMLFormElement *aForm, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OwnsLoginForm(aForm, _retval); } \
  NS_IMETHOD UpdateAccountStatusFromDocument(nsIDOMHTMLDocument *aDocument, const nsAString & aAcctURN) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateAccountStatusFromDocument(aDocument, aAcctURN); } \
  NS_IMETHOD GetSessionValue(nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSessionValue(_retval); } 

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

/* Header file */
class _MYCLASS_ : public flockIManageableWebService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKIMANAGEABLEWEBSERVICE

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* readonly attribute AString domains; */
NS_IMETHODIMP _MYCLASS_::GetDomains(nsAString & aDomains)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute AString loginURL; */
NS_IMETHODIMP _MYCLASS_::GetLoginURL(nsAString & aLoginURL)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean docRepresentsSuccessfulLogin (in nsIDOMHTMLDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::DocRepresentsSuccessfulLogin(nsIDOMHTMLDocument *aDocument, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getAccountIDFromDocument (in nsIDOMHTMLDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::GetAccountIDFromDocument(nsIDOMHTMLDocument *aDocument, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIPassword getCredentialsFromForm (in nsIDOMHTMLFormElement aForm); */
NS_IMETHODIMP _MYCLASS_::GetCredentialsFromForm(nsIDOMHTMLFormElement *aForm, nsIPassword **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean ownsDocument (in nsIDOMHTMLDocument aDocument); */
NS_IMETHODIMP _MYCLASS_::OwnsDocument(nsIDOMHTMLDocument *aDocument, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean ownsLoginForm (in nsIDOMHTMLFormElement aForm); */
NS_IMETHODIMP _MYCLASS_::OwnsLoginForm(nsIDOMHTMLFormElement *aForm, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void updateAccountStatusFromDocument (in nsIDOMHTMLDocument aDocument, in AString aAcctURN); */
NS_IMETHODIMP _MYCLASS_::UpdateAccountStatusFromDocument(nsIDOMHTMLDocument *aDocument, const nsAString & aAcctURN)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getSessionValue (); */
NS_IMETHODIMP _MYCLASS_::GetSessionValue(nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_flockIManageableWebService_h__ */
