nsIProfileChangeStatus.idl 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Netscape Communications Corporation.
  19. * Portions created by the Initial Developer are Copyright (C) 1998
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. * [email protected]
  24. *
  25. * Alternatively, the contents of this file may be used under the terms of
  26. * either of the GNU General Public License Version 2 or later (the "GPL"),
  27. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. * in which case the provisions of the GPL or the LGPL are applicable instead
  29. * of those above. If you wish to allow use of your version of this file only
  30. * under the terms of either the GPL or the LGPL, and not to allow others to
  31. * use your version of this file under the terms of the MPL, indicate your
  32. * decision by deleting the provisions above and replace them with the notice
  33. * and other provisions required by the GPL or the LGPL. If you do not delete
  34. * the provisions above, a recipient may use your version of this file under
  35. * the terms of any one of the MPL, the GPL or the LGPL.
  36. *
  37. * ***** END LICENSE BLOCK ***** */
  38. #include "nsISupports.idl"
  39. %{C++
  40. /**
  41. * nsIObserver topics for profile changing. Profile changing happens in phases
  42. * in the order given below. An observer may register separately for each phase
  43. * of the process depending on its needs. The subject passed to the observer's
  44. * Observe() method can be QI'd to an nsIProfileChangeStatus.
  45. *
  46. * "profile-approve-change"
  47. * Called before a profile change is attempted. Typically,
  48. * the application level observer will ask the user if
  49. * he/she wants to stop all network activity, close all open
  50. * windows, etc. If the user says NO, the observer should
  51. * call the subject's vetoChange(). If any observer does
  52. * this, the profile will not be changed.
  53. *
  54. * "profile-change-teardown"
  55. * All async activity must be stopped in this phase. Typically,
  56. * the application level observer will close all open windows.
  57. * This is the last phase in which the subject's vetoChange()
  58. * method may still be called.
  59. * The next notification will be either
  60. * profile-change-teardown-veto or profile-before-change.
  61. *
  62. * "profile-change-teardown-veto"
  63. * This notification will only be sent, if the profile change
  64. * was vetoed during the profile-change-teardown phase.
  65. * This allows components to bring back required resources,
  66. * that were tore down on profile-change-teardown.
  67. *
  68. * "profile-before-change"
  69. * Called before the profile has changed. Use this notification
  70. * to prepare for the profile going away. If a component is
  71. * holding any state which needs to be flushed to a profile-relative
  72. * location, it should be done here.
  73. *
  74. * "profile-do-change"
  75. * Called after the profile has changed. Do the work to
  76. * respond to having a new profile. Any change which
  77. * affects others must be done in this phase.
  78. *
  79. * "profile-after-change"
  80. * Called after the profile has changed. Use this notification
  81. * to make changes that are dependent on what some other listener
  82. * did during its profile-do-change. For example, to respond to
  83. * new preferences.
  84. *
  85. * "profile-initial-state"
  86. * Called after all phases of a change have completed. Typically
  87. * in this phase, an application level observer will open a new window.
  88. *
  89. * Contexts for profile changes. These are passed as the someData param to the
  90. * observer's Observe() method.
  91. * "startup"
  92. * Going from no profile to a profile.
  93. *
  94. * The following topics happen in this context:
  95. * profile-do-change
  96. * profile-after-change
  97. *
  98. * "shutdown-persist"
  99. * The user is logging out and whatever data the observer stores
  100. * for the current profile should be released from memory and
  101. * saved to disk.
  102. *
  103. * "shutdown-cleanse"
  104. * The user is logging out and whatever data the observer stores
  105. * for the current profile should be released from memory and
  106. * deleted from disk.
  107. *
  108. * The following topics happen in both shutdown contexts:
  109. * profile-approve-change
  110. * profile-change-teardown
  111. * profile-before-change
  112. *
  113. * "switch"
  114. * Going from one profile to another.
  115. *
  116. * All of the above topics happen in a profile switch.
  117. *
  118. */
  119. %}
  120. [scriptable, uuid(2f977d43-5485-11d4-87e2-0010a4e75ef2)]
  121. interface nsIProfileChangeStatus : nsISupports {
  122. void vetoChange();
  123. /**
  124. * Called by a profile change observer when a fatal error
  125. * occurred during the attempt to switch the profile.
  126. *
  127. * The profile should be considered in an unsafe condition,
  128. * and the profile manager should inform the user and
  129. * exit immediately.
  130. *
  131. */
  132. void changeFailed();
  133. };