37
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2007 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: This module contains the implementation of
|
|
15 |
* CPEClientEmergencyCallMonitor class
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include "cpeclientemergencycallmonitor.h"
|
|
22 |
#include "cpemessagehandler.h"
|
|
23 |
#include "mpephonemodelinternal.h"
|
|
24 |
#include "pevirtualengine.h"
|
|
25 |
#include <cphcltcallnotify.h>
|
|
26 |
#include <mpedatastore.h>
|
|
27 |
#include <talogger.h>
|
|
28 |
|
|
29 |
|
|
30 |
// ================= MEMBER FUNCTIONS =======================
|
|
31 |
|
|
32 |
// -----------------------------------------------------------------------------
|
|
33 |
// CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor
|
|
34 |
// C++ default constructor can NOT contain any code, that
|
|
35 |
// might leave.
|
|
36 |
// -----------------------------------------------------------------------------
|
|
37 |
//
|
|
38 |
CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor(
|
|
39 |
MPEPhoneModelInternal& aModel,
|
|
40 |
CPhCltCallNotify& aCallNotifier )
|
|
41 |
: iModel( aModel ),
|
|
42 |
iCallNotifier( aCallNotifier ),
|
|
43 |
iClientOriginatedCall( EFalse )
|
|
44 |
{
|
|
45 |
TEFLOGSTRING( KTAOBJECT,
|
|
46 |
"PE CPEClientEmergencyCallMonitor::CPEClientEmergencyCallMonitor complete");
|
|
47 |
}
|
|
48 |
|
|
49 |
// -----------------------------------------------------------------------------
|
|
50 |
// CPEClientEmergencyCallMonitor::ConstructL
|
|
51 |
// Two-phased constructor.
|
|
52 |
// -----------------------------------------------------------------------------
|
|
53 |
//
|
|
54 |
void CPEClientEmergencyCallMonitor::ConstructL()
|
|
55 |
{
|
|
56 |
}
|
|
57 |
|
|
58 |
// -----------------------------------------------------------------------------
|
|
59 |
// CPEClientEmergencyCallMonitor::NewL
|
|
60 |
// Two-phased constructor.
|
|
61 |
// -----------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
CPEClientEmergencyCallMonitor* CPEClientEmergencyCallMonitor::NewL(
|
|
64 |
MPEPhoneModelInternal& aModel,
|
|
65 |
CPhCltCallNotify& aCallNotifier )
|
|
66 |
{
|
|
67 |
CPEClientEmergencyCallMonitor* self = new( ELeave )
|
|
68 |
CPEClientEmergencyCallMonitor( aModel, aCallNotifier );
|
|
69 |
CleanupStack::PushL( self );
|
|
70 |
self->ConstructL();
|
|
71 |
CleanupStack::Pop( self );
|
|
72 |
return self;
|
|
73 |
}
|
|
74 |
|
|
75 |
// Destructor
|
|
76 |
CPEClientEmergencyCallMonitor::~CPEClientEmergencyCallMonitor()
|
|
77 |
{
|
|
78 |
Cancel();
|
|
79 |
}
|
|
80 |
|
|
81 |
// -----------------------------------------------------------------------------
|
|
82 |
// CPhCltDialData* CPEClientEmergencyCallMonitor::ClientDialData
|
|
83 |
// -----------------------------------------------------------------------------
|
|
84 |
//
|
|
85 |
CPhCltDialData* CPEClientEmergencyCallMonitor::ClientDialData()
|
|
86 |
{
|
|
87 |
return NULL;
|
|
88 |
}
|
|
89 |
|
|
90 |
// -----------------------------------------------------------------------------
|
|
91 |
// CPEClientEmergencyCallMonitor::SendRespond
|
|
92 |
// Sends respond to the phone client.
|
|
93 |
// -----------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
void CPEClientEmergencyCallMonitor::SendRespond(
|
|
96 |
const TInt aRespond )
|
|
97 |
{
|
|
98 |
if ( iClientOriginatedCall )
|
|
99 |
{
|
|
100 |
TEFLOGSTRING2( KTAMESOUT,
|
|
101 |
"PE CPEClientEmergencyCallMonitor::SendRespond, CPhCltCallNotify::RespondClient( %d )"
|
|
102 |
,aRespond );
|
|
103 |
iCallNotifier.RespondEmergencyToClient( aRespond );
|
|
104 |
iClientOriginatedCall = EFalse;
|
|
105 |
// StartMonitoring();
|
|
106 |
}
|
|
107 |
}
|
|
108 |
|
|
109 |
// -----------------------------------------------------------------------------
|
|
110 |
// CPEClientEmergencyCallMonitor::StartMonitoring
|
|
111 |
// Starts monitoring phone client for client dials.
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
void CPEClientEmergencyCallMonitor::StartMonitoring()
|
|
115 |
{
|
|
116 |
TEFLOGSTRING( KTAMESOUT,
|
|
117 |
"PE CPEClientEmergencyCallMonitor::StartMonitoring, CPhCltCallNotify::NotifyEmergencyCall( )" );
|
|
118 |
iCallNotifier.NotifyEmergencyCall( this, iEmergencyNumber );
|
|
119 |
iMonitoring = ETrue;
|
|
120 |
}
|
|
121 |
|
|
122 |
// -----------------------------------------------------------------------------
|
|
123 |
// CPEClientEmergencyCallMonitor::Cancel
|
|
124 |
// Cancel active object request
|
|
125 |
// -----------------------------------------------------------------------------
|
|
126 |
//
|
|
127 |
void CPEClientEmergencyCallMonitor::Cancel()
|
|
128 |
{
|
|
129 |
TEFLOGSTRING( KTAREQEND, "PE CPEClientEmergencyCallMonitor::Cancel" );
|
|
130 |
iCallNotifier.CancelNotifyEmergencyCall();
|
|
131 |
iMonitoring = EFalse;
|
|
132 |
}
|
|
133 |
|
|
134 |
// -----------------------------------------------------------------------------
|
|
135 |
// CPEClientEmergencyCallMonitor::DialEmergencyRequest
|
|
136 |
// -----------------------------------------------------------------------------
|
|
137 |
//
|
|
138 |
void CPEClientEmergencyCallMonitor::DialEmergencyRequest()
|
|
139 |
{
|
|
140 |
iMonitoring = EFalse;
|
|
141 |
TEFLOGSTRING( KTAREQEND,
|
|
142 |
"PE CPEClientEmergencyCallMonitor::DialEmergencyRequest" );
|
|
143 |
iClientOriginatedCall = ETrue;
|
|
144 |
iModel.DataStore()->SetPhoneNumber(
|
|
145 |
static_cast<TPEPhoneNumber>( iEmergencyNumber ) );
|
|
146 |
iModel.HandleInternalMessage( MPEPhoneModel::EPEMessageClientDialEmergency );
|
|
147 |
StartMonitoring();
|
|
148 |
}
|
|
149 |
|
|
150 |
// -----------------------------------------------------------------------------
|
|
151 |
// CPEClientEmergencyCallMonitor::IsActive
|
|
152 |
// -----------------------------------------------------------------------------
|
|
153 |
//
|
|
154 |
TBool CPEClientEmergencyCallMonitor::IsActive()
|
|
155 |
{
|
|
156 |
return iMonitoring;
|
|
157 |
}
|
|
158 |
|
|
159 |
// End of File
|