PageRenderTime 103ms CodeModel.GetById 61ms app.highlight 6ms RepoModel.GetById 34ms app.codeStats 0ms

/gecko_api/include/nsICertificateDialogs.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 222 lines | 92 code | 39 blank | 91 comment | 0 complexity | 6893c9d7aa199390a1f027fd33ea78e9 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/security/manager/ssl/public/nsICertificateDialogs.idl
  3 */
  4
  5#ifndef __gen_nsICertificateDialogs_h__
  6#define __gen_nsICertificateDialogs_h__
  7
  8
  9#ifndef __gen_nsISupports_h__
 10#include "nsISupports.h"
 11#endif
 12
 13/* For IDL files that don't want to include root IDL files. */
 14#ifndef NS_NO_VTABLE
 15#define NS_NO_VTABLE
 16#endif
 17class nsIInterfaceRequestor; /* forward declaration */
 18
 19class nsIX509Cert; /* forward declaration */
 20
 21class nsICRLInfo; /* forward declaration */
 22
 23
 24/* starting interface:    nsICertificateDialogs */
 25#define NS_ICERTIFICATEDIALOGS_IID_STR "a03ca940-09be-11d5-ac5d-000064657374"
 26
 27#define NS_ICERTIFICATEDIALOGS_IID \
 28  {0xa03ca940, 0x09be, 0x11d5, \
 29    { 0xac, 0x5d, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
 30
 31/**
 32 * Functions that implement user interface dialogs to manage certificates.
 33 *
 34 * @status FROZEN
 35 */
 36class NS_NO_VTABLE NS_SCRIPTABLE nsICertificateDialogs : public nsISupports {
 37 public: 
 38
 39  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICERTIFICATEDIALOGS_IID)
 40
 41  /**
 42   *  UI shown when a user is asked to download a new CA cert.
 43   *  Provides user with ability to choose trust settings for the cert.
 44   *  Asks the user to grant permission to import the certificate.
 45   *
 46   *  @param ctx A user interface context.
 47   *  @param cert The certificate that is about to get installed.
 48   *  @param trust a bit mask of trust flags, 
 49   *               see nsIX509CertDB for possible values.
 50   *
 51   *  @return true if the user allows to import the certificate.
 52   */
 53  /* boolean confirmDownloadCACert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert, out unsigned long trust); */
 54  NS_SCRIPTABLE NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) = 0;
 55
 56  /**
 57   *  UI shown when a web site has delivered a CA certificate to
 58   *  be imported, but the certificate is already contained in the
 59   *  user's storage.
 60   *
 61   *  @param ctx A user interface context.
 62   */
 63  /* void notifyCACertExists (in nsIInterfaceRequestor ctx); */
 64  NS_SCRIPTABLE NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) = 0;
 65
 66  /**
 67   *  UI shown when a user's personal certificate is going to be
 68   *  exported to a backup file.
 69   *  The implementation of this dialog should make sure 
 70   *  to prompt the user to type the password twice in order to
 71   *  confirm correct input.
 72   *  The wording in the dialog should also motivate the user 
 73   *  to enter a strong password.
 74   *
 75   *  @param ctx A user interface context.
 76   *  @param password The password provided by the user.
 77   *
 78   *  @return false if the user requests to cancel.
 79   */
 80  /* boolean setPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
 81  NS_SCRIPTABLE NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) = 0;
 82
 83  /**
 84   *  UI shown when a user is about to restore a personal
 85   *  certificate from a backup file.
 86   *  The user is requested to enter the password
 87   *  that was used in the past to protect that backup file.
 88   *
 89   *  @param ctx A user interface context.
 90   *  @param password The password provided by the user.
 91   *
 92   *  @return false if the user requests to cancel.
 93   */
 94  /* boolean getPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
 95  NS_SCRIPTABLE NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) = 0;
 96
 97  /**
 98   *  UI shown when a certificate needs to be shown to the user.
 99   *  The implementation should try to display as many attributes
100   *  as possible.
101   *
102   *  @param ctx A user interface context.
103   *  @param cert The certificate to be shown to the user.
104   */
105  /* void viewCert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert); */
106  NS_SCRIPTABLE NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) = 0;
107
108  /**
109   *  UI shown after a Certificate Revocation List (CRL) has been
110   *  successfully imported.
111   *
112   *  @param ctx A user interface context.
113   *  @param crl Information describing the CRL that was imported.
114   */
115  /* void crlImportStatusDialog (in nsIInterfaceRequestor ctx, in nsICRLInfo crl); */
116  NS_SCRIPTABLE NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) = 0;
117
118};
119
120  NS_DEFINE_STATIC_IID_ACCESSOR(nsICertificateDialogs, NS_ICERTIFICATEDIALOGS_IID)
121
122/* Use this macro when declaring classes that implement this interface. */
123#define NS_DECL_NSICERTIFICATEDIALOGS \
124  NS_SCRIPTABLE NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval); \
125  NS_SCRIPTABLE NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx); \
126  NS_SCRIPTABLE NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval); \
127  NS_SCRIPTABLE NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval); \
128  NS_SCRIPTABLE NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert); \
129  NS_SCRIPTABLE NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl); 
130
131/* Use this macro to declare functions that forward the behavior of this interface to another object. */
132#define NS_FORWARD_NSICERTIFICATEDIALOGS(_to) \
133  NS_SCRIPTABLE NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) { return _to ConfirmDownloadCACert(ctx, cert, trust, _retval); } \
134  NS_SCRIPTABLE NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) { return _to NotifyCACertExists(ctx); } \
135  NS_SCRIPTABLE NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return _to SetPKCS12FilePassword(ctx, password, _retval); } \
136  NS_SCRIPTABLE NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return _to GetPKCS12FilePassword(ctx, password, _retval); } \
137  NS_SCRIPTABLE NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) { return _to ViewCert(ctx, cert); } \
138  NS_SCRIPTABLE NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) { return _to CrlImportStatusDialog(ctx, crl); } 
139
140/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
141#define NS_FORWARD_SAFE_NSICERTIFICATEDIALOGS(_to) \
142  NS_SCRIPTABLE NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConfirmDownloadCACert(ctx, cert, trust, _retval); } \
143  NS_SCRIPTABLE NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyCACertExists(ctx); } \
144  NS_SCRIPTABLE NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPKCS12FilePassword(ctx, password, _retval); } \
145  NS_SCRIPTABLE NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPKCS12FilePassword(ctx, password, _retval); } \
146  NS_SCRIPTABLE NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) { return !_to ? NS_ERROR_NULL_POINTER : _to->ViewCert(ctx, cert); } \
147  NS_SCRIPTABLE NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) { return !_to ? NS_ERROR_NULL_POINTER : _to->CrlImportStatusDialog(ctx, crl); } 
148
149#if 0
150/* Use the code below as a template for the implementation class for this interface. */
151
152/* Header file */
153class nsCertificateDialogs : public nsICertificateDialogs
154{
155public:
156  NS_DECL_ISUPPORTS
157  NS_DECL_NSICERTIFICATEDIALOGS
158
159  nsCertificateDialogs();
160
161private:
162  ~nsCertificateDialogs();
163
164protected:
165  /* additional members */
166};
167
168/* Implementation file */
169NS_IMPL_ISUPPORTS1(nsCertificateDialogs, nsICertificateDialogs)
170
171nsCertificateDialogs::nsCertificateDialogs()
172{
173  /* member initializers and constructor code */
174}
175
176nsCertificateDialogs::~nsCertificateDialogs()
177{
178  /* destructor code */
179}
180
181/* boolean confirmDownloadCACert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert, out unsigned long trust); */
182NS_IMETHODIMP nsCertificateDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval)
183{
184    return NS_ERROR_NOT_IMPLEMENTED;
185}
186
187/* void notifyCACertExists (in nsIInterfaceRequestor ctx); */
188NS_IMETHODIMP nsCertificateDialogs::NotifyCACertExists(nsIInterfaceRequestor *ctx)
189{
190    return NS_ERROR_NOT_IMPLEMENTED;
191}
192
193/* boolean setPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
194NS_IMETHODIMP nsCertificateDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval)
195{
196    return NS_ERROR_NOT_IMPLEMENTED;
197}
198
199/* boolean getPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
200NS_IMETHODIMP nsCertificateDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval)
201{
202    return NS_ERROR_NOT_IMPLEMENTED;
203}
204
205/* void viewCert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert); */
206NS_IMETHODIMP nsCertificateDialogs::ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert)
207{
208    return NS_ERROR_NOT_IMPLEMENTED;
209}
210
211/* void crlImportStatusDialog (in nsIInterfaceRequestor ctx, in nsICRLInfo crl); */
212NS_IMETHODIMP nsCertificateDialogs::CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl)
213{
214    return NS_ERROR_NOT_IMPLEMENTED;
215}
216
217/* End of implementation class template. */
218#endif
219
220#define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1"
221
222#endif /* __gen_nsICertificateDialogs_h__ */