63
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 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: Phonebook 2 application view base.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CPBK2APPVIEWBASE_H
|
|
20 |
#define CPBK2APPVIEWBASE_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <aknview.h>
|
|
24 |
#include <MPbk2KeyEventHandler.h>
|
|
25 |
#include <MPbk2PointerEventHandler.h>
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class CPbk2ViewState;
|
|
29 |
class CEikMenuBar;
|
|
30 |
class CAknStylusPopUpMenu;
|
|
31 |
|
|
32 |
// CLASS DECLARATION
|
|
33 |
|
|
34 |
/**
|
|
35 |
* Phonebook 2 application view base.
|
|
36 |
* Provides some common application view functionality.
|
|
37 |
* All Phonebook 2's application views have to be
|
|
38 |
* derived from this class because CPbk2AppUi assumes it.
|
|
39 |
*/
|
|
40 |
class CPbk2AppViewBase : public CAknView,
|
|
41 |
public MPbk2KeyEventHandler,
|
|
42 |
public MPbk2PointerEventHandler
|
|
43 |
{
|
|
44 |
public: // Constructors and destructor
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Constructor.
|
|
48 |
*/
|
|
49 |
IMPORT_C CPbk2AppViewBase();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Destructor.
|
|
53 |
*/
|
|
54 |
IMPORT_C ~CPbk2AppViewBase();
|
|
55 |
|
|
56 |
public: // Interface
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Returns Phonebook 2's application uid.
|
|
60 |
*
|
|
61 |
* @return Application uid.
|
|
62 |
*/
|
|
63 |
IMPORT_C TUid ApplicationUid() const;
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Creates and returns an object containing this view's current state,
|
|
67 |
* which is used in view switching.
|
|
68 |
*
|
|
69 |
* @return This view's current state. The returned object is
|
|
70 |
* left on the cleanup stack.
|
|
71 |
*/
|
|
72 |
IMPORT_C virtual CPbk2ViewState* ViewStateLC() const;
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Creates a pop up menubar of aResourceId.
|
|
76 |
* Runs DoLaunchPopupL inside a TRAP.
|
|
77 |
*
|
|
78 |
* @param aResourceId Resource id of the popup.
|
|
79 |
*/
|
|
80 |
IMPORT_C void LaunchPopupMenuL(
|
|
81 |
TInt aResourceId );
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Returns the menu filtering flags for the view.
|
|
85 |
*
|
|
86 |
* @see Pbk2MenuFilteringFlags.hrh for possible flags.
|
|
87 |
* @return The menu filtering flags for the view.
|
|
88 |
*/
|
|
89 |
IMPORT_C TInt GetMenuFilteringFlagsL() const;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Creates a given stylus pop up menu at the given
|
|
93 |
* screen coordinates.
|
|
94 |
*
|
|
95 |
* @param aResourceId Resource id of the popup.
|
|
96 |
* @param aPoint The position where stylus was tapped.
|
|
97 |
*/
|
|
98 |
IMPORT_C void LaunchStylusPopupMenuL(
|
|
99 |
TInt aResourceId,
|
|
100 |
const TPoint& aPoint );
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Creates a given stylus pop up menu at the given
|
|
104 |
* screen coordinates. The only difference with LaunchStylusPopupMenuL
|
|
105 |
* is in return value.
|
|
106 |
*
|
|
107 |
* @param aResourceId Resource id of the popup.
|
|
108 |
* @param aPoint The position where stylus was tapped.
|
|
109 |
*
|
|
110 |
* @return Reference to a launched popup menu, can be used for menu dimming
|
|
111 |
*/
|
|
112 |
IMPORT_C CAknStylusPopUpMenu& LaunchStylusPopupMenu2L(
|
|
113 |
TInt aResourceId,
|
|
114 |
const TPoint& aPoint );
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Closes PopupMenu
|
|
118 |
*
|
|
119 |
*/
|
|
120 |
IMPORT_C void ClosePopup();
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
protected: // Interface for derived classes
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Handles command keys application-side.
|
|
128 |
*
|
|
129 |
* @see CCoeControl::OfferKeyEventL
|
|
130 |
* @param aKeyEvent Key event as in CCoeControl::OfferKeyEventL.
|
|
131 |
* @param aType Key event type as in CCoeControl::OfferKeyEventL.
|
|
132 |
* @return ETrue if the key event was consumed, EFalse otherwise.
|
|
133 |
*/
|
|
134 |
IMPORT_C virtual TBool HandleCommandKeyL(
|
|
135 |
const TKeyEvent& aKeyEvent,
|
|
136 |
TEventCode aType );
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Handles pointer events application-side.
|
|
140 |
*
|
|
141 |
* @param aPointerEvent Pointer event.
|
|
142 |
*/
|
|
143 |
IMPORT_C virtual void HandlePointerEventL(
|
|
144 |
const TPointerEvent& aPointerEvent );
|
|
145 |
|
|
146 |
/**
|
|
147 |
* Handles long tap pointer events.
|
|
148 |
*
|
|
149 |
* @param aPenEventLocation Long tap event location relative
|
|
150 |
* to parent control.
|
|
151 |
* @param aPenEventScreenLocation Long tap event location relative
|
|
152 |
* to screen.
|
|
153 |
* @see MAknLongTapDetectorCallBack
|
|
154 |
*/
|
|
155 |
IMPORT_C virtual void HandleLongTapEventL(
|
|
156 |
const TPoint& aPenEventLocation,
|
|
157 |
const TPoint& aPenEventScreenLocation );
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Gets view specific menu filtering flags.
|
|
161 |
*
|
|
162 |
* @return View specific menu filtering flags.
|
|
163 |
*/
|
|
164 |
virtual TInt GetViewSpecificMenuFilteringFlagsL() const = 0;
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Returns an extension point for this interface or NULL.
|
|
168 |
*
|
|
169 |
* @param aExtensionUid Extension UID.
|
|
170 |
* @return Extension point.
|
|
171 |
*/
|
|
172 |
virtual TAny* AppViewBaseExtension(
|
|
173 |
TUid /*aExtensionUid*/ )
|
|
174 |
{
|
|
175 |
return NULL;
|
|
176 |
}
|
|
177 |
|
|
178 |
private: // From CAknView
|
|
179 |
IMPORT_C void ProcessCommandL(
|
|
180 |
TInt aCommand );
|
|
181 |
|
|
182 |
private: // From MPbk2KeyEventHandler
|
|
183 |
IMPORT_C TBool Pbk2ProcessKeyEventL(
|
|
184 |
const TKeyEvent& aKeyEvent,
|
|
185 |
TEventCode aType );
|
|
186 |
|
|
187 |
private: // From MPbk2PointerEventHandler
|
|
188 |
IMPORT_C void Pbk2ProcessPointerEventL(
|
|
189 |
const TPointerEvent& aPointerEvent );
|
|
190 |
IMPORT_C void Pbk2HandleLongTapEventL(
|
|
191 |
const TPoint& aPenEventLocation,
|
|
192 |
const TPoint& aPenEventScreenLocation );
|
|
193 |
|
|
194 |
private: // Implementation
|
|
195 |
void DoLaunchPopupL(
|
|
196 |
TInt aResourceId );
|
|
197 |
void DoLaunchStylusPopupL(
|
|
198 |
TInt aResourceId,
|
|
199 |
const TPoint& aPoint );
|
|
200 |
void CloseStylusPopup();
|
|
201 |
void CreatePopupMenuL( TInt aResourceId );
|
|
202 |
|
|
203 |
private: // Data
|
|
204 |
/// Own: Popup menu
|
|
205 |
CEikMenuBar* iPopup;
|
|
206 |
/// Own: Stylus popup menu
|
|
207 |
CAknStylusPopUpMenu* iStylusPopup;
|
|
208 |
};
|
|
209 |
|
|
210 |
#endif // CPBK2APPVIEWBASE_H
|
|
211 |
|
|
212 |
// End of File
|