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: The UI Client API of the SAT Server.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef RSATUISESSION_H
|
|
21 |
#define RSATUISESSION_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32base.h>
|
|
25 |
|
|
26 |
// CONSTANTS
|
|
27 |
|
|
28 |
// The name of the SatClient module for panic purposes
|
|
29 |
_LIT( KSatCliName, "SatClient" );
|
|
30 |
|
|
31 |
// DATA TYPES
|
|
32 |
|
|
33 |
// The Sat Client Panic codes
|
|
34 |
enum TSatClientPanic
|
|
35 |
{
|
|
36 |
ESatInvalidResponse,
|
|
37 |
ESatSetUpMenuFailure,
|
|
38 |
ESelectedItemOutOfRange
|
|
39 |
};
|
|
40 |
|
|
41 |
// FORWARD DECLARATIONS
|
|
42 |
|
|
43 |
class MSatUiObserver;
|
|
44 |
class MSatUiAdapter;
|
|
45 |
class CSatCCommandProcessor;
|
|
46 |
class CSatCDisplayTextHandler;
|
|
47 |
class RSatSession;
|
|
48 |
|
|
49 |
// CLASS DECLARATION
|
|
50 |
|
|
51 |
/**
|
|
52 |
* UI sub-session to SatServer.
|
|
53 |
* Use this to register your event observer object.
|
|
54 |
*
|
|
55 |
* @lib SatClient.lib
|
|
56 |
* @since Series 60 2.0
|
|
57 |
*/
|
|
58 |
|
|
59 |
class RSatUiSession : public RSubSessionBase
|
|
60 |
{
|
|
61 |
public: // Constructors and destructor
|
|
62 |
|
|
63 |
/**
|
|
64 |
* C++ default constructor.
|
|
65 |
*/
|
|
66 |
IMPORT_C RSatUiSession();
|
|
67 |
|
|
68 |
public: // New functions
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Registers the listener object for SAT events and connects to
|
|
72 |
* the Sat Server.
|
|
73 |
* @param aSat
|
|
74 |
* @param aObserver The observer.
|
|
75 |
*/
|
|
76 |
IMPORT_C void RegisterL(
|
|
77 |
const RSatSession& aSatSession,
|
|
78 |
MSatUiObserver* aObserver );
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Returns a pointer to the object that implements the UI
|
|
82 |
* adapter interface.
|
|
83 |
* @return The adapter object pointer.
|
|
84 |
*/
|
|
85 |
IMPORT_C MSatUiAdapter* Adapter() const;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Unregisters the listener object and disconnects from the server.
|
|
89 |
*/
|
|
90 |
void Unregister();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* The client API version
|
|
94 |
* @return The version of the current API.
|
|
95 |
*/
|
|
96 |
IMPORT_C TVersion Version() const;
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Panics the client application
|
|
100 |
* @param aReason The reason code.
|
|
101 |
*/
|
|
102 |
IMPORT_C void Panic( TSatClientPanic aReason ) const;
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Shuts down the server. Active in development use only.
|
|
106 |
*/
|
|
107 |
IMPORT_C void KillServer() const;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Create and send service request message to SAT server.
|
|
111 |
* @param aFunction Service request id.
|
|
112 |
* @param aArgs Service request arguments.
|
|
113 |
* @param aStatus Service request status.
|
|
114 |
*/
|
|
115 |
IMPORT_C void CreateRequest(
|
|
116 |
TInt aFunction,
|
|
117 |
const TIpcArgs& aArgs,
|
|
118 |
TRequestStatus& aStatus ) const;
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Create and send service request message to SAT server.
|
|
122 |
* @param aFunction Service request id.
|
|
123 |
* @param aArgs Service request arguments.
|
|
124 |
*/
|
|
125 |
IMPORT_C void CreateRequest(
|
|
126 |
TInt aFunction,
|
|
127 |
const TIpcArgs& aArgs ) const;
|
|
128 |
|
|
129 |
/**
|
|
130 |
* Returns a pointer to the object that implements client observer
|
|
131 |
* object that receives SAT commands
|
|
132 |
* @return The client observer object pointer.
|
|
133 |
*/
|
|
134 |
IMPORT_C MSatUiObserver* SatUiObserver();
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Returns a pointer to the object that implements Processor agent for
|
|
138 |
* SAT commands.
|
|
139 |
* @return The command processor object pointer.
|
|
140 |
*/
|
|
141 |
CSatCCommandProcessor* CommandProcessor();
|
|
142 |
|
|
143 |
public: // Functions from base classes
|
|
144 |
|
|
145 |
/**
|
|
146 |
* From RHandleBase
|
|
147 |
*
|
|
148 |
* Close the handle.
|
|
149 |
*/
|
|
150 |
IMPORT_C void Close();
|
|
151 |
|
|
152 |
private:
|
|
153 |
|
|
154 |
// Prohibited copy constructor.
|
|
155 |
RSatUiSession( const RSatUiSession& );
|
|
156 |
|
|
157 |
// Prohibited assigment operator.
|
|
158 |
RSatUiSession& operator= ( const RSatUiSession& );
|
|
159 |
|
|
160 |
/**
|
|
161 |
* Checks if the server is started.
|
|
162 |
* @return Interger value, is server started or not.
|
|
163 |
*/
|
|
164 |
TBool IsServerStarted() const;
|
|
165 |
|
|
166 |
private: // Data
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Processor agent for SAT commands
|
|
170 |
*/
|
|
171 |
CSatCCommandProcessor* iCommandProcessor;
|
|
172 |
|
|
173 |
/**
|
|
174 |
* The client observer object that receives SAT commands.
|
|
175 |
*/
|
|
176 |
MSatUiObserver* iSatUiObserver;
|
|
177 |
|
|
178 |
};
|
|
179 |
|
|
180 |
#endif // RSATUISESSION_H
|
|
181 |
|
|
182 |
// End of File
|