|
1 /* |
|
2 * Copyright (c) 2006 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 #ifndef C_NCD_QUERY_ITEM_H |
|
20 #define C_NCD_QUERY_ITEM_H |
|
21 |
|
22 #include <e32cmn.h> |
|
23 |
|
24 #include "ncdqueryitem.h" |
|
25 #include "catalogsbaseimpl.h" |
|
26 #include "catalogsinterfacebase.h" |
|
27 |
|
28 |
|
29 class MNcdConfigurationProtocolQueryElement; |
|
30 class CNcdString; |
|
31 class CNcdQuery; |
|
32 class RWriteStream; |
|
33 class RReadStream; |
|
34 |
|
35 const TInt KMaxTIntLengthInChars( 11 ); |
|
36 |
|
37 /** |
|
38 * Implementation for query item. |
|
39 * |
|
40 * Base class for query items. This class is abstract. |
|
41 */ |
|
42 class CNcdQueryItem : public CCatalogsInterfaceBase, |
|
43 public virtual MNcdQueryItem |
|
44 { |
|
45 public: |
|
46 |
|
47 virtual void InternalizeL( RReadStream& aReadStream ); |
|
48 |
|
49 virtual void InternalizeL( |
|
50 const MNcdConfigurationProtocolQueryElement& aQueryElement ); |
|
51 |
|
52 virtual void ExternalizeL( RWriteStream& aWriteStream ) const; |
|
53 |
|
54 const TDesC& Id() const; |
|
55 |
|
56 TBool IsSet() const; |
|
57 |
|
58 virtual const TDesC& ValueL() = 0; |
|
59 |
|
60 /** |
|
61 * If ETrue, this item will be visible only inside the engine. |
|
62 */ |
|
63 TBool IsInvisible() const; |
|
64 |
|
65 /** |
|
66 * Internalizes just the id's and response value. |
|
67 * |
|
68 */ |
|
69 //void InternalizeResponseL( RWriteStream& aWriteStream ) = 0; |
|
70 |
|
71 /** |
|
72 * Externalizes just the id's and response value. |
|
73 * |
|
74 * @note Use a dynamic buffer for the stream, |
|
75 * amout of data written can vary. |
|
76 */ |
|
77 //void ExternalizeResponseL( RWriteStream& aWriteStream ) const = 0; |
|
78 |
|
79 public: // From MNcdQueryItem |
|
80 |
|
81 /** |
|
82 * @see MNcdQueryItem |
|
83 */ |
|
84 virtual TNcdInterfaceId Type() const; |
|
85 |
|
86 /** |
|
87 * @see MNcdQueryItem |
|
88 */ |
|
89 virtual MNcdQueryItem::TSemantics Semantics() const; |
|
90 |
|
91 /** |
|
92 * @see MNcdQueryItem |
|
93 */ |
|
94 virtual const TDesC& Label() const; |
|
95 |
|
96 /** |
|
97 * @see MNcdQueryItem |
|
98 */ |
|
99 virtual const TDesC& Message() const; |
|
100 |
|
101 /** |
|
102 * @see MNcdQueryItem |
|
103 */ |
|
104 virtual const TDesC& Description() const; |
|
105 |
|
106 /** |
|
107 * @see MNcdQueryItem |
|
108 */ |
|
109 virtual TBool IsOptional() const; |
|
110 |
|
111 protected: |
|
112 |
|
113 CNcdQueryItem( CNcdQuery& aParent ); |
|
114 |
|
115 virtual ~CNcdQueryItem(); |
|
116 |
|
117 virtual void ConstructL(); |
|
118 |
|
119 |
|
120 protected: |
|
121 |
|
122 CNcdQuery& iParentQuery; |
|
123 HBufC* iId; |
|
124 MNcdQueryItem::TSemantics iSemantics; |
|
125 |
|
126 CNcdString* iLabel; |
|
127 CNcdString* iMessage; |
|
128 CNcdString* iDescription; |
|
129 |
|
130 mutable HBufC* iLocalizedLabel; |
|
131 mutable HBufC* iLocalizedMessage; |
|
132 mutable HBufC* iLocalizedDescription; |
|
133 |
|
134 TBool iIsOptional; |
|
135 TNcdInterfaceId iType; |
|
136 HBufC* iValue; |
|
137 TBool iIsSet; |
|
138 TBool iIsInvisible; |
|
139 |
|
140 }; |
|
141 |
|
142 #endif // C_NCD_QUERY_ITEM_H |