williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__EIKCAPCA_H__)
|
williamr@2
|
20 |
#define __EIKCAPCA_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
|
williamr@2
|
24 |
class CEikCaptionedControl;
|
williamr@2
|
25 |
class CCoeControl;
|
williamr@2
|
26 |
class CEikCapCArrayExtension;
|
williamr@2
|
27 |
|
williamr@2
|
28 |
class CEikCapCArray : public CArrayPtrFlat<CEikCaptionedControl>
|
williamr@2
|
29 |
{
|
williamr@2
|
30 |
public:
|
williamr@2
|
31 |
/** Constructor
|
williamr@2
|
32 |
*
|
williamr@2
|
33 |
* Creates CEikCapCArray with a granilarity.
|
williamr@2
|
34 |
*
|
williamr@2
|
35 |
* @param aGranularity how many items will be allocated each time allocation happens
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
IMPORT_C CEikCapCArray(TInt aGranularity);
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/** Destructor
|
williamr@2
|
40 |
*
|
williamr@2
|
41 |
* Destroys CEikCapCArray
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
IMPORT_C ~CEikCapCArray();
|
williamr@2
|
44 |
|
williamr@2
|
45 |
/** MinimumSize() returns minimum size for the array
|
williamr@2
|
46 |
*
|
williamr@2
|
47 |
* MinimumSize calculates minimum possible size for
|
williamr@2
|
48 |
* the captioned control array.
|
williamr@2
|
49 |
*
|
williamr@2
|
50 |
* @return size in pixels
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
IMPORT_C TSize MinimumSize();
|
williamr@2
|
53 |
|
williamr@2
|
54 |
/** SetRect() sets the rectangle of the captionedcontrolarray
|
williamr@2
|
55 |
*
|
williamr@2
|
56 |
* SetRect layouts the captionedcontrolarray. Captioned
|
williamr@2
|
57 |
* control rectangles are calculated based on provided rectangle
|
williamr@2
|
58 |
* and sizes of the captioned controls.
|
williamr@2
|
59 |
*
|
williamr@2
|
60 |
* @param aRect Rectangle for the whole array
|
williamr@2
|
61 |
*/
|
williamr@2
|
62 |
IMPORT_C void SetRect(const TRect& aRect);
|
williamr@2
|
63 |
|
williamr@2
|
64 |
/** ResetMinimumSizes() clears size information
|
williamr@2
|
65 |
*
|
williamr@2
|
66 |
* ResetMinimumSizes goes through all captionedcontrols
|
williamr@2
|
67 |
* and resets the minimum size information of the
|
williamr@2
|
68 |
* captionedcontrols
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
IMPORT_C void ResetMinimumSizes();
|
williamr@2
|
71 |
|
williamr@2
|
72 |
/** LineIndexFromId() provides line index in array based on id number
|
williamr@2
|
73 |
*
|
williamr@2
|
74 |
* Every captionedcontrol has iId and based on the id,
|
williamr@2
|
75 |
* LineIndexFromId goes through the captionedcontrolarray
|
williamr@2
|
76 |
* and finds the captionedcontrol's position in the array
|
williamr@2
|
77 |
* based on the id provided
|
williamr@2
|
78 |
*
|
williamr@2
|
79 |
* @param aControlId captionedcontrol's iId.
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
IMPORT_C TInt LineIndexFromId(TInt aControlId) const;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/** FindLineIndex() finds line index based on control
|
williamr@2
|
84 |
*
|
williamr@2
|
85 |
* Every captionedcontrol has iControl CCoeControl which
|
williamr@2
|
86 |
* implements the control for the DLG_LINE. FindLineIndex
|
williamr@2
|
87 |
* goes through all captionedcontrols and finds the one
|
williamr@2
|
88 |
* which has aControl as it's control.
|
williamr@2
|
89 |
*
|
williamr@2
|
90 |
* @param aControl control to be found
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
IMPORT_C TInt FindLineIndex(const CCoeControl* aControl) const;
|
williamr@2
|
93 |
|
williamr@2
|
94 |
/** DeleteLine() removes line from captionedcontrolarray
|
williamr@2
|
95 |
*
|
williamr@2
|
96 |
* Elements from CaptionedControlArray can be removed
|
williamr@2
|
97 |
* by calling DeleteLine method.
|
williamr@2
|
98 |
*
|
williamr@2
|
99 |
* @param aIndex index of the line to be removed
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
IMPORT_C void DeleteLine(TInt aIndex);
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/** AdjustAllIds() modified iId fields of the captionedcontrols
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
* @param aControlIdDelta how much to increase or decrease control id's
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
IMPORT_C void AdjustAllIds(TInt aControlIdDelta);
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/** SetDensePacking() sets dense packing flag
|
williamr@2
|
110 |
*
|
williamr@2
|
111 |
* @param aDensePacking whether dense packing flag is on
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
IMPORT_C void SetDensePacking(TBool aDensePacking);
|
williamr@2
|
114 |
TBool CalcItemIndexes(TInt &aTopItemIndex, TInt &aMiddleItems, TInt &aBottomItemIndex, TSize aAreaSize);
|
williamr@2
|
115 |
TInt NumberOfTextLines() const; // for scrollbar
|
williamr@2
|
116 |
TInt NumberOfTextLinesBeforeLine(TInt aLine) const;
|
williamr@2
|
117 |
TInt FindItemFromTextLine(TInt aTextLine) const;
|
williamr@2
|
118 |
TRect Rect() const;
|
williamr@2
|
119 |
void SetRect(const TRect& aRect, TInt aTop, TInt aMiddle, TInt aBottom);
|
williamr@2
|
120 |
TInt YPosToLine(const TRect &aRect, TInt aTop, TInt aMiddle, TInt aBottom, TInt aYCoord);
|
williamr@2
|
121 |
void CreateExtensionL();
|
williamr@2
|
122 |
CEikCapCArrayExtension *ExtensionOrNull() const;
|
williamr@2
|
123 |
|
williamr@2
|
124 |
/**
|
williamr@2
|
125 |
* Scrolls each item by aDelta pixels in y direction.
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
TInt ScrollByPixels( TInt aDelta );
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
* Return the index of the line at aYPos.
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
TInt YPositionToLineIndex( TInt aYPos ) const;
|
williamr@2
|
133 |
|
williamr@2
|
134 |
/**
|
williamr@2
|
135 |
* Returns line's top y coordinate.
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
TInt LineIndexToYPosition( TInt aLine, TInt aTopY ) const;
|
williamr@2
|
138 |
|
williamr@2
|
139 |
/**
|
williamr@2
|
140 |
* Moves aLine to the visible screen area or out of it.
|
williamr@2
|
141 |
*/
|
williamr@2
|
142 |
void MoveLineToScreen( TInt aLine, TInt aTopY, TBool aVisible );
|
williamr@2
|
143 |
|
williamr@2
|
144 |
private:
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
* Positions controls in real locations.
|
williamr@2
|
147 |
*/
|
williamr@2
|
148 |
void SetRealRect( const TRect& aRect, TInt aTop, TInt aBottom );
|
williamr@2
|
149 |
|
williamr@2
|
150 |
private:
|
williamr@2
|
151 |
//TInt iCaptionWidth;
|
williamr@2
|
152 |
CEikCapCArrayExtension *iExtension;
|
williamr@2
|
153 |
TBool iDensePacking;
|
williamr@2
|
154 |
//TRect iRect;
|
williamr@2
|
155 |
};
|
williamr@2
|
156 |
|
williamr@2
|
157 |
#endif
|