PageRenderTime 83ms CodeModel.GetById 25ms RepoModel.GetById 21ms app.codeStats 0ms

/gecko_api/include/nsIProfileChangeStatus.h

http://firefox-mac-pdf.googlecode.com/
C Header | 192 lines | 56 code | 28 blank | 108 comment | 0 complexity | 5b024eabdda6afbb496298c9adcd4c31 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/profile/public/nsIProfileChangeStatus.idl
  3. */
  4. #ifndef __gen_nsIProfileChangeStatus_h__
  5. #define __gen_nsIProfileChangeStatus_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. /**
  14. * nsIObserver topics for profile changing. Profile changing happens in phases
  15. * in the order given below. An observer may register separately for each phase
  16. * of the process depending on its needs. The subject passed to the observer's
  17. * Observe() method can be QI'd to an nsIProfileChangeStatus.
  18. *
  19. * "profile-approve-change"
  20. * Called before a profile change is attempted. Typically,
  21. * the application level observer will ask the user if
  22. * he/she wants to stop all network activity, close all open
  23. * windows, etc. If the user says NO, the observer should
  24. * call the subject's vetoChange(). If any observer does
  25. * this, the profile will not be changed.
  26. *
  27. * "profile-change-teardown"
  28. * All async activity must be stopped in this phase. Typically,
  29. * the application level observer will close all open windows.
  30. * This is the last phase in which the subject's vetoChange()
  31. * method may still be called.
  32. * The next notification will be either
  33. * profile-change-teardown-veto or profile-before-change.
  34. *
  35. * "profile-change-teardown-veto"
  36. * This notification will only be sent, if the profile change
  37. * was vetoed during the profile-change-teardown phase.
  38. * This allows components to bring back required resources,
  39. * that were tore down on profile-change-teardown.
  40. *
  41. * "profile-before-change"
  42. * Called before the profile has changed. Use this notification
  43. * to prepare for the profile going away. If a component is
  44. * holding any state which needs to be flushed to a profile-relative
  45. * location, it should be done here.
  46. *
  47. * "profile-do-change"
  48. * Called after the profile has changed. Do the work to
  49. * respond to having a new profile. Any change which
  50. * affects others must be done in this phase.
  51. *
  52. * "profile-after-change"
  53. * Called after the profile has changed. Use this notification
  54. * to make changes that are dependent on what some other listener
  55. * did during its profile-do-change. For example, to respond to
  56. * new preferences.
  57. *
  58. * "profile-initial-state"
  59. * Called after all phases of a change have completed. Typically
  60. * in this phase, an application level observer will open a new window.
  61. *
  62. * Contexts for profile changes. These are passed as the someData param to the
  63. * observer's Observe() method.
  64. * "startup"
  65. * Going from no profile to a profile.
  66. *
  67. * The following topics happen in this context:
  68. * profile-do-change
  69. * profile-after-change
  70. *
  71. * "shutdown-persist"
  72. * The user is logging out and whatever data the observer stores
  73. * for the current profile should be released from memory and
  74. * saved to disk.
  75. *
  76. * "shutdown-cleanse"
  77. * The user is logging out and whatever data the observer stores
  78. * for the current profile should be released from memory and
  79. * deleted from disk.
  80. *
  81. * The following topics happen in both shutdown contexts:
  82. * profile-approve-change
  83. * profile-change-teardown
  84. * profile-before-change
  85. *
  86. * "switch"
  87. * Going from one profile to another.
  88. *
  89. * All of the above topics happen in a profile switch.
  90. *
  91. */
  92. /* starting interface: nsIProfileChangeStatus */
  93. #define NS_IPROFILECHANGESTATUS_IID_STR "2f977d43-5485-11d4-87e2-0010a4e75ef2"
  94. #define NS_IPROFILECHANGESTATUS_IID \
  95. {0x2f977d43, 0x5485, 0x11d4, \
  96. { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 }}
  97. class NS_NO_VTABLE NS_SCRIPTABLE nsIProfileChangeStatus : public nsISupports {
  98. public:
  99. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROFILECHANGESTATUS_IID)
  100. /* void vetoChange (); */
  101. NS_SCRIPTABLE NS_IMETHOD VetoChange(void) = 0;
  102. /**
  103. * Called by a profile change observer when a fatal error
  104. * occurred during the attempt to switch the profile.
  105. *
  106. * The profile should be considered in an unsafe condition,
  107. * and the profile manager should inform the user and
  108. * exit immediately.
  109. *
  110. */
  111. /* void changeFailed (); */
  112. NS_SCRIPTABLE NS_IMETHOD ChangeFailed(void) = 0;
  113. };
  114. NS_DEFINE_STATIC_IID_ACCESSOR(nsIProfileChangeStatus, NS_IPROFILECHANGESTATUS_IID)
  115. /* Use this macro when declaring classes that implement this interface. */
  116. #define NS_DECL_NSIPROFILECHANGESTATUS \
  117. NS_SCRIPTABLE NS_IMETHOD VetoChange(void); \
  118. NS_SCRIPTABLE NS_IMETHOD ChangeFailed(void);
  119. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  120. #define NS_FORWARD_NSIPROFILECHANGESTATUS(_to) \
  121. NS_SCRIPTABLE NS_IMETHOD VetoChange(void) { return _to VetoChange(); } \
  122. NS_SCRIPTABLE NS_IMETHOD ChangeFailed(void) { return _to ChangeFailed(); }
  123. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  124. #define NS_FORWARD_SAFE_NSIPROFILECHANGESTATUS(_to) \
  125. NS_SCRIPTABLE NS_IMETHOD VetoChange(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->VetoChange(); } \
  126. NS_SCRIPTABLE NS_IMETHOD ChangeFailed(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ChangeFailed(); }
  127. #if 0
  128. /* Use the code below as a template for the implementation class for this interface. */
  129. /* Header file */
  130. class nsProfileChangeStatus : public nsIProfileChangeStatus
  131. {
  132. public:
  133. NS_DECL_ISUPPORTS
  134. NS_DECL_NSIPROFILECHANGESTATUS
  135. nsProfileChangeStatus();
  136. private:
  137. ~nsProfileChangeStatus();
  138. protected:
  139. /* additional members */
  140. };
  141. /* Implementation file */
  142. NS_IMPL_ISUPPORTS1(nsProfileChangeStatus, nsIProfileChangeStatus)
  143. nsProfileChangeStatus::nsProfileChangeStatus()
  144. {
  145. /* member initializers and constructor code */
  146. }
  147. nsProfileChangeStatus::~nsProfileChangeStatus()
  148. {
  149. /* destructor code */
  150. }
  151. /* void vetoChange (); */
  152. NS_IMETHODIMP nsProfileChangeStatus::VetoChange()
  153. {
  154. return NS_ERROR_NOT_IMPLEMENTED;
  155. }
  156. /* void changeFailed (); */
  157. NS_IMETHODIMP nsProfileChangeStatus::ChangeFailed()
  158. {
  159. return NS_ERROR_NOT_IMPLEMENTED;
  160. }
  161. /* End of implementation class template. */
  162. #endif
  163. #endif /* __gen_nsIProfileChangeStatus_h__ */