|
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: Dialog for selecting smile icon. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCASMILEICONDIALOG_H |
|
20 #define CCASMILEICONDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "mcatapeventobserver.h" |
|
24 #include <AknDialog.h> |
|
25 #include <aknlists.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CGulIcon; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * CCASmileIconDialog |
|
34 * |
|
35 * Dialog for selecting smile icon. |
|
36 */ |
|
37 class CCASmileIconDialog : public CAknDialog, |
|
38 public MCATapEventObserver |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 * @param aIconArray : Reference to smile icon array. |
|
44 * @param aSelectedIconId : For getting selected bitmap number. |
|
45 */ |
|
46 static CCASmileIconDialog* NewL( |
|
47 const RPointerArray<CGulIcon>& aIconArray, |
|
48 TInt& aSelectedIconId ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CCASmileIconDialog(); |
|
54 |
|
55 private: // New functions |
|
56 |
|
57 /** |
|
58 * C++ constructor. |
|
59 */ |
|
60 CCASmileIconDialog( const RPointerArray<CGulIcon>& aIconArray, |
|
61 TInt& aSelectedIconId ); |
|
62 |
|
63 private: // Functions from base classes |
|
64 |
|
65 /** |
|
66 * From CEikDialog : Handle key events. |
|
67 */ |
|
68 TKeyResponse OfferKeyEventL( |
|
69 const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
70 |
|
71 /** |
|
72 * From CEikDialog : Prepare for opening dialog. |
|
73 */ |
|
74 void HandleResourceChange( TInt aType ); |
|
75 |
|
76 /** |
|
77 * From CEikDialog : Handle CBA-keys. |
|
78 */ |
|
79 TBool OkToExitL( TInt aButtonId ); |
|
80 |
|
81 /** |
|
82 * From CEikDialog : Prepare for opening dialog. |
|
83 */ |
|
84 void PreLayoutDynInitL(); |
|
85 |
|
86 /** |
|
87 * From CCoeControl : Control size is set. |
|
88 */ |
|
89 void SetSizeAndPosition( const TSize& aSize ); |
|
90 |
|
91 /** |
|
92 * From CCoeControl : Create custom control. |
|
93 */ |
|
94 SEikControlInfo CreateCustomControlL( TInt aControlType ); |
|
95 |
|
96 /** |
|
97 * From CCoeControl : Event handler |
|
98 */ |
|
99 void HandleDialogPageEventL( TInt aEventID ); |
|
100 |
|
101 /** |
|
102 * Check if dialog is suitable for Smile Icon. |
|
103 * @param aDialogRect Dialog inside which smile are shown. |
|
104 * @param aRect Rectangle for top left smile icon. |
|
105 * @return ViewableArea if all smile can fit in viewable area other wise return 0. |
|
106 */ |
|
107 TInt CheckDialog( TAknLayoutRect aDialogRect, TRect aRect ); |
|
108 |
|
109 private: // From MCATapEventObserver |
|
110 |
|
111 void HandleTapEventL( TTapEvent aEvent, TUint aControlId ); |
|
112 |
|
113 private: // helpers |
|
114 |
|
115 /** |
|
116 * Set dialog layout. |
|
117 */ |
|
118 void SetLayout(); |
|
119 |
|
120 /** |
|
121 * Calculates variety used for popup_grid_graphic_window |
|
122 * according to rows in grid. |
|
123 * @return Variety value. |
|
124 */ |
|
125 TInt CalculatePopupVariety(); |
|
126 |
|
127 |
|
128 private: |
|
129 |
|
130 // Reference to smile icon array. |
|
131 const RPointerArray<CGulIcon>& iIconArray; |
|
132 |
|
133 // Selected icon id reference. |
|
134 TInt& iIconId; |
|
135 |
|
136 // Has user selected a smiley with pen |
|
137 TBool iSmileyPointed; |
|
138 |
|
139 // Whether the layout is mirrored or not. |
|
140 TBool iIsMirrored; |
|
141 }; |
|
142 |
|
143 #endif // CCASMILEICONDIALOG_H |