photosgallery/viewframework/views/metadatadialog/inc/glxmetadatadialog.h
changeset 0 4e91876724a2
child 14 ce1c7ad1f18b
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     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 
       
    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                           
       
    49     {
       
    50 public: // Constructors and destructor
       
    51     
       
    52     /**
       
    53 	* Two-phased constructor.
       
    54 	*
       
    55 	* @param aURI uri or file name of item
       
    56 	*/
       
    57     IMPORT_C static CGlxMetadataDialog* NewL( const TDesC& aUri );
       
    58          
       
    59     /**
       
    60     * Destructor.
       
    61     */
       
    62     virtual ~CGlxMetadataDialog();
       
    63     
       
    64 private :
       
    65     CGlxMetadataDialog(const TDesC& aUri);
       
    66 
       
    67 
       
    68 public: // Functions from base classes
       
    69 
       
    70     /**
       
    71     * Initializes the dialog and calls CAknDialog's 
       
    72     *   ExecuteLD()
       
    73     * This method need to be called to execute the dialog.
       
    74     * After exiting the dialog gets automatically destroyed
       
    75     *
       
    76     * @return TInt  ID value of the button that closed the dialog.
       
    77     */
       
    78     IMPORT_C TInt ExecuteLD();
       
    79     
       
    80     /**
       
    81     * From CEikDialog. Handles button events and checks if the dialog 
       
    82     *   can be closed
       
    83     *
       
    84     * @param aKeycode Id of the 'pressed' button
       
    85     *
       
    86     * @return   EFalse if Options menu was pressed 
       
    87     *           ETrue otherwise
       
    88     */
       
    89     TBool OkToExitL( TInt aKeycode );  
       
    90     /*
       
    91      * From MToolbarResetObserver 
       
    92      */
       
    93     void HandleToolbarResetting(TBool aVisible);
       
    94     
       
    95 protected:  // Functions from base classes
       
    96 
       
    97     /**
       
    98     * From MEikCommandObserver Prosesses menucommands
       
    99     *
       
   100     * @param aCommandId     Commant value defined in resources.
       
   101     */
       
   102     void ProcessCommandL( TInt aCommandId );
       
   103 
       
   104     /**
       
   105     * From CCoeControl Handles key events
       
   106     *
       
   107     * @param aKeyEvent      TKeyEvent 
       
   108     * @param aType          TEventCode
       
   109     *
       
   110     * @return TKeyResponse depending on was is consumed or not.
       
   111     */
       
   112     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   113 
       
   114     /**
       
   115     * From MEikMenuObserver Initializes items on the menu
       
   116     *
       
   117     * @param aMenuId    Current menu's resource Id
       
   118     * @param aMenuPane  Pointer to menupane
       
   119     */
       
   120     void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
       
   121 		//hanldes orientation changes.
       
   122     void HandleResourceChange( TInt aType );
       
   123     void SizeChanged();
       
   124 
       
   125 private:        
       
   126 		/**
       
   127 		* Initializes the dialog's controls before the dialog is sized and 
       
   128 		* layed out. Empty by default.
       
   129 		*/
       
   130 		void PreLayoutDynInitL();
       
   131 		
       
   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 		 * Constructs the Alf Environment and display
       
   146 		 */
       
   147 		void ConstructAlfEnvL();
       
   148 		
       
   149 		/**
       
   150 		* Initalise the resource
       
   151 		*
       
   152 		*/
       
   153 		void InitResourceL();   
       
   154 		
       
   155 		/** 
       
   156 		* To deal with any specific commands
       
   157 		*
       
   158 		* @param aCommand The command to respond to
       
   159 		* @return ETrue if the command has been handled.
       
   160 		*
       
   161 		*/
       
   162 		TBool HandleViewCommandL(TInt aCommand);
       
   163 		
       
   164 		/**
       
   165 		* Returns reference to the current media list 
       
   166 		*
       
   167 		*/
       
   168 		MGlxMediaList& MediaList();
       
   169         
       
   170 private:
       
   171 
       
   172 		void Draw( const TRect& /*aRect*/ ) const;    
       
   173 		void HandlePointerEventL(const TPointerEvent& aPointerEvent);   	
       
   174 		/**
       
   175 		* SetTitleL
       
   176 		* Sets title for view
       
   177 		* @param aTitleText title of view to be set
       
   178 		*/
       
   179 		void SetTitleL(const TDesC& aTitleText);    
       
   180 		/**
       
   181 		* SetPreviousTitleL
       
   182 		* Sets title of previous view
       
   183 		*/
       
   184 		void SetPreviousTitleL();
       
   185 			/**
       
   186 		* Find out the items nature to set the corresponding options
       
   187 		*/
       
   188 		void OnLocationEditL();
       
   189 		void AddTagL();
       
   190 		void AddAlbumL();    
       
   191 		void SetDetailsDlgToolbarVisibility(TBool aVisible);
       
   192 		
       
   193 public: // from MEikDialogPageObserver
       
   194     /**
       
   195     * @ref MEikDialogPageObserver::CreateCustomControlL
       
   196     */
       
   197     SEikControlInfo CreateCustomControlL(TInt aControlType);
       
   198 
       
   199 private: //data
       
   200 	
       
   201 		TInt iResourceOffset;
       
   202 		TBool iStatusPaneAvailable;
       
   203 		CGlxMetadataContainer* iContainer;
       
   204 		CGlxMetadataCommandHandler*     iMetadataCmdHandler;//own
       
   205 		CGlxUiUtility* iUiUtility;		
       
   206 		HBufC* iPreviousTitle;    
       
   207 		const TDesC& iUri;
       
   208 		CGlxCommandHandlerAddToContainer*  iAddToTag;
       
   209 		CGlxCommandHandlerAddToContainer*  iAddToAlbum;    
       
   210     };
       
   211 
       
   212 #endif  // GLXMETADATADIALOG_H
       
   213 
       
   214 // End of File