|
1 /* |
|
2 * Copyright (c) 2008 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: CVIMPSTUiArray-array decorator |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _CVIMPSTUISINGLELISTBOXARRAY_H |
|
21 #define _CVIMPSTUISINGLELISTBOXARRAY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <bamdesca.h> // MDesCArray |
|
26 #include <AknIconArray.h> |
|
27 #include <gulicon.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CColumnListBoxData; |
|
31 class CVIMPSTUiListBoxModel; |
|
32 class CVIMPSTUiSingleStyleListBox; |
|
33 class MVIMPSTProcessArray; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Friends-array decorator. |
|
39 * Decorates the array for listbox |
|
40 * |
|
41 * @lib vimpstui.dll |
|
42 * @since 5.0 |
|
43 */ |
|
44 class CVIMPSTUiSingleListboxArray : public CBase, public MDesCArray |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * @param aItemModel that contains the data. |
|
51 * @param aListBoxData Listbox data for setting row properties, |
|
52 * can be NULL. |
|
53 * @param aListBox Listbox |
|
54 */ |
|
55 static CVIMPSTUiSingleListboxArray* NewL( |
|
56 MVIMPSTProcessArray& aItemModel, |
|
57 CColumnListBoxData* aListboxData, |
|
58 CVIMPSTUiSingleStyleListBox& aListBox ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CVIMPSTUiSingleListboxArray(); |
|
64 |
|
65 |
|
66 public: // Functions from MDesCArray |
|
67 |
|
68 /** |
|
69 * From MDesCArray, Returns the number of descriptor elements in |
|
70 * a descriptor array. |
|
71 * @see MDesCArray |
|
72 */ |
|
73 TInt MdcaCount() const; |
|
74 |
|
75 /** |
|
76 * From MDesCArray, Indexes into a descriptor array. |
|
77 * @see MDesCArray |
|
78 */ |
|
79 TPtrC16 MdcaPoint( TInt aIndex ) const; |
|
80 |
|
81 |
|
82 private: // new functions |
|
83 |
|
84 /** |
|
85 * Append formatted contact identification to buffer |
|
86 * @param aBuffer Buffer where identification will be appended |
|
87 * @param aContact Contact |
|
88 * @param aContactList Contact list |
|
89 */ |
|
90 void AppendContactL( TPtr& aBuffer, TInt aIndex ) const; |
|
91 |
|
92 /** |
|
93 * Append formatted contact list identification to buffer |
|
94 * @param aBuffer Buffer where identification will be appended |
|
95 * @param aContactList Contact list |
|
96 */ |
|
97 void AppendContactListL( TPtr& aBuffer, |
|
98 TInt aIndex ) const; |
|
99 |
|
100 /** |
|
101 * Append formatted owndata identification to buffer |
|
102 * @param aBuffer Buffer where identification will be appended |
|
103 * @param aContactList Contact list |
|
104 */ |
|
105 void AppendOwnDataL( TPtr& aBuffer, |
|
106 TInt aIndex ) const; |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 * C++ default constructor. |
|
112 * @param aItemModel that contains the data. |
|
113 * @param aListBoxData Listbox data for setting row properties, can be NULL. |
|
114 * @param aListBox Listbox |
|
115 */ |
|
116 CVIMPSTUiSingleListboxArray( MVIMPSTProcessArray& aItemModel, |
|
117 CColumnListBoxData* aListboxData ,CVIMPSTUiSingleStyleListBox& aListBox ); |
|
118 |
|
119 /** |
|
120 * By default Symbian OS constructor is private. |
|
121 */ |
|
122 void ConstructL(); |
|
123 |
|
124 private: // Data |
|
125 |
|
126 // wrapper array on engine side arrays |
|
127 MVIMPSTProcessArray& iItemArray; |
|
128 |
|
129 // Doesn't own. Pointer to listbox data for setting row properties |
|
130 CColumnListBoxData* iListboxData; |
|
131 |
|
132 //Ref. to Contact List Box |
|
133 CVIMPSTUiSingleStyleListBox& iListBox; |
|
134 |
|
135 // Owns. Buffer that hold's information about fetched item |
|
136 HBufC* iData; |
|
137 |
|
138 // maxmimun length of icon strings added to formatted text |
|
139 TInt iMaxLengthOfIcons; |
|
140 |
|
141 |
|
142 // Not own. Model to check the real location of items. |
|
143 CVIMPSTUiListBoxModel* iContactListBoxModel; |
|
144 |
|
145 }; |
|
146 |
|
147 #endif // _CVIMPSTUISINGLELISTBOXARRAY_H |
|
148 |
|
149 // End of File |