|
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: |
|
15 * Inline method definitions of class TFavouritesSessionEntry and |
|
16 * CFavouritesSessionEntryList. |
|
17 * |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef FAVOURITES_SRV_SESSION_ENTRY_INL |
|
23 #define FAVOURITES_SRV_SESSION_ENTRY_INL |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // TFavouritesSessionEntry::SetNull() |
|
29 // --------------------------------------------------------- |
|
30 // |
|
31 void TFavouritesSessionEntry::SetNull() |
|
32 { |
|
33 iType = ENone; |
|
34 iObject = NULL; // Clarity code. |
|
35 iChkNum = 0; // Clarity code. |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------- |
|
39 // TFavouritesSessionEntry::IsNull() |
|
40 // --------------------------------------------------------- |
|
41 // |
|
42 TBool TFavouritesSessionEntry::IsNull() |
|
43 { |
|
44 return iType == ENone; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------- |
|
48 // TFavouritesSessionEntry::operator=() |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 void TFavouritesSessionEntry::operator=( CFavouritesSrvDb& aDb ) |
|
52 { |
|
53 __ASSERT_DEBUG( IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
54 iType = EDatabase; |
|
55 iObject = STATIC_CAST( TAny*, &aDb ); |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // TFavouritesSessionEntry::operator=() |
|
60 // --------------------------------------------------------- |
|
61 // |
|
62 void TFavouritesSessionEntry::operator=( CFavouritesSrvDbNotifier& aNotifier ) |
|
63 { |
|
64 __ASSERT_DEBUG( IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
65 iType = ENotifier; |
|
66 iObject = STATIC_CAST( TAny*, &aNotifier ); |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------- |
|
70 // TFavouritesSessionEntry::operator=() |
|
71 // --------------------------------------------------------- |
|
72 // |
|
73 void TFavouritesSessionEntry::operator= |
|
74 ( CFavouritesSrvDbIncremental& aIncremental ) |
|
75 { |
|
76 __ASSERT_DEBUG( IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
77 iType = EIncremental; |
|
78 iObject = STATIC_CAST( TAny*, &aIncremental ); |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------- |
|
82 // TFavouritesSessionEntry::operator=() |
|
83 // --------------------------------------------------------- |
|
84 // |
|
85 void TFavouritesSessionEntry::operator=( HFavouritesSrvStream& aStream ) |
|
86 { |
|
87 __ASSERT_DEBUG( IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
88 iType = EStream; |
|
89 iObject = STATIC_CAST( TAny*, &aStream ); |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------- |
|
93 // TFavouritesSessionEntry::operator=() |
|
94 // --------------------------------------------------------- |
|
95 // |
|
96 void TFavouritesSessionEntry::operator= |
|
97 ( CFavouritesSrvFile& aFile ) |
|
98 { |
|
99 __ASSERT_DEBUG( IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
100 iType = EFile; |
|
101 iObject = STATIC_CAST( TAny*, &aFile ); |
|
102 } |
|
103 |
|
104 // --------------------------------------------------------- |
|
105 // TFavouritesSessionEntry::ChkNum() |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 TInt& TFavouritesSessionEntry::ChkNum() |
|
109 { |
|
110 return iChkNum; |
|
111 } |
|
112 |
|
113 // --------------------------------------------------------- |
|
114 // TFavouritesSessionEntry::Type() |
|
115 // --------------------------------------------------------- |
|
116 // |
|
117 TFavouritesSessionEntry::TType TFavouritesSessionEntry::Type() const |
|
118 { |
|
119 return iType; |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------- |
|
123 // TFavouritesSessionEntry::Database() |
|
124 // --------------------------------------------------------- |
|
125 // |
|
126 CFavouritesSrvDb& TFavouritesSessionEntry::Database() |
|
127 { |
|
128 __ASSERT_DEBUG( !IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
129 __ASSERT_DEBUG( iType == EDatabase, \ |
|
130 FavouritesPanic( EFavouritesInternal ) ); |
|
131 return *(STATIC_CAST( CFavouritesSrvDb*, iObject )); |
|
132 } |
|
133 |
|
134 // --------------------------------------------------------- |
|
135 // TFavouritesSessionEntry::Notifier() |
|
136 // --------------------------------------------------------- |
|
137 // |
|
138 CFavouritesSrvDbNotifier& TFavouritesSessionEntry::Notifier() |
|
139 { |
|
140 __ASSERT_DEBUG( !IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
141 __ASSERT_DEBUG( iType == ENotifier, \ |
|
142 FavouritesPanic( EFavouritesInternal ) ); |
|
143 return *(STATIC_CAST( CFavouritesSrvDbNotifier*, iObject )); |
|
144 } |
|
145 |
|
146 // --------------------------------------------------------- |
|
147 // TFavouritesSessionEntry::Incremental() |
|
148 // --------------------------------------------------------- |
|
149 // |
|
150 CFavouritesSrvDbIncremental& TFavouritesSessionEntry::Incremental() |
|
151 { |
|
152 __ASSERT_DEBUG( !IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
153 __ASSERT_DEBUG( iType == EIncremental, \ |
|
154 FavouritesPanic( EFavouritesInternal ) ); |
|
155 return *(STATIC_CAST( CFavouritesSrvDbIncremental*, iObject )); |
|
156 } |
|
157 |
|
158 // --------------------------------------------------------- |
|
159 // TFavouritesSessionEntry::Stream() |
|
160 // --------------------------------------------------------- |
|
161 // |
|
162 HFavouritesSrvStream& TFavouritesSessionEntry::Stream() |
|
163 { |
|
164 __ASSERT_DEBUG( !IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
165 __ASSERT_DEBUG( iType == EStream, \ |
|
166 FavouritesPanic( EFavouritesInternal ) ); |
|
167 return *(STATIC_CAST( HFavouritesSrvStream*, iObject )); |
|
168 } |
|
169 |
|
170 // --------------------------------------------------------- |
|
171 // TFavouritesSessionEntry::File() |
|
172 // --------------------------------------------------------- |
|
173 // |
|
174 CFavouritesSrvFile& TFavouritesSessionEntry::File() |
|
175 { |
|
176 __ASSERT_DEBUG( !IsNull(), FavouritesPanic( EFavouritesInternal ) ); |
|
177 __ASSERT_DEBUG( iType == EFile, \ |
|
178 FavouritesPanic( EFavouritesInternal ) ); |
|
179 return *(STATIC_CAST( CFavouritesSrvFile*, iObject )); |
|
180 } |
|
181 |
|
182 // --------------------------------------------------------- |
|
183 // TFavouritesSessionEntry::ChkNum() |
|
184 // --------------------------------------------------------- |
|
185 // |
|
186 TInt TFavouritesSessionEntry::ChkNum() const |
|
187 { |
|
188 return iChkNum; |
|
189 } |
|
190 |
|
191 #endif |
|
192 |
|
193 // End of File |