sbBaseScreenSaverSuppressor.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2009 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef __SB_BASE_SCREEN_SAVER_SUPPRESSOR_H__
26 #define __SB_BASE_SCREEN_SAVER_SUPPRESSOR_H__
27 
28 #include "sbIScreenSaverSuppressor.h"
29 
30 #include <nsIObserver.h>
31 
32 #include <nsAutoLock.h>
33 #include <nsComponentManagerUtils.h>
34 #include <nsCOMPtr.h>
35 #include <nsStringGlue.h>
36 
37 class nsIComponentManager;
38 class nsIFile;
39 
40 struct nsModuleComponentInfo;
41 
43  public nsIObserver
44 {
45 public:
47  NS_DECL_NSIOBSERVER
48  NS_DECL_SBISCREENSAVERSUPPRESSOR
49 
52 
53  static NS_METHOD RegisterSelf(nsIComponentManager* aCompMgr,
54  nsIFile* aPath,
55  const char* aLoaderStr,
56  const char* aType,
57  const nsModuleComponentInfo *aInfo);
58 
59  nsresult Init();
60 
61  virtual nsresult OnSuppress(PRBool aSuppress) = 0;
62 
63 protected:
64  PRInt32 mSuppress;
65  PRPackedBool mUserSetting;
66  PRPackedBool mHasUserSetting;
67 };
68 
69 #define SB_BASE_SCREEN_SAVER_SUPPRESSOR_DESC \
70  "Songbird Screen Saver Suppressor Service"
71 #define SB_BASE_SCREEN_SAVER_SUPPRESSOR_CLASSNAME \
72  "sbScreenSaverSuppressor"
73 #define SB_BASE_SCREEN_SAVER_SUPPRESSOR_CONTRACTID \
74  "@songbirdnest.com/Songbird/ScreenSaverSuppressor;1"
75 #define SB_BASE_SCREEN_SAVER_SUPPRESSOR_CID \
76 { 0xe3247f9, 0xa111, 0x4d2a, { 0x86, 0x9a, 0x4, 0x39, 0x66, 0x10, 0x8d, 0x98 } }
77 
78 #endif // __SB_BASE_SCREEN_SAVER_SUPPRESSOR_H__
_updateCookies aPath
Get/Set Screen Saver Suppression.
NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER NS_DECL_SBISCREENSAVERSUPPRESSOR sbBaseScreenSaverSuppressor()
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
virtual nsresult OnSuppress(PRBool aSuppress)=0