|
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_SELECTION_ITEM_H |
|
20 #define C_NCD_QUERY_SELECTION_ITEM_H |
|
21 |
|
22 #include <e32cmn.h> |
|
23 #include <badesca.h> |
|
24 |
|
25 #include "ncdqueryselectionitem.h" |
|
26 #include "ncdqueryitemimpl.h" |
|
27 #include "ncdinterfaceids.h" |
|
28 #include "ncd_cp_queryelement.h" |
|
29 |
|
30 class CDesC16ArrayFlat; |
|
31 class CNcdQueryOption; |
|
32 |
|
33 /** |
|
34 * Implementation for selection query item. |
|
35 */ |
|
36 class CNcdQuerySelectionItem : public CNcdQueryItem, |
|
37 public MNcdQuerySelectionItem |
|
38 |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 static CNcdQuerySelectionItem* NewL( |
|
44 RReadStream& aReadStream, CNcdQuery& aParent ); |
|
45 |
|
46 static CNcdQuerySelectionItem* NewLC( |
|
47 RReadStream& aReadStream, CNcdQuery& aParent ); |
|
48 |
|
49 static CNcdQuerySelectionItem* NewL( |
|
50 const MNcdConfigurationProtocolQueryElement& aQueryElement, |
|
51 CNcdQuery& aParent ); |
|
52 |
|
53 static CNcdQuerySelectionItem* NewLC( |
|
54 const MNcdConfigurationProtocolQueryElement& aQueryElement, |
|
55 CNcdQuery& aParent ); |
|
56 |
|
57 // For payment method query |
|
58 static CNcdQuerySelectionItem* NewL( const RPointerArray<CNcdString>& aPaymentMethodNames, |
|
59 const MDesC8Array& aPaymentMethodTypes, |
|
60 CNcdQuery& aParent ); |
|
61 static CNcdQuerySelectionItem* NewLC( const RPointerArray<CNcdString>& aPaymentMethodNames, |
|
62 const MDesC8Array& aPaymentMethodTypes, |
|
63 CNcdQuery& aParent ); |
|
64 |
|
65 |
|
66 void InternalizeL( RReadStream& aReadStream ); |
|
67 |
|
68 void InternalizeL( const MNcdConfigurationProtocolQueryElement& aQuery ); |
|
69 |
|
70 void ExternalizeL( RWriteStream& aWriteStream ) const; |
|
71 |
|
72 |
|
73 public: // From MNcdQuerySelectionItem |
|
74 |
|
75 |
|
76 /** |
|
77 * @see MNcdQuerySelectionItem |
|
78 */ |
|
79 virtual const MDesCArray& SelectionTexts() const; |
|
80 |
|
81 /** |
|
82 * @see MNcdQuerySelectionItem |
|
83 */ |
|
84 virtual const MDesC8Array& SelectionData() const; |
|
85 |
|
86 /** |
|
87 * @see MNcdQuerySelectionItem |
|
88 */ |
|
89 virtual void SetSelectionL( TInt aIndex ); |
|
90 |
|
91 /** |
|
92 * @see MNcdQuerySelectionItem::Selection() |
|
93 */ |
|
94 virtual TInt Selection() const; |
|
95 |
|
96 public: // From MNcdQueryItem |
|
97 |
|
98 /** |
|
99 * @see MNcdQueryItem |
|
100 */ |
|
101 virtual TNcdInterfaceId Type() const; |
|
102 |
|
103 public: // From CNcdQueryItem |
|
104 |
|
105 /** |
|
106 * @see CNcdQueryItem |
|
107 */ |
|
108 const TDesC& ValueL(); |
|
109 |
|
110 protected: |
|
111 |
|
112 virtual ~CNcdQuerySelectionItem(); |
|
113 |
|
114 private: |
|
115 |
|
116 CNcdQuerySelectionItem( CNcdQuery& aParent ); |
|
117 |
|
118 virtual void ConstructL(); |
|
119 |
|
120 virtual void ConstructL( const RPointerArray<CNcdString>& aPaymentMethodNames, |
|
121 const MDesC8Array& aPaymentMethodTypes ); |
|
122 |
|
123 void CreateSelectionTextsL(); |
|
124 |
|
125 private: |
|
126 |
|
127 CDesC16ArrayFlat* iSelectionTexts; |
|
128 CDesC8ArrayFlat* iSelectionData; |
|
129 RPointerArray< CNcdQueryOption > iOptions; |
|
130 TInt iSelection; |
|
131 |
|
132 }; |
|
133 |
|
134 |
|
135 #endif // M_NCDQUERYSELECTIONITEM_H |