sbScreenSaverSuppressor.mm
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 
26 
27 #include <CoreServices/CoreServices.h>
28 
31 
33 {
34 }
35 
37 {
41  }
42 }
43 
44 /*virtual*/ nsresult
46 {
47  nsresult rv;
48 
49  if (aSuppress) {
51  mUpdateSystemActivityTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
52  NS_ENSURE_SUCCESS(rv, rv);
53  rv = mUpdateSystemActivityTimer->InitWithFuncCallback
55  this,
57  nsITimer::TYPE_REPEATING_SLACK);
58  NS_ENSURE_SUCCESS(rv, rv);
59  }
60  }
61  else {
63  rv = mUpdateSystemActivityTimer->Cancel();
64  NS_ENSURE_SUCCESS(rv, rv);
66  }
67  }
68 
69  return NS_OK;
70 }
71 
72 /*static*/ void
74  void* aClosure)
75 {
76  // Update system activity to suppress the screen saver.
77  UpdateSystemActivity(UsrActivity);
78 }
79 
static const PRUint32 UPDATE_SYSTEM_ACTIVITY_PERIOD
nsCOMPtr< nsITimer > mUpdateSystemActivityTimer
return NS_OK
static void UpdateSystemActivityCallback(nsITimer *aTimer, void *aClosure)
NS_IMPL_ISUPPORTS_INHERITED0(sbScreenSaverSuppressor, sbBaseScreenSaverSuppressor) sbScreenSaverSuppressor
void * aClosure
Definition: sbArray.cpp:52
virtual NS_DECL_ISUPPORTS_INHERITED nsresult OnSuppress(PRBool aSuppress)