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);
|
|
130 |
|
|
131 |
private:
|
|
132 |
/**
|
|
133 |
* Initializes the dialog's controls after the dialog has been sized
|
|
134 |
* but before it has been activated.
|
|
135 |
*/
|
|
136 |
void PostLayoutDynInitL();
|
|
137 |
/**
|
|
138 |
* Symbian 2nd phase constructor.
|
|
139 |
*
|
|
140 |
* @param aURI
|
|
141 |
*/
|
|
142 |
void ConstructL();
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Initalise the resource
|
|
146 |
*
|
|
147 |
*/
|
|
148 |
void InitResourceL();
|
|
149 |
|
|
150 |
/**
|
|
151 |
* To deal with any specific commands
|
|
152 |
*
|
|
153 |
* @param aCommand The command to respond to
|
|
154 |
* @return ETrue if the command has been handled.
|
|
155 |
*
|
|
156 |
*/
|
|
157 |
TBool HandleViewCommandL(TInt aCommand);
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Returns reference to the current media list
|
|
161 |
*
|
|
162 |
*/
|
|
163 |
MGlxMediaList& MediaList();
|
|
164 |
|
|
165 |
private:
|
|
166 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
167 |
/**
|
|
168 |
* SetTitleL
|
|
169 |
* Sets title for view
|
|
170 |
* @param aTitleText title of view to be set
|
|
171 |
*/
|
|
172 |
void SetTitleL(const TDesC& aTitleText);
|
|
173 |
/**
|
|
174 |
* SetPreviousTitleL
|
|
175 |
* Sets title of previous view
|
|
176 |
*/
|
|
177 |
void SetPreviousTitleL();
|
|
178 |
|
|
179 |
/**
|
|
180 |
* Sets the dialog toolbar visibility
|
|
181 |
* @param aVisible - ETrue for visible; EFalse otherwise.
|
|
182 |
*/
|
|
183 |
void SetDetailsDlgToolbarVisibility(TBool aVisible);
|
|
184 |
|
|
185 |
public:
|
|
186 |
// from MGlxMetadataDialogObserver
|
|
187 |
/**
|
|
188 |
* Find out the items nature to set the corresponding options
|
|
189 |
*/
|
|
190 |
void OnLocationEditL();
|
|
191 |
void AddTagL();
|
|
192 |
void AddAlbumL();
|
|
193 |
void HandleItemRemovedL();
|
|
194 |
|
|
195 |
public: // from MEikDialogPageObserver
|
|
196 |
/**
|
|
197 |
* @ref MEikDialogPageObserver::CreateCustomControlL
|
|
198 |
*/
|
|
199 |
SEikControlInfo CreateCustomControlL(TInt aControlType);
|
|
200 |
|
|
201 |
private: //data
|
|
202 |
|
|
203 |
TInt iResourceOffset;
|
|
204 |
TBool iStatusPaneAvailable;
|
|
205 |
CGlxMetadataContainer* iContainer;
|
|
206 |
CGlxMetadataCommandHandler* iMetadataCmdHandler;//own
|
|
207 |
CGlxUiUtility* iUiUtility;
|
|
208 |
HBufC* iPreviousTitle;
|
|
209 |
const TDesC& iUri;
|
|
210 |
CGlxCommandHandlerAddToContainer* iAddToTag;
|
|
211 |
CGlxCommandHandlerAddToContainer* iAddToAlbum;
|
|
212 |
/*
|
|
213 |
* Store previous pointer event point
|
|
214 |
*/
|
|
215 |
TPoint iPrev;
|
|
216 |
|
|
217 |
/*
|
|
218 |
* Check if the dragging got beyond kinetic drag threshold & screen
|
|
219 |
* movement will start, if set to true
|
|
220 |
*/
|
|
221 |
TBool iViewDragged;
|
|
222 |
|
|
223 |
/*
|
|
224 |
* Store the value of kinetic drag threshold
|
|
225 |
*/
|
|
226 |
TInt iKineticDragThreshold;
|
|
227 |
};
|
|
228 |
|
|
229 |
#endif // GLXMETADATADIALOG_H
|
|
230 |
|
|
231 |
// End of File
|