epoc32/include/mw/akngmsstylegrid.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/akngmsstylegrid.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/akngmsstylegrid.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,230 @@
     1.4 -akngmsstylegrid.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 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 +*       Contains the View and the Component of the photoalbum picture grid
    1.20 +*       component.
    1.21 +*
    1.22 +*
    1.23 +*/
    1.24 +
    1.25 +
    1.26 +#ifndef __CAknGMSStyleGrid_h
    1.27 +#define __CAknGMSStyleGrid_h
    1.28 +
    1.29 +#include <AknGrid.h>
    1.30 +#include <aknpopup.h>
    1.31 +#include <aknlists.h>
    1.32 +
    1.33 +class CGulIcon;
    1.34 +
    1.35 +// ============================================================================
    1.36 +// CAknGMSStyleGridView
    1.37 +// ============================================================================
    1.38 +
    1.39 +/**
    1.40 +	 the view for the grid component.
    1.41 +*/
    1.42 +class CAknGMSStyleGridView : public CAknGridView
    1.43 +	{
    1.44 +public: // from CAknGridView
    1.45 +	IMPORT_C CAknGMSStyleGridView();
    1.46 +public: // from	CAknGridView
    1.47 +	/**
    1.48 +		draws the hor. and vert. lines.
    1.49 +	*/
    1.50 +	IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
    1.51 +public: // new methods
    1.52 +	/**
    1.53 +	 sets the rectangle for the drawing operations.
    1.54 +	 This method is called when the grid is constructed.
    1.55 +	 */
    1.56 +	IMPORT_C void SetupLayout(const TRect& aRect, TBool aIsPopup = EFalse, TInt aNum = -1);
    1.57 +private: // overridden from CListBoxView
    1.58 +	IMPORT_C virtual TAny* Reserved_1();
    1.59 +
    1.60 +private: // new methods
    1.61 +    /**
    1.62 +     Calculate maximum number of horizontal lines
    1.63 +     */
    1.64 +    TInt MaxNumOfHorLines() const;
    1.65 +
    1.66 +    /**
    1.67 +     Calculate maximum number of vertical lines
    1.68 +     */
    1.69 +    TInt MaxNumOfVerLines() const;
    1.70 +
    1.71 +private: // data
    1.72 +	TAknLayoutRect iHorLine[5];
    1.73 +	TAknLayoutRect iVerLine[3];
    1.74 +	const TRect* iRect;
    1.75 +	};
    1.76 +
    1.77 +
    1.78 +// ============================================================================
    1.79 +// CAknGMSStyleGrid
    1.80 +// ============================================================================
    1.81 +/**
    1.82 +	implements the grid for the PhotoAlbum
    1.83 +	A markable grid_large_graphic_pane, with 2 columns. The cell displays
    1.84 +	80x32 bitmaps.
    1.85 +*/
    1.86 +
    1.87 +class CAknGMSStyleGrid : public CAknSelectionGridTypedef
    1.88 +    {
    1.89 +public:
    1.90 +    /**
    1.91 +     * Creates a gms grid
    1.92 +     * @param aParent A parent used to find a window for the grid.
    1.93 +     * @param aIsPopup Whether a popup layout or main pane layout is used
    1.94 +     */
    1.95 +    IMPORT_C static CAknGMSStyleGrid* NewL(const CCoeControl* aParent, TBool aIsPopup = EFalse);
    1.96 +    /**
    1.97 +       do not use this, use NewL
    1.98 +       aIsPopup = EFalse is default.
    1.99 +    */
   1.100 +    IMPORT_C CAknGMSStyleGrid(); 
   1.101 +    /**
   1.102 +     * @param aIsPopup Whether a popup layout is used or not
   1.103 +     */
   1.104 +    IMPORT_C CAknGMSStyleGrid(TBool aIsPopup);
   1.105 +    /**
   1.106 +	 * 2nd phase of construction.
   1.107 +	 * @param aParent the parent compound control
   1.108 +	 * @param aRows desired rows of grid
   1.109 +	 * @param aCols desired cols of grid
   1.110 +	*/
   1.111 +	IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aRows=4, TInt aCols=2);
   1.112 +
   1.113 +	/**
   1.114 +		the destructor
   1.115 +	*/
   1.116 +	IMPORT_C ~CAknGMSStyleGrid();
   1.117 +
   1.118 +    /**
   1.119 +     * Sets the layout of the grid view
   1.120 +     */
   1.121 +    IMPORT_C void SetupLayout();
   1.122 +
   1.123 +    /**
   1.124 +     * From CCoeControl.     
   1.125 +     * Handles pointer events
   1.126 +     */
   1.127 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 
   1.128 +
   1.129 +public: // from CAknGrid
   1.130 +	/**
   1.131 +	 *	layouts and repaints the grid
   1.132 +	 */
   1.133 +	IMPORT_C void SizeChanged();
   1.134 +         
   1.135 +        /**
   1.136 +         * Decides size of the grid for dialogs.
   1.137 +         */
   1.138 +        IMPORT_C TSize MinimumSize();
   1.139 +
   1.140 +	/**
   1.141 +	 * Offers key events to parent class.
   1.142 +	 * @param aKeyEvent kind of key event
   1.143 +	 * @param aType key typed
   1.144 +	 */
   1.145 +	IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
   1.146 +
   1.147 +	/**
   1.148 +	 * Defines a grid cell size
   1.149 +	 * @return size of a grid cell
   1.150 +	 */
   1.151 +    static TSize KCELL_SIZE();
   1.152 +
   1.153 +	/**
   1.154 +	 * Redraw the grid.
   1.155 +	 * @param aRect the rectangle to draw.
   1.156 +	 */
   1.157 +	IMPORT_C void Draw(const TRect& aRect) const;
   1.158 +	
   1.159 +	/**
   1.160 +	 * Overriden from CAknGrid. Create the grid view for thus grid class.
   1.161 +	 * @ return the grid view
   1.162 +	 */ 
   1.163 +        IMPORT_C CListBoxView* MakeViewClassInstanceL();
   1.164 +
   1.165 +protected:
   1.166 +    /**
   1.167 +     * Are we a popup window or main pane window, ETrue = popup window.
   1.168 +     */
   1.169 +    TBool iIsPopup;
   1.170 +    
   1.171 +private:
   1.172 +    /**
   1.173 +    * From CAknControl
   1.174 +    */
   1.175 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.176 +
   1.177 +private:
   1.178 +	/**
   1.179 +	 *	a helper method for logging calls
   1.180 +	 */	
   1.181 +	static void _LOG(const TDesC& aText);
   1.182 +
   1.183 +private: // data
   1.184 +
   1.185 +};
   1.186 +
   1.187 +/** 
   1.188 + * The window part of a gms grid.
   1.189 + */
   1.190 +class CAknGMSPopupGrid : public CAknPopupList
   1.191 +    {
   1.192 +public:
   1.193 +    /**
   1.194 +     * Creates a window for the grid.
   1.195 +     * @param aListBox The grid used.
   1.196 +     * @param aCbaResource The softkeys used.
   1.197 +     * @param aType The layout used
   1.198 +     */
   1.199 +    IMPORT_C static CAknGMSPopupGrid* NewL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType=AknPopupLayouts::EMenuWindow);
   1.200 +public:
   1.201 +    /**
   1.202 +     * Setup the whole window layout; window position, grid and heading position, shadow for the window.
   1.203 +     * @param aLayoutId A choice of layout -- not used by the implementation.
   1.204 +     */
   1.205 +    IMPORT_C void SetupWindowLayout(AknPopupLayouts::TAknPopupLayouts);
   1.206 +    /**
   1.207 +     * Calculate grid window position
   1.208 +     */
   1.209 +    IMPORT_C static void CalcPopupGridLargeGraphicWindow(TAknPopupWindowLayoutDef &aDef, TRect aClientRect, TInt aNumberOfLinesInListBox);
   1.210 +    /**
   1.211 +     * Calculate grid and heading position
   1.212 +     */
   1.213 +    IMPORT_C static void SetupPopupGridLargeGraphicWindow(TAknPopupWindowLayoutDef &aDef, 
   1.214 +				     TInt aNumberOfLinesInListBox, 
   1.215 +				     TBool aHeading);
   1.216 +    /**
   1.217 +     * Setup shadow for the window.
   1.218 +     */
   1.219 +    IMPORT_C static void PopupGridLargeGraphicGraphics(TAknPopupWindowLayoutDef &aDef);
   1.220 +
   1.221 +    /**
   1.222 +     * From CCoeControl.     
   1.223 +     * Handles pointer events
   1.224 +     */
   1.225 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);    
   1.226 +
   1.227 +private:
   1.228 +    /**
   1.229 +    * From CAknControl
   1.230 +    */
   1.231 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.232 +    };
   1.233 +
   1.234 +#endif // __CAknGMSStyleGrid_h