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