author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:32:09 +0300 | |
branch | RCL_3 |
changeset 75 | 01504893d9cb |
parent 60 | 5b3385a43d68 |
permissions | -rw-r--r-- |
60 | 1 |
/* |
2 |
* Copyright (c) 2008-2009 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: Metadata dialog implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef GLXMETADATADIALOG_H |
|
20 |
#define GLXMETADATADIALOG_H |
|
21 |
||
22 |
// SYSTEM INCLUDES |
|
23 |
#include <AknDialog.h> |
|
24 |
||
25 |
#include <alf/alfscreenbuffer.h> |
|
26 |
||
27 |
#include "glxmetadatacontainer.h" |
|
28 |
#include "mglxmedialistprovider.h" |
|
29 |
#include "mglxmedialistobserver.h" |
|
30 |
#include <mglxmetadatadialogobserver.h> |
|
31 |
#include "glxmedia.h" |
|
32 |
#include <aknphysicsobserveriface.h> //Physics - Kinetic scrolling listener |
|
33 |
||
34 |
// FORWARD DECLARATIONS |
|
35 |
class CGlxMetadataCommandHandler;class CGlxCommandHandlerAddToContainer; |
|
36 |
class CGlxUiUtility; |
|
37 |
||
38 |
// CLASS DECLARATION |
|
39 |
/** |
|
40 |
* CGlxMetadataDialog |
|
41 |
* |
|
42 |
* Metadata dialog implementation |
|
43 |
*/ |
|
44 |
class CGlxMetadataDialog : public CAknDialog, |
|
45 |
public MGlxMediaListProvider, |
|
46 |
public MGlxMetadataDialogObserver, |
|
47 |
public MToolbarResetObserver, |
|
48 |
public MAknPhysicsObserver |
|
49 |
||
50 |
{ |
|
51 |
public: // Constructors and destructor |
|
52 |
||
53 |
/** |
|
54 |
* Two-phased constructor. |
|
55 |
* |
|
56 |
* @param aURI uri or file name of item |
|
57 |
*/ |
|
58 |
IMPORT_C static CGlxMetadataDialog* NewL( const TDesC& aUri ); |
|
59 |
||
60 |
/** |
|
61 |
* Destructor. |
|
62 |
*/ |
|
63 |
virtual ~CGlxMetadataDialog(); |
|
64 |
||
65 |
private : |
|
66 |
CGlxMetadataDialog(const TDesC& aUri); |
|
67 |
||
68 |
||
69 |
public: // Functions from base classes |
|
70 |
||
71 |
/** |
|
72 |
* Initializes the dialog and calls CAknDialog's |
|
73 |
* ExecuteLD() |
|
74 |
* This method need to be called to execute the dialog. |
|
75 |
* After exiting the dialog gets automatically destroyed |
|
76 |
* |
|
77 |
* @return TInt ID value of the button that closed the dialog. |
|
78 |
*/ |
|
79 |
IMPORT_C TInt ExecuteLD(); |
|
80 |
||
81 |
/** |
|
82 |
* From CEikDialog. Handles button events and checks if the dialog |
|
83 |
* can be closed |
|
84 |
* |
|
85 |
* @param aKeycode Id of the 'pressed' button |
|
86 |
* |
|
87 |
* @return EFalse if Options menu was pressed |
|
88 |
* ETrue otherwise |
|
89 |
*/ |
|
90 |
TBool OkToExitL( TInt aKeycode ); |
|
91 |
/* |
|
92 |
* From MToolbarResetObserver |
|
93 |
*/ |
|
94 |
void HandleToolbarResetting(TBool aVisible); |
|
95 |
||
96 |
protected: // from MAknPhysicsObserver |
|
97 |
||
98 |
void ViewPositionChanged( const TPoint& /*aNewPosition*/, TBool /*aDrawNow*/, TUint /*aFlags*/ ); |
|
99 |
||
100 |
void PhysicEmulationEnded(); |
|
101 |
||
102 |
TPoint ViewPosition() const; |
|
103 |
||
104 |
protected: // Functions from base classes |
|
105 |
||
106 |
/** |
|
107 |
* From MEikCommandObserver Prosesses menucommands |
|
108 |
* |
|
109 |
* @param aCommandId Commant value defined in resources. |
|
110 |
*/ |
|
111 |
void ProcessCommandL( TInt aCommandId ); |
|
112 |
||
113 |
/** |
|
114 |
* From CCoeControl Handles key events |
|
115 |
* |
|
116 |
* @param aKeyEvent TKeyEvent |
|
117 |
* @param aType TEventCode |
|
118 |
* |
|
119 |
* @return TKeyResponse depending on was is consumed or not. |
|
120 |
*/ |
|
121 |
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
122 |
||
123 |
/** |
|
124 |
* From MEikMenuObserver Initializes items on the menu |
|
125 |
* |
|
126 |
* @param aMenuId Current menu's resource Id |
|
127 |
* @param aMenuPane Pointer to menupane |
|
128 |
*/ |
|
129 |
void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane); |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
130 |
//hanldes orientation changes. |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
131 |
void HandleResourceChange( TInt aType ); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
132 |
void SizeChanged(); |
60 | 133 |
|
134 |
private: |
|
135 |
/** |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
136 |
* Initializes the dialog's controls before the dialog is sized and |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
137 |
* layed out. Empty by default. |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
138 |
*/ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
139 |
void PreLayoutDynInitL(); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
140 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
141 |
/** |
60 | 142 |
* Initializes the dialog's controls after the dialog has been sized |
143 |
* but before it has been activated. |
|
144 |
*/ |
|
145 |
void PostLayoutDynInitL(); |
|
146 |
/** |
|
147 |
* Symbian 2nd phase constructor. |
|
148 |
* |
|
149 |
* @param aURI |
|
150 |
*/ |
|
151 |
void ConstructL(); |
|
152 |
||
153 |
/** |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
154 |
* Constructs the Alf Environment and display |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
155 |
*/ |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
156 |
void ConstructAlfEnvL(); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
157 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
158 |
/** |
60 | 159 |
* Initalise the resource |
160 |
* |
|
161 |
*/ |
|
162 |
void InitResourceL(); |
|
163 |
||
164 |
/** |
|
165 |
* To deal with any specific commands |
|
166 |
* |
|
167 |
* @param aCommand The command to respond to |
|
168 |
* @return ETrue if the command has been handled. |
|
169 |
* |
|
170 |
*/ |
|
171 |
TBool HandleViewCommandL(TInt aCommand); |
|
172 |
||
173 |
/** |
|
174 |
* Returns reference to the current media list |
|
175 |
* |
|
176 |
*/ |
|
177 |
MGlxMediaList& MediaList(); |
|
178 |
||
179 |
private: |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
180 |
|
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
181 |
void Draw( const TRect& /*aRect*/ ) const; |
60 | 182 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
183 |
/** |
|
184 |
* SetTitleL |
|
185 |
* Sets title for view |
|
186 |
* @param aTitleText title of view to be set |
|
187 |
*/ |
|
188 |
void SetTitleL(const TDesC& aTitleText); |
|
189 |
/** |
|
190 |
* SetPreviousTitleL |
|
191 |
* Sets title of previous view |
|
192 |
*/ |
|
193 |
void SetPreviousTitleL(); |
|
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
194 |
/** |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
195 |
* Find out the items nature to set the corresponding options |
60 | 196 |
*/ |
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
197 |
void OnLocationEditL(); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
198 |
void AddTagL(); |
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
199 |
void AddAlbumL(); |
60 | 200 |
void SetDetailsDlgToolbarVisibility(TBool aVisible); |
75
01504893d9cb
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
201 |
|
60 | 202 |
public: // from MEikDialogPageObserver |
203 |
/** |
|
204 |
* @ref MEikDialogPageObserver::CreateCustomControlL |
|
205 |
*/ |
|
206 |
SEikControlInfo CreateCustomControlL(TInt aControlType); |
|
207 |
||
208 |
private: //data |
|
209 |
||
210 |
TInt iResourceOffset; |
|
211 |
TBool iStatusPaneAvailable; |
|
212 |
CGlxMetadataContainer* iContainer; |
|
213 |
CGlxMetadataCommandHandler* iMetadataCmdHandler;//own |
|
214 |
CGlxUiUtility* iUiUtility; |
|
215 |
HBufC* iPreviousTitle; |
|
216 |
const TDesC& iUri; |
|
217 |
CGlxCommandHandlerAddToContainer* iAddToTag; |
|
218 |
CGlxCommandHandlerAddToContainer* iAddToAlbum; |
|
219 |
/* |
|
220 |
* Store previous pointer event point |
|
221 |
*/ |
|
222 |
TPoint iPrev; |
|
223 |
||
224 |
/* |
|
225 |
* Check if the dragging got beyond kinetic drag threshold & screen |
|
226 |
* movement will start, if set to true |
|
227 |
*/ |
|
228 |
TBool iViewDragged; |
|
229 |
||
230 |
/* |
|
231 |
* Store the value of kinetic drag threshold |
|
232 |
*/ |
|
233 |
TInt iKineticDragThreshold; |
|
234 |
}; |
|
235 |
||
236 |
#endif // GLXMETADATADIALOG_H |
|
237 |
||
238 |
// End of File |