|
1 /* |
|
2 * Copyright (c) 2002-2005 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 * Global functions for the landmarks server |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef LMSERVERGLOBAL_H |
|
21 #define LMSERVERGLOBAL_H |
|
22 |
|
23 #include <e32std.h> |
|
24 |
|
25 /** |
|
26 * LmServerGlobal functions for the server |
|
27 * |
|
28 */ |
|
29 class LmServerGlobal |
|
30 { |
|
31 public: // New functions |
|
32 |
|
33 /** |
|
34 * Read and kill the client if not successful. If the returned error |
|
35 * code is negative, the RMessage2 must not be completed. Complete after |
|
36 * client is panicked crashes the server with KERN-EXEC 44. |
|
37 * |
|
38 * @param[in] aMessagePtr Message pointer |
|
39 * @param[in] aParam Index to read from |
|
40 * @param[out] aDes Descriptor to read to |
|
41 * @param[in] aOffset Offset to start read |
|
42 * @return Error code |
|
43 */ |
|
44 static TInt Read( |
|
45 const RMessagePtr2& aMessagePtr, |
|
46 TInt aParam, |
|
47 TDes8& aDes, |
|
48 TInt aOffset = 0 ); |
|
49 |
|
50 /** |
|
51 * Read and kill the client if not successful. If the returned error |
|
52 * code is negative, the RMessage2 must not be completed. Complete after |
|
53 * client is panicked crashes the server with KERN-EXEC 44. |
|
54 * |
|
55 * @param[in] aMessagePtr Message pointer |
|
56 * @param[in] aParam Index to read from |
|
57 * @param[out] aDes Descriptor to read to |
|
58 * @param[in] aOffset Offset to start read |
|
59 * @return Error code |
|
60 */ |
|
61 static TInt Read( |
|
62 const RMessagePtr2& aMessagePtr, |
|
63 TInt aParam, |
|
64 TDes16& aDes, |
|
65 TInt aOffset = 0 ); |
|
66 |
|
67 /** |
|
68 * Write and kill the client if not successful. If the returned error |
|
69 * code is negative, the RMessage2 must not be completed. Complete after |
|
70 * client is panicked crashes the server with KERN-EXEC 44. |
|
71 * |
|
72 * @param[in] aMessagePtr Message pointer |
|
73 * @param[in] aParam Index to write to |
|
74 * @param[in] aDes Descriptor to write from |
|
75 * @param[in] aOffset Offset to start write |
|
76 * @return Error code |
|
77 */ |
|
78 static TInt Write( |
|
79 const RMessagePtr2& aMessagePtr, |
|
80 TInt aParam, |
|
81 const TDesC8& aDes, |
|
82 TInt aOffset = 0 ); |
|
83 |
|
84 /** |
|
85 * Write and kill the client if not successful. If the returned error |
|
86 * code is negative, the RMessage2 must not be completed. Complete after |
|
87 * client is panicked crashes the server with KERN-EXEC 44. |
|
88 * |
|
89 * @param[in] aMessagePtr Message pointer |
|
90 * @param[in] aPtr Pointer to write to |
|
91 * @param[in] aDes Descriptor to write from |
|
92 * @param[in] aOffset offset to start write |
|
93 * @return Error code |
|
94 */ |
|
95 static TInt Write( |
|
96 const RMessagePtr2& aMessagePtr, |
|
97 TInt aParam, |
|
98 const TDesC16& aDes, |
|
99 TInt aOffset = 0 ); |
|
100 |
|
101 /** |
|
102 * Completes a client message with a reason. |
|
103 * |
|
104 * @param[in] aMessagePtr Message pointer |
|
105 * @param[in] aReason A reason |
|
106 */ |
|
107 static void Complete( |
|
108 const RMessagePtr2& aMessagePtr, |
|
109 TInt aReason ); |
|
110 |
|
111 /** Reads data from message |
|
112 * @param[in] aMessage IPC message |
|
113 * @param[in] aClientBufferParam parameter to read |
|
114 * @return pointer to read buffer, caller takes ownership */ |
|
115 static HBufC8* CopyClientBuffer8LC( |
|
116 const RMessage2& aMessage, |
|
117 const TInt aClientBufferParam ); |
|
118 |
|
119 /** Reads data from message |
|
120 * @param[in] aMessage IPC message |
|
121 * @param[in] aClientBufferParam parameter to read |
|
122 * @return pointer to read buffer, caller takes ownership */ |
|
123 static HBufC* CopyClientBufferLC( |
|
124 const RMessage2& aMessage, |
|
125 const TInt aClientBufferParam); |
|
126 |
|
127 private: |
|
128 |
|
129 // By default, prohibit copy constructor |
|
130 LmServerGlobal( const LmServerGlobal& ); |
|
131 // Prohibit assigment operator |
|
132 LmServerGlobal& operator= ( const LmServerGlobal& ); |
|
133 }; |
|
134 |
|
135 #endif // LMSERVERGLOBAL_H |
|
136 |
|
137 // End of File |