nsIProfileChangeStatus.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/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 nsIProfileChangeStatus : public nsISupports {
  98. public:
  99. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPROFILECHANGESTATUS_IID)
  100. /* void vetoChange (); */
  101. 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_IMETHOD ChangeFailed(void) = 0;
  113. };
  114. /* Use this macro when declaring classes that implement this interface. */
  115. #define NS_DECL_NSIPROFILECHANGESTATUS \
  116. NS_IMETHOD VetoChange(void); \
  117. NS_IMETHOD ChangeFailed(void);
  118. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  119. #define NS_FORWARD_NSIPROFILECHANGESTATUS(_to) \
  120. NS_IMETHOD VetoChange(void) { return _to VetoChange(); } \
  121. NS_IMETHOD ChangeFailed(void) { return _to ChangeFailed(); }
  122. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  123. #define NS_FORWARD_SAFE_NSIPROFILECHANGESTATUS(_to) \
  124. NS_IMETHOD VetoChange(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->VetoChange(); } \
  125. NS_IMETHOD ChangeFailed(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ChangeFailed(); }
  126. #if 0
  127. /* Use the code below as a template for the implementation class for this interface. */
  128. /* Header file */
  129. class nsProfileChangeStatus : public nsIProfileChangeStatus
  130. {
  131. public:
  132. NS_DECL_ISUPPORTS
  133. NS_DECL_NSIPROFILECHANGESTATUS
  134. nsProfileChangeStatus();
  135. private:
  136. ~nsProfileChangeStatus();
  137. protected:
  138. /* additional members */
  139. };
  140. /* Implementation file */
  141. NS_IMPL_ISUPPORTS1(nsProfileChangeStatus, nsIProfileChangeStatus)
  142. nsProfileChangeStatus::nsProfileChangeStatus()
  143. {
  144. /* member initializers and constructor code */
  145. }
  146. nsProfileChangeStatus::~nsProfileChangeStatus()
  147. {
  148. /* destructor code */
  149. }
  150. /* void vetoChange (); */
  151. NS_IMETHODIMP nsProfileChangeStatus::VetoChange()
  152. {
  153. return NS_ERROR_NOT_IMPLEMENTED;
  154. }
  155. /* void changeFailed (); */
  156. NS_IMETHODIMP nsProfileChangeStatus::ChangeFailed()
  157. {
  158. return NS_ERROR_NOT_IMPLEMENTED;
  159. }
  160. /* End of implementation class template. */
  161. #endif
  162. #endif /* __gen_nsIProfileChangeStatus_h__ */