|
33
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2002-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: This file contains the client command processor class
|
|
|
15 |
* that is responsible for the active objects needed to
|
|
|
16 |
* maintain that connection.
|
|
|
17 |
*
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
// INCLUDE FILES
|
|
|
23 |
#include <e32svr.h>
|
|
|
24 |
#include "CSatCCommandProcessor.h"
|
|
|
25 |
#include "SatLog.h"
|
|
|
26 |
|
|
|
27 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
|
28 |
|
|
|
29 |
// -----------------------------------------------------------------------------
|
|
|
30 |
// CSatCCommandProcessor::CSatCCommandProcessor
|
|
|
31 |
// C++ default constructor cannot contain any code that
|
|
|
32 |
// might leave.
|
|
|
33 |
// -----------------------------------------------------------------------------
|
|
|
34 |
//
|
|
|
35 |
CSatCCommandProcessor::CSatCCommandProcessor(
|
|
|
36 |
RSatUiSession* aSession ) :
|
|
|
37 |
iSession( aSession )
|
|
|
38 |
{
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
// -----------------------------------------------------------------------------
|
|
|
42 |
// CSatCCommandProcessor::ConstructL
|
|
|
43 |
// Symbian 2nd phase constructor can leave.
|
|
|
44 |
// -----------------------------------------------------------------------------
|
|
|
45 |
//
|
|
|
46 |
void CSatCCommandProcessor::ConstructL()
|
|
|
47 |
{
|
|
|
48 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::ConstructL calling" )
|
|
|
49 |
|
|
|
50 |
// All the command handlers are constructed here.
|
|
|
51 |
iDisplayTextHandler = CSatCDisplayTextHandler::NewL( iSession );
|
|
|
52 |
iGetInkeyHandler = CSatCGetInkeyHandler::NewL( iSession );
|
|
|
53 |
iGetInputHandler = CSatCGetInputHandler::NewL( iSession );
|
|
|
54 |
iSetUpMenuHandler = CSatCSetUpMenuHandler::NewL( iSession );
|
|
|
55 |
iSelectItemHandler = CSatCSelectItemHandler::NewL( iSession );
|
|
|
56 |
iPlayToneHandler = CSatCPlayToneHandler::NewL( iSession );
|
|
|
57 |
iActiveCommandHandler = CSatCActiveCommandHandler::NewL( iSession );
|
|
|
58 |
iEventHandler = CSatCEventHandler::NewL( iSession );
|
|
|
59 |
iQueryHandler = CSatCQueryHandler::NewL( iSession );
|
|
|
60 |
iNotifyHandler = CSatCNotifyHandler::NewL( iSession );
|
|
|
61 |
|
|
|
62 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::ConstructL exiting" )
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
// -----------------------------------------------------------------------------
|
|
|
66 |
// CSatCCommandProcessor::NewL
|
|
|
67 |
// Two-phased constructor.
|
|
|
68 |
// -----------------------------------------------------------------------------
|
|
|
69 |
//
|
|
|
70 |
CSatCCommandProcessor* CSatCCommandProcessor::NewL(
|
|
|
71 |
RSatUiSession* aSession )
|
|
|
72 |
{
|
|
|
73 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::NewL calling" )
|
|
|
74 |
|
|
|
75 |
// Perform two-phase construction.
|
|
|
76 |
CSatCCommandProcessor* self =
|
|
|
77 |
new ( ELeave ) CSatCCommandProcessor( aSession );
|
|
|
78 |
|
|
|
79 |
CleanupStack::PushL( self );
|
|
|
80 |
self->ConstructL();
|
|
|
81 |
CleanupStack::Pop( self );
|
|
|
82 |
|
|
|
83 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::NewL exiting" )
|
|
|
84 |
return self;
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
// Destructor
|
|
|
88 |
CSatCCommandProcessor::~CSatCCommandProcessor()
|
|
|
89 |
{
|
|
|
90 |
LOG( SIMPLE,
|
|
|
91 |
"SATINTERNALCLIENT: CSatCCommandProcessor::~CSatCCommandProcessor calling" )
|
|
|
92 |
|
|
|
93 |
// All the event handlers are deleted here.
|
|
|
94 |
delete iDisplayTextHandler;
|
|
|
95 |
delete iGetInkeyHandler;
|
|
|
96 |
delete iGetInputHandler;
|
|
|
97 |
delete iSetUpMenuHandler;
|
|
|
98 |
delete iSelectItemHandler;
|
|
|
99 |
delete iPlayToneHandler;
|
|
|
100 |
delete iActiveCommandHandler;
|
|
|
101 |
delete iEventHandler;
|
|
|
102 |
delete iQueryHandler;
|
|
|
103 |
delete iNotifyHandler;
|
|
|
104 |
|
|
|
105 |
iSession = NULL;
|
|
|
106 |
|
|
|
107 |
LOG( SIMPLE,
|
|
|
108 |
"SATINTERNALCLIENT: CSatCCommandProcessor::~CSatCCommandProcessor exiting" )
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
// -----------------------------------------------------------------------------
|
|
|
112 |
// CSatCCommandProcessor::Start
|
|
|
113 |
// Starts the active objects
|
|
|
114 |
// (other items were commented in a header).
|
|
|
115 |
// -----------------------------------------------------------------------------
|
|
|
116 |
//
|
|
|
117 |
void CSatCCommandProcessor::Start()
|
|
|
118 |
{
|
|
|
119 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::Start calling" )
|
|
|
120 |
|
|
|
121 |
// Start all the event handlers
|
|
|
122 |
iDisplayTextHandler->Start();
|
|
|
123 |
iGetInkeyHandler->Start();
|
|
|
124 |
iGetInputHandler->Start();
|
|
|
125 |
iSetUpMenuHandler->Start();
|
|
|
126 |
iSelectItemHandler->Start();
|
|
|
127 |
iPlayToneHandler->Start();
|
|
|
128 |
iQueryHandler->Start();
|
|
|
129 |
iNotifyHandler->Start();
|
|
|
130 |
iEventHandler->Start();
|
|
|
131 |
|
|
|
132 |
LOG( SIMPLE, "SATINTERNALCLIENT: CSatCCommandProcessor::Start exiting" )
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
// -----------------------------------------------------------------------------
|
|
|
136 |
// CSatCCommandProcessor::SetUpMenuHandler
|
|
|
137 |
// Returns a pointer to a Set Up menu command handler object.
|
|
|
138 |
// (other items were commented in a header).
|
|
|
139 |
// -----------------------------------------------------------------------------
|
|
|
140 |
//
|
|
|
141 |
CSatCSetUpMenuHandler* CSatCCommandProcessor::SetUpMenuHandler()
|
|
|
142 |
{
|
|
|
143 |
LOG( SIMPLE,
|
|
|
144 |
"SATINTERNALCLIENT: CSatCCommandProcessor::SetUpMenuHandler calling-exiting" )
|
|
|
145 |
return iSetUpMenuHandler;
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
// -----------------------------------------------------------------------------
|
|
|
149 |
// CSatCCommandProcessor::ActiveCommandHandler
|
|
|
150 |
// Returns a pointer to a active command handler object.
|
|
|
151 |
// (other items were commented in a header).
|
|
|
152 |
// -----------------------------------------------------------------------------
|
|
|
153 |
//
|
|
|
154 |
CSatCActiveCommandHandler* CSatCCommandProcessor::ActiveCommandHandler()
|
|
|
155 |
{
|
|
|
156 |
LOG( SIMPLE,
|
|
|
157 |
"SATINTERNALCLIENT: CSatCCommandProcessor::ActiveCommandHandler calling-exiting" )
|
|
|
158 |
return iActiveCommandHandler;
|
|
|
159 |
}
|
|
|
160 |
|
|
|
161 |
// End of File
|