1.1 --- a/epoc32/include/mw/eikcapca.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/eikcapca.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,157 @@
1.4 -eikcapca.h
1.5 +/*
1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#if !defined(__EIKCAPCA_H__)
1.24 +#define __EIKCAPCA_H__
1.25 +
1.26 +#include <e32base.h>
1.27 +
1.28 +class CEikCaptionedControl;
1.29 +class CCoeControl;
1.30 +class CEikCapCArrayExtension;
1.31 +
1.32 +class CEikCapCArray : public CArrayPtrFlat<CEikCaptionedControl>
1.33 + {
1.34 +public:
1.35 + /** Constructor
1.36 + *
1.37 + * Creates CEikCapCArray with a granilarity.
1.38 + *
1.39 + * @param aGranularity how many items will be allocated each time allocation happens
1.40 + */
1.41 + IMPORT_C CEikCapCArray(TInt aGranularity);
1.42 +
1.43 + /** Destructor
1.44 + *
1.45 + * Destroys CEikCapCArray
1.46 + */
1.47 + IMPORT_C ~CEikCapCArray();
1.48 +
1.49 + /** MinimumSize() returns minimum size for the array
1.50 + *
1.51 + * MinimumSize calculates minimum possible size for
1.52 + * the captioned control array.
1.53 + *
1.54 + * @return size in pixels
1.55 + */
1.56 + IMPORT_C TSize MinimumSize();
1.57 +
1.58 + /** SetRect() sets the rectangle of the captionedcontrolarray
1.59 + *
1.60 + * SetRect layouts the captionedcontrolarray. Captioned
1.61 + * control rectangles are calculated based on provided rectangle
1.62 + * and sizes of the captioned controls.
1.63 + *
1.64 + * @param aRect Rectangle for the whole array
1.65 + */
1.66 + IMPORT_C void SetRect(const TRect& aRect);
1.67 +
1.68 + /** ResetMinimumSizes() clears size information
1.69 + *
1.70 + * ResetMinimumSizes goes through all captionedcontrols
1.71 + * and resets the minimum size information of the
1.72 + * captionedcontrols
1.73 + */
1.74 + IMPORT_C void ResetMinimumSizes();
1.75 +
1.76 + /** LineIndexFromId() provides line index in array based on id number
1.77 + *
1.78 + * Every captionedcontrol has iId and based on the id,
1.79 + * LineIndexFromId goes through the captionedcontrolarray
1.80 + * and finds the captionedcontrol's position in the array
1.81 + * based on the id provided
1.82 + *
1.83 + * @param aControlId captionedcontrol's iId.
1.84 + */
1.85 + IMPORT_C TInt LineIndexFromId(TInt aControlId) const;
1.86 +
1.87 + /** FindLineIndex() finds line index based on control
1.88 + *
1.89 + * Every captionedcontrol has iControl CCoeControl which
1.90 + * implements the control for the DLG_LINE. FindLineIndex
1.91 + * goes through all captionedcontrols and finds the one
1.92 + * which has aControl as it's control.
1.93 + *
1.94 + * @param aControl control to be found
1.95 + */
1.96 + IMPORT_C TInt FindLineIndex(const CCoeControl* aControl) const;
1.97 +
1.98 + /** DeleteLine() removes line from captionedcontrolarray
1.99 + *
1.100 + * Elements from CaptionedControlArray can be removed
1.101 + * by calling DeleteLine method.
1.102 + *
1.103 + * @param aIndex index of the line to be removed
1.104 + */
1.105 + IMPORT_C void DeleteLine(TInt aIndex);
1.106 +
1.107 + /** AdjustAllIds() modified iId fields of the captionedcontrols
1.108 + *
1.109 + * @param aControlIdDelta how much to increase or decrease control id's
1.110 + */
1.111 + IMPORT_C void AdjustAllIds(TInt aControlIdDelta);
1.112 +
1.113 + /** SetDensePacking() sets dense packing flag
1.114 + *
1.115 + * @param aDensePacking whether dense packing flag is on
1.116 + */
1.117 + IMPORT_C void SetDensePacking(TBool aDensePacking);
1.118 + TBool CalcItemIndexes(TInt &aTopItemIndex, TInt &aMiddleItems, TInt &aBottomItemIndex, TSize aAreaSize);
1.119 + TInt NumberOfTextLines() const; // for scrollbar
1.120 + TInt NumberOfTextLinesBeforeLine(TInt aLine) const;
1.121 + TInt FindItemFromTextLine(TInt aTextLine) const;
1.122 + TRect Rect() const;
1.123 + void SetRect(const TRect& aRect, TInt aTop, TInt aMiddle, TInt aBottom);
1.124 + TInt YPosToLine(const TRect &aRect, TInt aTop, TInt aMiddle, TInt aBottom, TInt aYCoord);
1.125 + void CreateExtensionL();
1.126 + CEikCapCArrayExtension *ExtensionOrNull() const;
1.127 +
1.128 + /**
1.129 + * Scrolls each item by aDelta pixels in y direction.
1.130 + */
1.131 + TInt ScrollByPixels( TInt aDelta );
1.132 +
1.133 + /**
1.134 + * Return the index of the line at aYPos.
1.135 + */
1.136 + TInt YPositionToLineIndex( TInt aYPos ) const;
1.137 +
1.138 + /**
1.139 + * Returns line's top y coordinate.
1.140 + */
1.141 + TInt LineIndexToYPosition( TInt aLine, TInt aTopY ) const;
1.142 +
1.143 + /**
1.144 + * Moves aLine to the visible screen area or out of it.
1.145 + */
1.146 + void MoveLineToScreen( TInt aLine, TInt aTopY, TBool aVisible );
1.147 +
1.148 +private:
1.149 + /**
1.150 + * Positions controls in real locations.
1.151 + */
1.152 + void SetRealRect( const TRect& aRect, TInt aTop, TInt aBottom );
1.153 +
1.154 +private:
1.155 + //TInt iCaptionWidth;
1.156 + CEikCapCArrayExtension *iExtension;
1.157 + TBool iDensePacking;
1.158 + //TRect iRect;
1.159 + };
1.160 +
1.161 +#endif