|
1 /* |
|
2 * Copyright (c) 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: NWSessionSlotID implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGSESSIONSLOTID_H__ |
|
19 #define __CPENGSESSIONSLOTID_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class RWriteStream; |
|
27 class RReadStream; |
|
28 |
|
29 |
|
30 |
|
31 /** |
|
32 * NWSessionSlotID implementation. |
|
33 * |
|
34 * @since 3.0 |
|
35 */ |
|
36 class CPEngSessionSlotId : public CBase |
|
37 { |
|
38 public: /* Construction */ |
|
39 |
|
40 |
|
41 /** |
|
42 * Instantiates CPEngSessionSlotId object. |
|
43 * |
|
44 * @return New CPEngSessionSlotId instance. |
|
45 */ |
|
46 IMPORT_C static CPEngSessionSlotId* NewL(); |
|
47 IMPORT_C static CPEngSessionSlotId* NewLC(); |
|
48 |
|
49 /** |
|
50 * Instantiates a new copy from |
|
51 * CPEngSessionSlotId object. |
|
52 * |
|
53 * @return New CPEngSessionSlotId copy. |
|
54 */ |
|
55 IMPORT_C CPEngSessionSlotId* CloneL() const; |
|
56 IMPORT_C CPEngSessionSlotId* CloneLC() const; |
|
57 |
|
58 /** |
|
59 * Copies CPEngSessionSlotId contents from |
|
60 * source object. |
|
61 * |
|
62 * @param CPEngSessionSlotId source. |
|
63 */ |
|
64 IMPORT_C void CopyL( const CPEngSessionSlotId& aSource ); |
|
65 |
|
66 |
|
67 /** |
|
68 * Reset. |
|
69 */ |
|
70 IMPORT_C void Reset(); |
|
71 |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 ~CPEngSessionSlotId(); |
|
77 |
|
78 protected: |
|
79 |
|
80 /** |
|
81 * C++ constructor. |
|
82 */ |
|
83 CPEngSessionSlotId(); |
|
84 |
|
85 |
|
86 |
|
87 public: // NWSessionSlotID implementation |
|
88 |
|
89 |
|
90 /** |
|
91 * Sets the NWSessionSlotID sub-part. |
|
92 * |
|
93 * @param aAddress Service address to use. |
|
94 * @param aUserId User id to use. |
|
95 * @param aAppId AppId to use. |
|
96 */ |
|
97 IMPORT_C void SetServiceAddressL( const TDesC& aAddress ); |
|
98 IMPORT_C void SetUserIdL( const TDesC& aUserId ); |
|
99 |
|
100 /** |
|
101 * Fragment access. |
|
102 * |
|
103 * @return Requested sub-part. |
|
104 */ |
|
105 IMPORT_C TPtrC ServiceAddress() const; |
|
106 IMPORT_C TPtrC UserId() const; |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 public: // Match support |
|
112 |
|
113 /** |
|
114 * Pattern-matches NWSessionSlotIDs. |
|
115 * |
|
116 * @param aIdToMatch The NWSessionSlotID to match. |
|
117 * @return KErrNone if NWSessionSlotIDs match. |
|
118 * Else KErrNotFound. |
|
119 */ |
|
120 IMPORT_C TInt Match( const CPEngSessionSlotId& aIdToMatch ) const; |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 public: // Serialized presentation |
|
126 |
|
127 /** |
|
128 * Packs CPEngSessionSlotId state to buffer and |
|
129 * returns buffer to caller. |
|
130 * @return CPEngSessionSlotId state buffer. |
|
131 */ |
|
132 IMPORT_C HBufC8* PackLC() const; |
|
133 |
|
134 |
|
135 /** |
|
136 * Initializes CPEngSessionSlotId state from a package |
|
137 * previously created with PackLC(). |
|
138 * |
|
139 * @param aPack CPEngSessionSlotId state package. |
|
140 */ |
|
141 IMPORT_C void UnPackL( const TDesC8& aPack ); |
|
142 |
|
143 |
|
144 /** |
|
145 * Externalizes the data. |
|
146 * |
|
147 * @param aStream Stream where to write. |
|
148 */ |
|
149 IMPORT_C void ExternalizeL( RWriteStream& aStream ) const; |
|
150 |
|
151 |
|
152 /** |
|
153 * Internalizes the data. |
|
154 * |
|
155 * @param aStream Stream where to read from. |
|
156 */ |
|
157 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
158 |
|
159 |
|
160 /** |
|
161 * Returns size of the buffer needed for the streaming |
|
162 * |
|
163 * @since 3.0 |
|
164 * @return size of the buffer in bytes |
|
165 */ |
|
166 IMPORT_C TInt Size() const; |
|
167 |
|
168 |
|
169 private: //Data |
|
170 |
|
171 //OWN: NWSessionSlotID service address sub-part |
|
172 HBufC* iServiceAddress; |
|
173 |
|
174 //OWN: NWSessionSlotID user id sub-part |
|
175 HBufC* iUserId; |
|
176 |
|
177 }; |
|
178 |
|
179 #endif //__CPENGSESSIONSLOTID_H__ |
|
180 |
|
181 // End of File |