24
|
1 |
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#ifndef __PHONEONOFF_H__
|
|
17 |
#define __PHONEONOFF_H__
|
|
18 |
|
|
19 |
// System includes
|
|
20 |
#include <e32base.h>
|
|
21 |
#include <e32property.h>
|
|
22 |
|
|
23 |
|
|
24 |
//
|
|
25 |
// ------> MPhoneOnOffObserver (header)
|
|
26 |
//
|
|
27 |
class MPhoneOnOffObserver
|
|
28 |
/**
|
|
29 |
@internalComponent
|
|
30 |
*/
|
|
31 |
{
|
|
32 |
//
|
|
33 |
public: // FROM MPhoneOnOffObserver
|
|
34 |
//
|
|
35 |
IMPORT_C virtual void PhoneIsOff();
|
|
36 |
IMPORT_C virtual void PhoneIsOn();
|
|
37 |
};
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
//
|
|
43 |
// ------> CPhoneOnOff (header)
|
|
44 |
//
|
|
45 |
class CPhoneOnOff : public CActive
|
|
46 |
/**
|
|
47 |
@internalComponent
|
|
48 |
*/
|
|
49 |
{
|
|
50 |
//
|
|
51 |
public: // CONSTRUCT / DESTRUCT
|
|
52 |
//
|
|
53 |
CPhoneOnOff(MPhoneOnOffObserver& aPhoneWatcher);
|
|
54 |
~CPhoneOnOff();
|
|
55 |
void ConstructL();
|
|
56 |
|
|
57 |
//
|
|
58 |
public: // ISSUE REQUEST
|
|
59 |
//
|
|
60 |
void IssueRequestL();
|
|
61 |
|
|
62 |
//
|
|
63 |
private: // FROM CActive
|
|
64 |
//
|
|
65 |
void RunL();
|
|
66 |
void DoCancel();
|
|
67 |
|
|
68 |
//
|
|
69 |
private: // MEMBER DATA
|
|
70 |
//
|
|
71 |
RProperty iPhonePowerProperty;
|
|
72 |
TBool iWaitingForPhoneOff;
|
|
73 |
MPhoneOnOffObserver& iPropertyPhoneWatcher;
|
|
74 |
};
|
|
75 |
|
|
76 |
|
|
77 |
#endif
|