williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002 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 |
* Contains the View and the Component of the photoalbum picture grid
|
williamr@2
|
16 |
* component.
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*/
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#ifndef __CAknGMSStyleGrid_h
|
williamr@2
|
23 |
#define __CAknGMSStyleGrid_h
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <AknGrid.h>
|
williamr@2
|
26 |
#include <aknpopup.h>
|
williamr@2
|
27 |
#include <aknlists.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
class CGulIcon;
|
williamr@2
|
30 |
|
williamr@2
|
31 |
// ============================================================================
|
williamr@2
|
32 |
// CAknGMSStyleGridView
|
williamr@2
|
33 |
// ============================================================================
|
williamr@2
|
34 |
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
the view for the grid component.
|
williamr@2
|
37 |
*/
|
williamr@2
|
38 |
class CAknGMSStyleGridView : public CAknGridView
|
williamr@2
|
39 |
{
|
williamr@2
|
40 |
public: // from CAknGridView
|
williamr@2
|
41 |
IMPORT_C CAknGMSStyleGridView();
|
williamr@2
|
42 |
public: // from CAknGridView
|
williamr@2
|
43 |
/**
|
williamr@2
|
44 |
draws the hor. and vert. lines.
|
williamr@2
|
45 |
*/
|
williamr@2
|
46 |
IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
|
williamr@2
|
47 |
public: // new methods
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
sets the rectangle for the drawing operations.
|
williamr@2
|
50 |
This method is called when the grid is constructed.
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
IMPORT_C void SetupLayout(const TRect& aRect, TBool aIsPopup = EFalse, TInt aNum = -1);
|
williamr@2
|
53 |
private: // overridden from CListBoxView
|
williamr@2
|
54 |
IMPORT_C virtual TAny* Reserved_1();
|
williamr@2
|
55 |
|
williamr@2
|
56 |
private: // new methods
|
williamr@2
|
57 |
/**
|
williamr@2
|
58 |
Calculate maximum number of horizontal lines
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
TInt MaxNumOfHorLines() const;
|
williamr@2
|
61 |
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
Calculate maximum number of vertical lines
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
TInt MaxNumOfVerLines() const;
|
williamr@2
|
66 |
|
williamr@2
|
67 |
private: // data
|
williamr@2
|
68 |
TAknLayoutRect iHorLine[5];
|
williamr@2
|
69 |
TAknLayoutRect iVerLine[3];
|
williamr@2
|
70 |
const TRect* iRect;
|
williamr@2
|
71 |
};
|
williamr@2
|
72 |
|
williamr@2
|
73 |
|
williamr@2
|
74 |
// ============================================================================
|
williamr@2
|
75 |
// CAknGMSStyleGrid
|
williamr@2
|
76 |
// ============================================================================
|
williamr@2
|
77 |
/**
|
williamr@2
|
78 |
implements the grid for the PhotoAlbum
|
williamr@2
|
79 |
A markable grid_large_graphic_pane, with 2 columns. The cell displays
|
williamr@2
|
80 |
80x32 bitmaps.
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
|
williamr@2
|
83 |
class CAknGMSStyleGrid : public CAknSelectionGridTypedef
|
williamr@2
|
84 |
{
|
williamr@2
|
85 |
public:
|
williamr@2
|
86 |
/**
|
williamr@2
|
87 |
* Creates a gms grid
|
williamr@2
|
88 |
* @param aParent A parent used to find a window for the grid.
|
williamr@2
|
89 |
* @param aIsPopup Whether a popup layout or main pane layout is used
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C static CAknGMSStyleGrid* NewL(const CCoeControl* aParent, TBool aIsPopup = EFalse);
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
do not use this, use NewL
|
williamr@2
|
94 |
aIsPopup = EFalse is default.
|
williamr@2
|
95 |
*/
|
williamr@2
|
96 |
IMPORT_C CAknGMSStyleGrid();
|
williamr@2
|
97 |
/**
|
williamr@2
|
98 |
* @param aIsPopup Whether a popup layout is used or not
|
williamr@2
|
99 |
*/
|
williamr@2
|
100 |
IMPORT_C CAknGMSStyleGrid(TBool aIsPopup);
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* 2nd phase of construction.
|
williamr@2
|
103 |
* @param aParent the parent compound control
|
williamr@2
|
104 |
* @param aRows desired rows of grid
|
williamr@2
|
105 |
* @param aCols desired cols of grid
|
williamr@2
|
106 |
*/
|
williamr@2
|
107 |
IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aRows=4, TInt aCols=2);
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
the destructor
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
IMPORT_C ~CAknGMSStyleGrid();
|
williamr@2
|
113 |
|
williamr@2
|
114 |
/**
|
williamr@2
|
115 |
* Sets the layout of the grid view
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
IMPORT_C void SetupLayout();
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
* From CCoeControl.
|
williamr@2
|
121 |
* Handles pointer events
|
williamr@2
|
122 |
*/
|
williamr@2
|
123 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
124 |
|
williamr@2
|
125 |
public: // from CAknGrid
|
williamr@2
|
126 |
/**
|
williamr@2
|
127 |
* layouts and repaints the grid
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
IMPORT_C void SizeChanged();
|
williamr@2
|
130 |
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
* Decides size of the grid for dialogs.
|
williamr@2
|
133 |
*/
|
williamr@2
|
134 |
IMPORT_C TSize MinimumSize();
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* Offers key events to parent class.
|
williamr@2
|
138 |
* @param aKeyEvent kind of key event
|
williamr@2
|
139 |
* @param aType key typed
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Defines a grid cell size
|
williamr@2
|
145 |
* @return size of a grid cell
|
williamr@2
|
146 |
*/
|
williamr@2
|
147 |
static TSize KCELL_SIZE();
|
williamr@2
|
148 |
|
williamr@2
|
149 |
/**
|
williamr@2
|
150 |
* Redraw the grid.
|
williamr@2
|
151 |
* @param aRect the rectangle to draw.
|
williamr@2
|
152 |
*/
|
williamr@2
|
153 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
154 |
|
williamr@2
|
155 |
/**
|
williamr@2
|
156 |
* Overriden from CAknGrid. Create the grid view for thus grid class.
|
williamr@2
|
157 |
* @ return the grid view
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
IMPORT_C CListBoxView* MakeViewClassInstanceL();
|
williamr@2
|
160 |
|
williamr@2
|
161 |
protected:
|
williamr@2
|
162 |
/**
|
williamr@2
|
163 |
* Are we a popup window or main pane window, ETrue = popup window.
|
williamr@2
|
164 |
*/
|
williamr@2
|
165 |
TBool iIsPopup;
|
williamr@2
|
166 |
|
williamr@2
|
167 |
private:
|
williamr@2
|
168 |
/**
|
williamr@2
|
169 |
* From CAknControl
|
williamr@2
|
170 |
*/
|
williamr@2
|
171 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
172 |
|
williamr@2
|
173 |
private:
|
williamr@2
|
174 |
/**
|
williamr@2
|
175 |
* a helper method for logging calls
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
static void _LOG(const TDesC& aText);
|
williamr@2
|
178 |
|
williamr@2
|
179 |
private: // data
|
williamr@2
|
180 |
|
williamr@2
|
181 |
};
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* The window part of a gms grid.
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
class CAknGMSPopupGrid : public CAknPopupList
|
williamr@2
|
187 |
{
|
williamr@2
|
188 |
public:
|
williamr@2
|
189 |
/**
|
williamr@2
|
190 |
* Creates a window for the grid.
|
williamr@2
|
191 |
* @param aListBox The grid used.
|
williamr@2
|
192 |
* @param aCbaResource The softkeys used.
|
williamr@2
|
193 |
* @param aType The layout used
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
IMPORT_C static CAknGMSPopupGrid* NewL(CEikListBox* aListBox, TInt aCbaResource, AknPopupLayouts::TAknPopupLayouts aType=AknPopupLayouts::EMenuWindow);
|
williamr@2
|
196 |
public:
|
williamr@2
|
197 |
/**
|
williamr@2
|
198 |
* Setup the whole window layout; window position, grid and heading position, shadow for the window.
|
williamr@2
|
199 |
* @param aLayoutId A choice of layout -- not used by the implementation.
|
williamr@2
|
200 |
*/
|
williamr@2
|
201 |
IMPORT_C void SetupWindowLayout(AknPopupLayouts::TAknPopupLayouts);
|
williamr@2
|
202 |
/**
|
williamr@2
|
203 |
* Calculate grid window position
|
williamr@2
|
204 |
*/
|
williamr@2
|
205 |
IMPORT_C static void CalcPopupGridLargeGraphicWindow(TAknPopupWindowLayoutDef &aDef, TRect aClientRect, TInt aNumberOfLinesInListBox);
|
williamr@2
|
206 |
/**
|
williamr@2
|
207 |
* Calculate grid and heading position
|
williamr@2
|
208 |
*/
|
williamr@2
|
209 |
IMPORT_C static void SetupPopupGridLargeGraphicWindow(TAknPopupWindowLayoutDef &aDef,
|
williamr@2
|
210 |
TInt aNumberOfLinesInListBox,
|
williamr@2
|
211 |
TBool aHeading);
|
williamr@2
|
212 |
/**
|
williamr@2
|
213 |
* Setup shadow for the window.
|
williamr@2
|
214 |
*/
|
williamr@2
|
215 |
IMPORT_C static void PopupGridLargeGraphicGraphics(TAknPopupWindowLayoutDef &aDef);
|
williamr@2
|
216 |
|
williamr@2
|
217 |
/**
|
williamr@2
|
218 |
* From CCoeControl.
|
williamr@2
|
219 |
* Handles pointer events
|
williamr@2
|
220 |
*/
|
williamr@2
|
221 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
222 |
|
williamr@2
|
223 |
private:
|
williamr@2
|
224 |
/**
|
williamr@2
|
225 |
* From CAknControl
|
williamr@2
|
226 |
*/
|
williamr@2
|
227 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
228 |
};
|
williamr@2
|
229 |
|
williamr@2
|
230 |
#endif // __CAknGMSStyleGrid_h
|