|
1 /* |
|
2 * Copyright (c) 2009 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: Listbox model row contact model |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CSPBCONTACTDATAMODELROW_H |
|
19 #define CSPBCONTACTDATAMODELROW_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <TPbk2IconId.h> |
|
23 |
|
24 class RWriteStream; |
|
25 class RReadStream; |
|
26 |
|
27 |
|
28 /** |
|
29 * MyCard view list box model row. |
|
30 * |
|
31 */ |
|
32 NONSHARABLE_CLASS( CSpbContactDataModelRow ) : public CBase |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Creates a new instance of this class. |
|
38 * |
|
39 * @return A new instance of this class. |
|
40 */ |
|
41 static CSpbContactDataModelRow* NewL(); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 ~CSpbContactDataModelRow(); |
|
47 |
|
48 public: // Interface |
|
49 |
|
50 /** |
|
51 * Returns the number of columns in this row. |
|
52 * |
|
53 * @return Number of columns in this row. |
|
54 */ |
|
55 TInt ColumnCount() const; |
|
56 |
|
57 /** |
|
58 * Returns the descriptor at the given position. |
|
59 * |
|
60 * @param aColumnIndex Column index. |
|
61 * @return The descriptor at the given index. |
|
62 */ |
|
63 TPtrC At(TInt aColumnIndex) const; |
|
64 |
|
65 /** |
|
66 * Appends a given column to the row. |
|
67 * |
|
68 * @param aColumnText Column to append. |
|
69 */ |
|
70 void AppendColumnL(const TDesC& aColumnText); |
|
71 |
|
72 /** |
|
73 * replace column's text with a new one. |
|
74 * |
|
75 * @param aIndex Column index |
|
76 * @param aColumnText new text |
|
77 */ |
|
78 void ReplaceColumnL( TInt aIndex, const TDesC& aColumnText ); |
|
79 |
|
80 /** |
|
81 * Is clip required. |
|
82 */ |
|
83 TBool IsClipRequired() const; |
|
84 |
|
85 /** |
|
86 * Clip text from beginning if field is numeric field or e-mail field. |
|
87 */ |
|
88 void SetClipRequired(TBool aFlag); |
|
89 |
|
90 /** |
|
91 * Returns the total descriptor length of all the columns. |
|
92 * |
|
93 * @return Total row length. |
|
94 */ |
|
95 TInt TotalLength() const; |
|
96 |
|
97 /** |
|
98 * Returns the maximum column length of this row. |
|
99 * |
|
100 * @return Maximum column length. |
|
101 */ |
|
102 TInt MaxColumnLength() const; |
|
103 |
|
104 /** |
|
105 * Externalize row into stream |
|
106 */ |
|
107 void ExternalizeL( RWriteStream& aStream ) const; |
|
108 |
|
109 /** |
|
110 * Internalize row from stream |
|
111 */ |
|
112 void InternalizeL( RReadStream& aStream ); |
|
113 |
|
114 /** |
|
115 * |
|
116 */ |
|
117 const TPbk2IconId& Icon(); |
|
118 |
|
119 /** |
|
120 * |
|
121 */ |
|
122 void SetIcon( const TPbk2IconId& aIcon ); |
|
123 |
|
124 private: // Implementation |
|
125 |
|
126 CSpbContactDataModelRow(); |
|
127 |
|
128 private: // Data |
|
129 |
|
130 /// Own: Column array |
|
131 RPointerArray<HBufC> iColumns; |
|
132 |
|
133 /// Is clip required. |
|
134 TBool iClipBeginning; |
|
135 |
|
136 /// Icon ID |
|
137 TPbk2IconId iIcon; |
|
138 }; |
|
139 |
|
140 #endif //CSPBCONTACTDATAMODELROW_H |
|
141 |
|
142 // End of file |