|
1 /* |
|
2 * Copyright (c) 2007 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 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CMSCONTACTBASE__ |
|
21 #define __CMSCONTACTBASE__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <s32std.h> |
|
25 |
|
26 const TInt KStreamBufferDefaultSizeText = 256; |
|
27 const TInt KStreamBufferDefaultSizeBinary = 2048; |
|
28 |
|
29 class RCmsContact; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 class CCmsContactBase : public CActive |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Get a pointer to the 16-bit stream buffer |
|
38 * |
|
39 * @return TAny* Pointer to the stream buffer |
|
40 */ |
|
41 TPtr* StreamDesc16(); |
|
42 |
|
43 /** |
|
44 * Get a pointer to the 8-bit stream buffer |
|
45 * |
|
46 * @return TAny* Pointer to the stream buffer |
|
47 */ |
|
48 TPtr8* StreamDesc8(); |
|
49 |
|
50 /** |
|
51 * Check whether this is a binary field |
|
52 * |
|
53 * @return TBool Binary or not |
|
54 */ |
|
55 TBool IsBinary() const; |
|
56 |
|
57 /** |
|
58 * Activate this object and return its request status |
|
59 * |
|
60 * @return TRequestStatus& Request status |
|
61 */ |
|
62 TRequestStatus& Activate(); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 */ |
|
67 ~CCmsContactBase(); |
|
68 |
|
69 protected: |
|
70 |
|
71 /** |
|
72 * C++ constructor is private |
|
73 * |
|
74 * @return CCmsContactFieldInfo |
|
75 */ |
|
76 CCmsContactBase( RCmsContact& aContact ); |
|
77 |
|
78 /** |
|
79 * C++ constructor is private |
|
80 * |
|
81 * @param RCmsContact& Contact handle |
|
82 * @param TRequestStatus& Request status of the caller |
|
83 * @return CCmsContactFieldInfo |
|
84 */ |
|
85 CCmsContactBase( RCmsContact& aContact, TRequestStatus& aClientStatus ); |
|
86 |
|
87 /** |
|
88 * Symbian second-phase constructor |
|
89 * |
|
90 * @return void |
|
91 */ |
|
92 void BaseConstructL(); |
|
93 |
|
94 /** |
|
95 * Reallocate the stream buffer |
|
96 * |
|
97 * @param TInt The size of the new buffer |
|
98 * @return void |
|
99 */ |
|
100 void ReAllocBufferL( TInt aBufferSize ); |
|
101 |
|
102 /** |
|
103 * Reallocate the stream buffer |
|
104 * |
|
105 * @param TInt The size of the new buffer |
|
106 * @return void |
|
107 */ |
|
108 void HandleError(); |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * Reallocate the stream buffer |
|
114 * |
|
115 * @param TInt The size of the new buffer |
|
116 * @return void |
|
117 */ |
|
118 void DoCancel(); |
|
119 |
|
120 protected : // data |
|
121 |
|
122 TPtr iStreamDesc16; |
|
123 TPtr8 iStreamDesc8; |
|
124 TBool iBinary; |
|
125 HBufC* iStreamBuffer16; |
|
126 HBufC8* iStreamBuffer8; |
|
127 RCmsContact& iContact; |
|
128 TRequestStatus* iClientStatus; |
|
129 }; |
|
130 |
|
131 #endif //__CMSCONTACTFIELD__ |
|
132 |
|
133 |
|
134 // End of File |