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