photosgallery/controllers/fetcher/inc/glxfetchercontainer.h
branchRCL_3
changeset 60 5b3385a43d68
child 75 01504893d9cb
equal deleted inserted replaced
59:8e5f6eea9c9f 60:5b3385a43d68
       
     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:    Container class for fetcher plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GLXFETCHERCONTAINER_H_
       
    22 #define GLXFETCHERCONTAINER_H_
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 // Photos Headers
       
    27 #include <mglxmedialistprovider.h>
       
    28 #include <glxmedialistiterator.h>                       // Interface for going through items in
       
    29 #include <glxmedialistfactory.h>                        // MGlxMediaListFactory
       
    30 
       
    31 // Ganes Headers
       
    32 #include <ganes/HgScrollBufferObserverIface.h>          // HG Scrollbuffer interface
       
    33 #include <ganes/HgSelectionObserverIface.h>             // HG Selection Observer interface
       
    34 #include <ganes/HgMarkingObserverIface.h>
       
    35 
       
    36 // User Includes
       
    37 #include "mglxtitleobserver.h"                          // Title observer
       
    38 
       
    39 // FORWARD Declaration
       
    40 class MGlxMediaList;
       
    41 class MGlxEventObserver;
       
    42 class CGlxFetcherCommandHandler;
       
    43 class CGlxGridViewMLObserver;
       
    44 class CGlxThumbnailContext;
       
    45 class CHgGrid;
       
    46 class CGlxUiUtility;
       
    47 class CGlxDRMUtility;
       
    48 /**
       
    49 *  CGlxFetcherContainer
       
    50 * 
       
    51 */
       
    52 class CGlxFetcherContainer : public CCoeControl,
       
    53                              public MGlxTitleObserver,
       
    54                              public MGlxMediaListProvider,
       
    55                              public MHgScrollBufferObserver,
       
    56                              public MHgSelectionObserver,
       
    57                              public MHgMarkingObserver
       
    58     {
       
    59 public:
       
    60 
       
    61     /**
       
    62      * Two-phase constructor NewL
       
    63      *
       
    64      * @param aFilterType the filter item type
       
    65      * @param aTitle the title
       
    66      */
       
    67 	static CGlxFetcherContainer* NewL(
       
    68 	    TGlxFilterItemType aFilterType ,const TDesC& aTitle, 
       
    69 	                MGlxEventObserver& aEventObserver, TBool aMultiSelectionEnabled );
       
    70 
       
    71 	/** Destructor 
       
    72 	 *
       
    73 	 */
       
    74 	~CGlxFetcherContainer();
       
    75 	
       
    76     /** 
       
    77      *  RetrieveUrisL
       
    78      */
       
    79      TBool RetrieveUrisL( CDesCArray& aSelectedFiles,TBool& aFetchUri );
       
    80     
       
    81     /** 
       
    82      *  DoExecuteL
       
    83      */
       
    84      TBool DoExecuteL(TInt aCommandId);
       
    85      
       
    86      /** 
       
    87      *  OfferKeyEventL, from CCoeControl
       
    88      */
       
    89      TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType );	
       
    90 
       
    91      /** 
       
    92      *  CreateAndDisplayGridL
       
    93      */
       
    94      void CreateAndDisplayGridL( ); 
       
    95      
       
    96      /** 
       
    97       *  SetPreviousTitleL
       
    98       *  Sets the status pane title with what it was for the calling application
       
    99       */
       
   100      void SetPreviousTitleL();
       
   101      
       
   102      /** 
       
   103       *  SetFileAttached
       
   104       *  Sets the File attached flag.
       
   105       */
       
   106      void SetFileAttached(TBool aIsFileAttached);
       
   107      
       
   108 public:     
       
   109      /** 
       
   110       *  HandleSizeChange
       
   111       */
       
   112      void HandleSizeChangeL ( );
       
   113      
       
   114      /*
       
   115       * MopSupplyObject
       
   116       * Framework call for the skin updates 
       
   117       */
       
   118      TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   119      
       
   120 public:// From MGlxTitleObserver
       
   121 
       
   122     void UpdateTitleL();	      
       
   123 
       
   124 public:
       
   125     MGlxMediaList& MediaList();
       
   126     
       
   127 protected: // from MHgScrollBufferObserver
       
   128     void Request(TInt aRequestStart, TInt aRequestEnd, THgScrollDirection aDirection);
       
   129     void Release(TInt aReleaseStart, TInt aReleaseEnd);
       
   130 
       
   131 protected: // from MHgMarkingObserver
       
   132     void HandleMarkingL( TInt aIndex, TBool /*aMarked*/ );
       
   133 
       
   134 protected: // from MHgSelectionObserver
       
   135     void HandleSelectL( TInt aIndex );
       
   136     void HandleOpenL( TInt aIndex );
       
   137 
       
   138 private:
       
   139     /** CreateMediaListL
       
   140      *  This function creates the collection path filter and finally the MediaList 
       
   141      */
       
   142     void CreateMediaListL();
       
   143    
       
   144     /** 
       
   145      *  2nd phase Constructor
       
   146      */
       
   147 	void ConstructL();
       
   148 
       
   149     /** 
       
   150      *  Constructor
       
   151      */
       
   152 	CGlxFetcherContainer( TGlxFilterItemType aFilterType, const TDesC& aTitle ,
       
   153 	        MGlxEventObserver& aEventObserver, TBool aMultiSelectionEnabled);
       
   154 	
       
   155     /** 
       
   156      *  SetTitleL
       
   157      */
       
   158     void SetTitleL(const TDesC& aTitleText);
       
   159 
       
   160     /** 
       
   161      *  Create Grid Widget
       
   162      */
       
   163 	void CreateHgGridWidgetL();
       
   164 
       
   165     /** 
       
   166      *  Create The Medialist observer 
       
   167      *  An interface required for the HG Grid data updates with the photos data 
       
   168      *  Taken from GlxGridview
       
   169      */
       
   170 	void CreateGridMediaListObserverL();
       
   171 	
       
   172 	/*
       
   173 	 * HandleMultipleMarkingL
       
   174 	 * To handle multiple marking, if marked then unmark, else vice versa
       
   175 	 */
       
   176 	void HandleMultipleMarkingL(TInt aIndex);
       
   177 	
       
   178     /**
       
   179      * Set the Icons
       
   180      */
       
   181     void SetIconsL(TInt aIndex);
       
   182 	
       
   183     /**
       
   184      * This doesnt add up any value to the code, just to satisfy the compiler
       
   185      */
       
   186     void RequestL(TInt aRequestStart, TInt aRequestEnd);
       
   187     
       
   188 private:
       
   189     MGlxMediaList* iMediaList;				    // MGlxMedialist , to Create MediaList
       
   190     CHgGrid* iHgGrid;                           // HGGrid 
       
   191     CGlxGridViewMLObserver* iGlxGridMLObserver; // Medilaist observer from GlxGridview
       
   192     // Iterator 
       
   193     TGlxFromManualIndexBlockyIterator iBlockyIterator; 
       
   194     CAknsBasicBackgroundControlContext* iBgContext; //Own for background context
       
   195     
       
   196 	TGlxFilterItemType iFilterType;             // Filtertype, Image /Video
       
   197 
       
   198     const TDesC& iTitle;                        // To Store the title 
       
   199     HBufC* iPreviousTitle;                      // Previous Title
       
   200     
       
   201     // CommandHandler to handle marking for multiple fetcher 
       
   202     // (Owned)
       
   203     CGlxFetcherCommandHandler* iFetcherCommandHandler;
       
   204     MGlxEventObserver& iEventObserver;              // Event Observer to pass doubletap event to dialog
       
   205 
       
   206     // Thumbnail context
       
   207     CGlxThumbnailContext* iThumbnailContext;
       
   208     TBool iMultiSelectionEnabled;                   // Flag to notify if multiple fetcher called
       
   209     TBool iMultipleMarkNotStarted;                  // Multiple mark started flag
       
   210     
       
   211     CGlxUiUtility* iUiUtility;
       
   212 
       
   213     // Provides DRM related functionality
       
   214     CGlxDRMUtility* iDRMUtility;
       
   215 
       
   216     // Grid Icon size from FS view
       
   217     TSize iGridIconSize;
       
   218     //Is File Attached
       
   219 	TBool iIsFileAttached;
       
   220     };
       
   221 
       
   222 #endif /*GLXFETCHERCONTAINER_H_*/