|
1 /* |
|
2 * Copyright (c) 2003-2005 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: This class declares info array for chat info. This is |
|
15 * customized for using multiple lines. |
|
16 * (Item texts are not truncated) |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef CCACHATINFOARRAY_H |
|
22 #define CCACHATINFOARRAY_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <bamdesca.h> //MDesCArray |
|
26 #include <badesca.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CFont; |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Declares chat info array |
|
34 * |
|
35 * @lib chat.app |
|
36 * @since 1.2 |
|
37 */ |
|
38 class CCAChatInfoArray : public CBase, public MDesCArray |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CCAChatInfoArray* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CCAChatInfoArray(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * This method sets the item label and fieldtext for items |
|
56 * @since 1.2 |
|
57 * @param aLabelResourceId Resource id for label (header) |
|
58 * @param aFieldText Descriptor that contains field text |
|
59 * @param aWrap ETrue if items are wrapped |
|
60 */ |
|
61 void AddLabelAndTextL( TInt aLabelResourceId, const TDesC& aFieldText, |
|
62 TBool aWrap = ETrue ); |
|
63 |
|
64 private: //New functions |
|
65 |
|
66 /** |
|
67 * This method sets the line width array for AknTextUtils:: |
|
68 * WrapToArrayL() |
|
69 * @since 1.2 |
|
70 * @param aLineWidthArray Array that contains line widths |
|
71 * @param aTextField Descriptor that contains field text. |
|
72 * With this descriptor the number of lines are declared |
|
73 */ |
|
74 void SetLineWidthArrayL( CArrayFix<TInt>* aLineWidthArray, |
|
75 const TDesC& aTextField ); |
|
76 |
|
77 |
|
78 public: // from MDesCArray |
|
79 |
|
80 /** |
|
81 * From MDesCArray Returns the number of descriptor elements |
|
82 * in a descriptor array |
|
83 * @return The number of descriptor elements in a descriptor array |
|
84 */ |
|
85 TInt MdcaCount() const; |
|
86 |
|
87 /** |
|
88 * From MDesCArray Indexes into a descriptor array |
|
89 * @param aIndex The position of the descriptor element within a |
|
90 * descriptor array. The position is relative to zero; i.e. zero |
|
91 * implies the first descriptor element in a descriptor array. |
|
92 * @return A 16 bit non-modifiable pointer descriptor representing the |
|
93 * descriptor element located at position aIndex within a |
|
94 * descriptor array. |
|
95 */ |
|
96 TPtrC MdcaPoint( TInt aIndex ) const; |
|
97 |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Default constructor |
|
103 */ |
|
104 CCAChatInfoArray(); |
|
105 |
|
106 /** |
|
107 * By default Symbian OS constructor is private. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 private: |
|
112 //owns |
|
113 CDesCArray* iTextFields; |
|
114 |
|
115 //owns |
|
116 CArrayFix<TInt>* iLineWidthArray; |
|
117 |
|
118 //owns |
|
119 HBufC* iLine; |
|
120 |
|
121 //doesn't own |
|
122 const CFont* iFont; |
|
123 |
|
124 TInt iSubCellWidth; |
|
125 }; |
|
126 |
|
127 #endif // CCACHATINFOARRAY_H |
|
128 |
|
129 // End of File |