|
1 /* |
|
2 * Copyright (c) 2005-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: header file of pop up window |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CFEPLAYOUTPOPUPWND_H |
|
19 #define C_CFEPLAYOUTPOPUPWND_H |
|
20 |
|
21 #include <peninputlayoutctrlgroup.h> |
|
22 /** |
|
23 * CButtonBase |
|
24 * |
|
25 * Button base control. This class could be used directly by user. |
|
26 * |
|
27 * @lib feplayoutcontrol.lib |
|
28 * @since S60 V4.0 |
|
29 */ |
|
30 class CFepLayoutPopupWnd : public CControlGroup |
|
31 { |
|
32 public: |
|
33 enum TDisplayPosition |
|
34 { |
|
35 EDispAutomatic, |
|
36 EDispBottomRight, |
|
37 EDispBottomLeft, |
|
38 EDispTopLeft, |
|
39 EDispTopRight |
|
40 }; |
|
41 //constructor and destructor |
|
42 /** |
|
43 * Destructor. |
|
44 * |
|
45 * @since S60 V4.0 |
|
46 */ |
|
47 IMPORT_C virtual ~CFepLayoutPopupWnd(); |
|
48 |
|
49 /** |
|
50 * Show pop up window |
|
51 * |
|
52 * @since S60 V4.0 |
|
53 * @param aOffset Offset of the pop up window top left position to |
|
54 * the top left of layout |
|
55 */ |
|
56 IMPORT_C void Display(const TPoint& aOffset); |
|
57 /** |
|
58 * Show pop up window |
|
59 * |
|
60 * @since S60 V4.0 |
|
61 * @param aOffsetRect The rect of the pop up window launch |
|
62 */ |
|
63 IMPORT_C void Display( const TRect& aOffsetRect ); |
|
64 |
|
65 /** |
|
66 * Show pop up window |
|
67 * |
|
68 * @since S60 V4.0 |
|
69 * @param aOffsetRect The rect of the pop up window launch |
|
70 */ |
|
71 IMPORT_C void Display( const TRect& aOffsetRect, TDisplayPosition aDisPostion ); |
|
72 |
|
73 /** |
|
74 * Show pop up window |
|
75 * |
|
76 * @since S60 V4.0 |
|
77 */ |
|
78 IMPORT_C void CloseWindow(); |
|
79 |
|
80 //from base control CFepUiBaseCtrl |
|
81 /** |
|
82 * From CFepUiBaseCtrl |
|
83 * Set control's rectangle |
|
84 * |
|
85 * @since S60 V4.0 |
|
86 * @param aRect The new control area |
|
87 */ |
|
88 IMPORT_C virtual void SetRect(const TRect& aRect); |
|
89 |
|
90 /** |
|
91 * From CFepUiBaseCtrl |
|
92 * DeActivate popup window |
|
93 * |
|
94 * @since S60 V4.0 |
|
95 */ |
|
96 IMPORT_C virtual void OnDeActivate(); |
|
97 |
|
98 IMPORT_C void ReDrawRect(const TRect& aRect); |
|
99 protected: |
|
100 |
|
101 /** |
|
102 * constructor. |
|
103 * |
|
104 * @since S60 V4.0 |
|
105 * @param aSize The control size |
|
106 * @param aUiLayout Ui layout who contains this control.Ownership not transferred |
|
107 * @param aControlId control Id |
|
108 * @return An instance of CButtonBase class |
|
109 */ |
|
110 IMPORT_C CFepLayoutPopupWnd(const TSize& aSize,CFepUiLayout* aUiLayout, |
|
111 TInt aControlId); |
|
112 |
|
113 /** |
|
114 * 2nd phase constructor. |
|
115 * |
|
116 * @since S60 V4.0 |
|
117 */ |
|
118 IMPORT_C void ConstructL(); |
|
119 |
|
120 |
|
121 TDisplayPosition DeterminePosition(const TRect& aSrcRect); |
|
122 IMPORT_C virtual void AfterDisplayed(); |
|
123 private: |
|
124 |
|
125 /** |
|
126 * Do preparation for pop up window before displaying. |
|
127 * E.g, calc and set the rect |
|
128 * It's called internally before displaying. |
|
129 * |
|
130 * @since S60 V4.0 |
|
131 */ |
|
132 IMPORT_C virtual void OnDisplay(); |
|
133 private: |
|
134 /* |
|
135 * Flag tells whether the pop up window is shown |
|
136 */ |
|
137 TBool iIsShowing; |
|
138 |
|
139 /* |
|
140 * Layout rect before pop up window displaying |
|
141 */ |
|
142 TRect iPrevLayoutRect; |
|
143 |
|
144 /* |
|
145 * Old sprite position |
|
146 */ |
|
147 TPoint iPrevLayoutPos; |
|
148 |
|
149 /* |
|
150 * Layout move offset |
|
151 */ |
|
152 TPoint iLayoutMoveOff; |
|
153 |
|
154 |
|
155 /* |
|
156 * The control which captures the pointer before |
|
157 */ |
|
158 CFepUiBaseCtrl* iPreCaptureCtrl; |
|
159 /** |
|
160 * Reserved item1 |
|
161 */ |
|
162 TInt iReserved1; |
|
163 |
|
164 /** |
|
165 * Reserved item2 |
|
166 */ |
|
167 TInt iReserved2; |
|
168 }; |
|
169 |
|
170 #endif //C_CFEPLAYOUTPOPUPWND_H |