|
1 /* |
|
2 * Copyright (c) 2004 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 the License "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: Declaration of RFavouritesSession |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FAVOURITES_SESSION_H |
|
20 #define FAVOURITES_SESSION_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * RFavouritesSession is the Favourites Engine Session. |
|
30 * It represents the connection to the Favourites Engine Server. |
|
31 */ |
|
32 class RFavouritesSession : public RSessionBase |
|
33 { |
|
34 public: // New methods |
|
35 |
|
36 /** |
|
37 * Get version. |
|
38 * @since 0.9 |
|
39 * @return Version. |
|
40 */ |
|
41 IMPORT_C static TVersion Version(); |
|
42 |
|
43 /** |
|
44 * Connect to Favourites Server. |
|
45 * @since 0.9 |
|
46 * @return Error code. |
|
47 */ |
|
48 IMPORT_C TInt Connect(); |
|
49 |
|
50 /** |
|
51 * Start checking the number of allocated object through this session. |
|
52 * @since 0.9 |
|
53 * @return void |
|
54 */ |
|
55 IMPORT_C void ResourceMark(); |
|
56 |
|
57 /** |
|
58 * Check that the number of allocated object through this session |
|
59 * matches the same of when the last call to ResourceMark was made. |
|
60 * @since 0.9 |
|
61 * @return void |
|
62 */ |
|
63 IMPORT_C void ResourceCheck(); |
|
64 |
|
65 /** |
|
66 * Get number of allocated object through this session. |
|
67 * @since 0.9 |
|
68 * @return void |
|
69 */ |
|
70 IMPORT_C TInt ResourceCount(); |
|
71 |
|
72 /** |
|
73 * Delete database. |
|
74 * @param aName Database name. |
|
75 * @since 0.9 |
|
76 * @return ErrorCode |
|
77 */ |
|
78 IMPORT_C TInt DeleteDatabase( const TDesC& aName ); |
|
79 |
|
80 /** |
|
81 * Simulate a heap allocation failure for server heap. Has empty |
|
82 * implementation for the UDEB server. |
|
83 * @since 0.9 |
|
84 * @param aType Type of heap failure simulation. |
|
85 * @param aRate Rate of failure. |
|
86 * @return void |
|
87 */ |
|
88 IMPORT_C void __DbgSetAllocFail |
|
89 ( RAllocator::TAllocFail aType, TInt aRate ); |
|
90 |
|
91 public: // But not exported |
|
92 |
|
93 /** |
|
94 * Message passing routine. |
|
95 * @since 0.9 |
|
96 * @param aFunction Function. |
|
97 * @param aArgs Arguments. |
|
98 * @param aStatus Request status. |
|
99 */ |
|
100 inline void SendReceive |
|
101 ( |
|
102 TInt aFunction, |
|
103 const TIpcArgs& aArgs, |
|
104 TRequestStatus& aStatus |
|
105 ) const; |
|
106 |
|
107 /** |
|
108 * Message passing routine. |
|
109 * @since 0.9 |
|
110 * @param aFunction Function. |
|
111 * @param aArgs Arguments. |
|
112 * @return Error code. |
|
113 */ |
|
114 inline TInt SendReceive( TInt aFunction, const TIpcArgs& aArgs ) const; |
|
115 |
|
116 /** |
|
117 * Message passing routine. |
|
118 * @since 0.9 |
|
119 * @param aFunction Function. |
|
120 * @return Error code. |
|
121 */ |
|
122 inline TInt SendReceive( TInt aFunction ) const; |
|
123 |
|
124 private: // New methods |
|
125 |
|
126 /** |
|
127 * Connect to Favourites Server. |
|
128 * @since 0.9 |
|
129 * @return Error code. |
|
130 */ |
|
131 TInt DoConnect(); |
|
132 |
|
133 }; |
|
134 |
|
135 #endif |
|
136 |
|
137 #include <FavouritesSession.inl> |
|
138 |
|
139 // End of File |