44
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
* Name : sipphoneregistrationmonitor.h
|
|
16 |
* Part of : SIP Profile Agent / SIP IMS Agent
|
|
17 |
* Version : %version: 2 %
|
|
18 |
*
|
|
19 |
*/
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
/**
|
|
25 |
@internalComponent
|
|
26 |
*/
|
|
27 |
|
|
28 |
#ifndef CSIPPHONEREGISTRATIONMONITOR_H
|
|
29 |
#define CSIPPHONEREGISTRATIONMONITOR_H
|
|
30 |
|
|
31 |
// INCLUDES
|
|
32 |
#include <etelmm.h>
|
|
33 |
|
|
34 |
// FORWARD DECLARATIONS
|
|
35 |
class MSipPhoneRegistrationObserver;
|
|
36 |
|
|
37 |
// CLASS DEFINITION
|
|
38 |
/**
|
|
39 |
* Monitors the status of the phone's network registration.
|
|
40 |
* Notifies when the status changes.
|
|
41 |
*/
|
|
42 |
class CSipPhoneRegistrationMonitor : public CActive
|
|
43 |
{
|
|
44 |
public:
|
|
45 |
|
|
46 |
/** Phone registration status */
|
|
47 |
enum TStatus
|
|
48 |
{
|
|
49 |
ENotRegistered,
|
|
50 |
ERegisteredOnHomeNetwork,
|
|
51 |
ERegisteredRoaming
|
|
52 |
};
|
|
53 |
|
|
54 |
static CSipPhoneRegistrationMonitor* NewL(
|
|
55 |
RTelServer& aTelServer,
|
|
56 |
const RTelServer::TPhoneInfo& aPhoneInfo,
|
|
57 |
MSipPhoneRegistrationObserver& aObserver );
|
|
58 |
|
|
59 |
~CSipPhoneRegistrationMonitor();
|
|
60 |
|
|
61 |
public: // New methods
|
|
62 |
|
|
63 |
TStatus Status() const;
|
|
64 |
|
|
65 |
protected: // From CActive
|
|
66 |
|
|
67 |
void DoCancel();
|
|
68 |
void RunL();
|
|
69 |
TInt RunError(TInt aError);
|
|
70 |
|
|
71 |
private: // Constructors
|
|
72 |
|
|
73 |
/// Constructor
|
|
74 |
CSipPhoneRegistrationMonitor(
|
|
75 |
MSipPhoneRegistrationObserver& aObserver );
|
|
76 |
|
|
77 |
/// Default constructor, not implemented.
|
|
78 |
CSipPhoneRegistrationMonitor();
|
|
79 |
|
|
80 |
/// 2nd phase constructor
|
|
81 |
void ConstructL(
|
|
82 |
RTelServer& aTelServer,
|
|
83 |
const RTelServer::TPhoneInfo& aPhoneInfo );
|
|
84 |
|
|
85 |
void MonitorStatus();
|
|
86 |
|
|
87 |
private: // Data
|
|
88 |
|
|
89 |
MSipPhoneRegistrationObserver& iObserver;
|
|
90 |
RMobilePhone iPhone;
|
|
91 |
RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus;
|
|
92 |
|
|
93 |
|
|
94 |
#ifdef CPPUNIT_TEST
|
|
95 |
friend class CSIPIMSProfileAgentTest;
|
|
96 |
#endif
|
|
97 |
};
|
|
98 |
|
|
99 |
#endif // CSIPPHONEREGISTRATIONMONITOR_H
|