|
1 /* |
|
2 * Copyright (c) 2002 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: It is the client side remote class of phone server session. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef RPHCLTSERVER_H |
|
20 #define RPHCLTSERVER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <PhCltTypes.h> |
|
26 |
|
27 // CONSTANTS |
|
28 // A version must be specified when creating a session with the server |
|
29 // These are the version numbers for PhoneServer. |
|
30 const TUint KPhoneServerMajorVersionNumber = 0; |
|
31 const TUint KPhoneServerMinorVersionNumber = 1; |
|
32 const TUint KPhoneServerBuildVersionNumber = 1; |
|
33 |
|
34 // Default amount of message slots. |
|
35 const TInt KPhCltDefaultMessageSlots = 4; |
|
36 |
|
37 // DATA TYPES |
|
38 |
|
39 // PhoneClient panic codes visible to the user. |
|
40 enum TPhCltClientSidePanics |
|
41 { |
|
42 EPhCltClientSidePanicNullHandle = 0, // Handle was NULL |
|
43 // |
|
44 EPhCltClientSidePanicLast // Keep as last enum value. |
|
45 }; |
|
46 |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 /** |
|
51 * It is the client side remote class of phone server session. |
|
52 * |
|
53 * @lib phoneclient.lib |
|
54 * @since 1.0 |
|
55 */ |
|
56 class RPhCltServer : public RSessionBase |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * C++ constructor. |
|
62 */ |
|
63 IMPORT_C RPhCltServer(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Returns the version of the API. |
|
69 * |
|
70 * @return Returns the version encapsulated in TVersion object. |
|
71 */ |
|
72 TVersion Version() const; |
|
73 |
|
74 /** |
|
75 * Creates connection to the server. |
|
76 * |
|
77 * @param aMessageSlots It tells the amount of message slots to be used |
|
78 * for the connection. |
|
79 * @return Returns error code. |
|
80 */ |
|
81 IMPORT_C TInt Connect( TInt aMessageSlots = KPhCltDefaultMessageSlots ); |
|
82 |
|
83 /** |
|
84 * Creates all submodules in Phone Server side. |
|
85 * |
|
86 * @param aStatus It is used to notify the completion of the request. |
|
87 * Then it indicates the success/failure of the operation. |
|
88 * @return error code. |
|
89 */ |
|
90 IMPORT_C void CreateAll( TRequestStatus& aStatus ); |
|
91 |
|
92 |
|
93 private: // Panic |
|
94 |
|
95 // Panic types to be used in this class. |
|
96 enum TPhCltPanicTypes |
|
97 { |
|
98 // Connection failed. |
|
99 EPhCltPanicServerConnectionFailed = 0, |
|
100 // Server was not found in starting phase. |
|
101 EPhCltPanicServerUnexpectedServerNotFound, |
|
102 // Server startup error. |
|
103 EPhCltPanicServerStartupObservationResultedInError, |
|
104 // |
|
105 EPhCltPanicLast // Keep as last value. |
|
106 }; |
|
107 |
|
108 // Panic function. |
|
109 static void Panic( TPhCltPanicTypes aPanic ); |
|
110 |
|
111 |
|
112 private: // Internal methods |
|
113 |
|
114 // Starts the Phone Server. |
|
115 TInt StartServer(); |
|
116 |
|
117 private: |
|
118 |
|
119 // By default, prohibit copy constructor |
|
120 RPhCltServer( const RPhCltServer& ); |
|
121 // Prohibit assigment operator |
|
122 RPhCltServer& operator= ( const RPhCltServer& ); |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // RPHCLTSERVER_H |
|
127 |
|
128 // End of File |