60
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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 "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: Defines the CWaitingObserver class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef CWAITINGOBSERVER_H
|
|
22 |
#define CWAITINGOBSERVER_H
|
|
23 |
|
|
24 |
#include <etelmm.h> // RMobilePhone
|
|
25 |
|
|
26 |
// FORWARD DECLARATIONS
|
|
27 |
class CMsgIndicatorPluginImplementation;
|
|
28 |
|
|
29 |
enum TIndicatorMessageType
|
|
30 |
{
|
|
31 |
EIndicatorMessageTypeFax,
|
|
32 |
EIndicatorMessageTypeVMLine1,
|
|
33 |
EIndicatorMessageTypeVMLine2,
|
|
34 |
}; // TIndicatorMessageType
|
|
35 |
|
|
36 |
class CWaitingObserver:
|
|
37 |
public CActive
|
|
38 |
{
|
|
39 |
public: // Constructors and destructor
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Two-phased constructor.
|
|
43 |
*/
|
|
44 |
static CWaitingObserver* NewL( RMobilePhone &aMobilePhone, CMsgIndicatorPluginImplementation& iIndicatorPlugin );
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Destructor.
|
|
48 |
*/
|
|
49 |
virtual ~CWaitingObserver();
|
|
50 |
|
|
51 |
TInt GetMsgCount(const TIndicatorMessageType aMsgType);
|
|
52 |
|
|
53 |
public: // From CActive
|
|
54 |
|
|
55 |
/**
|
|
56 |
* RunL
|
|
57 |
*/
|
|
58 |
void RunL();
|
|
59 |
|
|
60 |
/**
|
|
61 |
* DoCancel
|
|
62 |
*/
|
|
63 |
void DoCancel();
|
|
64 |
|
|
65 |
private: // Constructors and destructor
|
|
66 |
|
|
67 |
/**
|
|
68 |
* C++ default constructor.
|
|
69 |
*/
|
|
70 |
CWaitingObserver( RMobilePhone &aMobilePhone, CMsgIndicatorPluginImplementation& iIndicatorPlugin );
|
|
71 |
|
|
72 |
/**
|
|
73 |
* 2nd. phase constructor.
|
|
74 |
*/
|
|
75 |
void ConstructL( );
|
|
76 |
|
|
77 |
private:
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Update indicator status
|
|
81 |
*/
|
|
82 |
void UpdateIndicatorStatusL();
|
|
83 |
|
|
84 |
private: // Data
|
|
85 |
|
|
86 |
TBool iChangeNotifySubscribed;
|
|
87 |
|
|
88 |
// Needed to initialize iMobilePhone
|
|
89 |
RTelServer iTelServer;
|
|
90 |
|
|
91 |
// Needed to initialize iMobilePhone
|
|
92 |
RTelServer::TPhoneInfo iPhoneInfo;
|
|
93 |
|
|
94 |
RMobilePhone &iMobilePhone;
|
|
95 |
|
|
96 |
// Struct is a container for indicator flags and message counts
|
|
97 |
RMobilePhone::TMobilePhoneMessageWaitingV1 iMsgWaiting;
|
|
98 |
|
|
99 |
// Package for iMsgWaitingV1
|
|
100 |
RMobilePhone::TMobilePhoneMessageWaitingV1Pckg iMsgWaitingPckg;
|
|
101 |
|
|
102 |
CMsgIndicatorPluginImplementation &iIndicatorPlugin;
|
|
103 |
|
|
104 |
}; // CWaitingObserver
|
|
105 |
|
|
106 |
#endif //CWAITINGOBSERVER_H
|