PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/xpinstall/nsIXPIDialogService.h

#
C Header | 162 lines | 58 code | 30 blank | 74 comment | 0 complexity | f92b2491bde06e9482b3f0d39be3fe25 MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/xpinstall/public/nsIXPIDialogService.idl
  3. */
  4. #ifndef __gen_nsIXPIDialogService_h__
  5. #define __gen_nsIXPIDialogService_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 nsIDOMWindow; /* forward declaration */
  14. class nsIXPIProgressDialog; /* forward declaration */
  15. class nsIObserver; /* forward declaration */
  16. /* starting interface: nsIXPIDialogService */
  17. #define NS_IXPIDIALOGSERVICE_IID_STR "8cdd8baa-1dd2-11b2-909a-f0178da5c5ff"
  18. #define NS_IXPIDIALOGSERVICE_IID \
  19. {0x8cdd8baa, 0x1dd2, 0x11b2, \
  20. { 0x90, 0x9a, 0xf0, 0x17, 0x8d, 0xa5, 0xc5, 0xff }}
  21. /**
  22. * A service provided by embedding applications to override
  23. * the default XUL implmementation of XPInstall dialogs.
  24. *
  25. * Embedding applications which wish to override the default
  26. * XUL dialogs need to create a component which implements
  27. * this interface and registers with the Contract ID
  28. * "@mozilla.org/embedui/xpinstall-dialog-service;1"
  29. *
  30. * @status UNDER_REVIEW
  31. */
  32. class NS_NO_VTABLE nsIXPIDialogService : public nsISupports {
  33. public:
  34. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXPIDIALOGSERVICE_IID)
  35. /**
  36. * @brief Ask the user if it's OK to install
  37. *
  38. * When called the XPIDialogService implementation should pose an
  39. * install confirmation dialog and return the user's response
  40. *
  41. * @param parent a window that can be used to parent the modal dialog
  42. *
  43. * @param packageList For each install package there will be three strings,
  44. * a display name, a source URL, and a the name of the
  45. * organization that signed this install. Note that the
  46. * name of the signer is not verified. Verification
  47. * happens when the the install has completely downloaded.
  48. * Your user interface should only suggest that the
  49. * install may be signed by this organization name.
  50. * Note that an unsigned archive is indicated by an
  51. * empty string.
  52. *
  53. * @param count The number of strings in the packageList. This
  54. * will always be three times the number of
  55. * packages.
  56. *
  57. * @return true to install, false to cancel
  58. */
  59. /* boolean confirmInstall (in nsIDOMWindow parent, [array, size_is (count)] in wstring packageList, in unsigned long count); */
  60. NS_IMETHOD ConfirmInstall(nsIDOMWindow *parent, const PRUnichar **packageList, PRUint32 count, PRBool *_retval) = 0;
  61. /**
  62. * @brief Create and open a download-and-install progress dialog
  63. *
  64. * When called the XPIDialogService implementation creates and opens
  65. * a dialog to display the status of the install. When the dialog
  66. * is ready to be used then the observer must be called: the subject
  67. * is an nsIXPIProgressDialog that nsXPInstallManager can use to control
  68. * the dialog, the topic is "xpinstall-progress" and the data is "open".
  69. *
  70. * If the user wishes to cancel the download, the dialog can call the
  71. * observe method with the same subject and topic and the data "cancel".
  72. *
  73. * @note Unless this routine throws an exception the observer <b>must</b>
  74. * be called or nsXPInstallManager will wait forever and never clean
  75. * itself up.
  76. *
  77. * @param packageList three strings per package as in confirmInstall()
  78. * @param count the number of strings in the list
  79. * @param observer nsIObserver to receive messages from the dialog
  80. */
  81. /* void openProgressDialog ([array, size_is (count)] in wstring packageList, in unsigned long count, in nsIObserver observer); */
  82. NS_IMETHOD OpenProgressDialog(const PRUnichar **packageList, PRUint32 count, nsIObserver *observer) = 0;
  83. };
  84. /* Use this macro when declaring classes that implement this interface. */
  85. #define NS_DECL_NSIXPIDIALOGSERVICE \
  86. NS_IMETHOD ConfirmInstall(nsIDOMWindow *parent, const PRUnichar **packageList, PRUint32 count, PRBool *_retval); \
  87. NS_IMETHOD OpenProgressDialog(const PRUnichar **packageList, PRUint32 count, nsIObserver *observer);
  88. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  89. #define NS_FORWARD_NSIXPIDIALOGSERVICE(_to) \
  90. NS_IMETHOD ConfirmInstall(nsIDOMWindow *parent, const PRUnichar **packageList, PRUint32 count, PRBool *_retval) { return _to ConfirmInstall(parent, packageList, count, _retval); } \
  91. NS_IMETHOD OpenProgressDialog(const PRUnichar **packageList, PRUint32 count, nsIObserver *observer) { return _to OpenProgressDialog(packageList, count, observer); }
  92. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  93. #define NS_FORWARD_SAFE_NSIXPIDIALOGSERVICE(_to) \
  94. NS_IMETHOD ConfirmInstall(nsIDOMWindow *parent, const PRUnichar **packageList, PRUint32 count, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConfirmInstall(parent, packageList, count, _retval); } \
  95. NS_IMETHOD OpenProgressDialog(const PRUnichar **packageList, PRUint32 count, nsIObserver *observer) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenProgressDialog(packageList, count, observer); }
  96. #if 0
  97. /* Use the code below as a template for the implementation class for this interface. */
  98. /* Header file */
  99. class nsXPIDialogService : public nsIXPIDialogService
  100. {
  101. public:
  102. NS_DECL_ISUPPORTS
  103. NS_DECL_NSIXPIDIALOGSERVICE
  104. nsXPIDialogService();
  105. private:
  106. ~nsXPIDialogService();
  107. protected:
  108. /* additional members */
  109. };
  110. /* Implementation file */
  111. NS_IMPL_ISUPPORTS1(nsXPIDialogService, nsIXPIDialogService)
  112. nsXPIDialogService::nsXPIDialogService()
  113. {
  114. /* member initializers and constructor code */
  115. }
  116. nsXPIDialogService::~nsXPIDialogService()
  117. {
  118. /* destructor code */
  119. }
  120. /* boolean confirmInstall (in nsIDOMWindow parent, [array, size_is (count)] in wstring packageList, in unsigned long count); */
  121. NS_IMETHODIMP nsXPIDialogService::ConfirmInstall(nsIDOMWindow *parent, const PRUnichar **packageList, PRUint32 count, PRBool *_retval)
  122. {
  123. return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125. /* void openProgressDialog ([array, size_is (count)] in wstring packageList, in unsigned long count, in nsIObserver observer); */
  126. NS_IMETHODIMP nsXPIDialogService::OpenProgressDialog(const PRUnichar **packageList, PRUint32 count, nsIObserver *observer)
  127. {
  128. return NS_ERROR_NOT_IMPLEMENTED;
  129. }
  130. /* End of implementation class template. */
  131. #endif
  132. #endif /* __gen_nsIXPIDialogService_h__ */