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