19
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: describes system information notifiers.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __SYSUSERACTIVITY_H__
|
|
20 |
#define __SYSUSERACTIVITY_H__
|
|
21 |
|
|
22 |
//INCLUDES
|
|
23 |
#include "sysinfo.h"
|
|
24 |
#include "activerequests.h"
|
|
25 |
|
|
26 |
// FORWARD DECLARATIONS
|
|
27 |
class CUserActivityManager;
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
* @ref CUserActivity active object class to handle user activity and user
|
|
32 |
* inactivity notifications.
|
|
33 |
*
|
|
34 |
* @lib sysinfoservice.lib
|
|
35 |
* @since S60 3.2
|
|
36 |
*/
|
|
37 |
NONSHARABLE_CLASS(CUserActivity): public CActiveRequest
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
/**
|
|
41 |
* Two-phased constructor.
|
|
42 |
*
|
|
43 |
* @return A new instance of this class.
|
|
44 |
*/
|
|
45 |
static CUserActivity* NewL(const TSysRequest& aRequest);
|
|
46 |
/**
|
|
47 |
* Destructor.
|
|
48 |
*/
|
|
49 |
~CUserActivity();
|
|
50 |
|
|
51 |
private:
|
|
52 |
// Enumeration of user events.
|
|
53 |
enum TEvent
|
|
54 |
{
|
|
55 |
EUSERACTIVITY,
|
|
56 |
EUSERINACTIVITY
|
|
57 |
};
|
|
58 |
|
|
59 |
/**
|
|
60 |
* C++ default constructor.
|
|
61 |
*/
|
|
62 |
CUserActivity( TSysRequest::TRequestType aReqType,TInt32 aTransID,
|
|
63 |
ISystemObserver* aObsrvr );
|
|
64 |
|
|
65 |
/**
|
|
66 |
* By default Symbian 2nd phase constructor is private.
|
|
67 |
*/
|
|
68 |
void ConstructL(const TSysRequest& aRequest);
|
|
69 |
|
|
70 |
public:
|
|
71 |
/**
|
|
72 |
* Issues user activity and inactivity request.
|
|
73 |
*/
|
|
74 |
TInt Request();
|
|
75 |
|
|
76 |
protected: // from CActive
|
|
77 |
void RunL();
|
|
78 |
void DoCancel();
|
|
79 |
|
|
80 |
protected:
|
|
81 |
/**
|
|
82 |
* call back handle to handle inactivity event.
|
|
83 |
*/
|
|
84 |
static TInt HandleInactiveEventL(TAny* aPtr);
|
|
85 |
/**
|
|
86 |
* call back handle to handle activity event.
|
|
87 |
*/
|
|
88 |
static TInt HandleActiveEventL(TAny* aPtr);
|
|
89 |
/**
|
|
90 |
* call back handle to handle activity event.
|
|
91 |
*/
|
|
92 |
void HandleReqResponseL(TEvent aEvent);
|
|
93 |
|
|
94 |
private: // DATA
|
|
95 |
|
|
96 |
//Activity manager handle.
|
|
97 |
CUserActivityManager* iActivityManager;
|
|
98 |
|
|
99 |
// TimeOut value for user inactivity notification.
|
|
100 |
TInt iTimeout;
|
|
101 |
};
|
|
102 |
|
|
103 |
#endif __SYSUSERACTIVITY_H__ |