photosgallery/contentharvesterplugin/inc/glxcontentharvesterpluginalbums.h
changeset 0 4e91876724a2
child 1 9ba538e329bd
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:    Publish the albums collection content in the photosuite
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef GLXCONTENTHARVESTERPLUGINALBUMS_H
       
    19 #define GLXCONTENTHARVESTERPLUGINALBUMS_H 
       
    20 
       
    21 // INCLUDES
       
    22 #include <liwcommon.h>
       
    23 
       
    24 #include <glxmediaid.h>             // for TGlxMediaId
       
    25 #include <mglxmedialistobserver.h>  // for MGlxMediaListObserver
       
    26 #include <glxmedialistiterator.h>   // for TGlxSequentialIterator
       
    27 
       
    28 #include <contentharvesterplugin.h>
       
    29 #include <contentharvesterpluginuids.hrh>
       
    30 #include "glxcontentharvesterplugin.h"
       
    31 #include "glxcontentharvesterpluginbase.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class MGlxMediaList;
       
    35 class CLiwGenericParamList;
       
    36 class CLiwServiceHandler;
       
    37 class CPeriodic;
       
    38 class MLiwInterface;
       
    39 class CGlxAttributeContext;
       
    40 class CGlxThumbnailContext;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 /**
       
    44  *  CP  Content Harvester plugin
       
    45  *
       
    46  */
       
    47 
       
    48 class CGlxContentHarvesterPluginAlbums : public CGlxContentHarvesterPluginBase,
       
    49 public MGlxMediaListObserver, public MLiwNotifyCallback
       
    50     {
       
    51 public: // Constructors and destructor
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      */
       
    55     static CGlxContentHarvesterPluginAlbums* NewLC( MLiwInterface* aCPSInterface,
       
    56                                                     MGlxContentHarvesterPlugin* aCHplugin );
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     virtual ~CGlxContentHarvesterPluginAlbums();
       
    62 
       
    63     // from base class 
       
    64 
       
    65     /**
       
    66      * Here the preview Thumbnails are updated 
       
    67      */
       
    68     void UpdateDataL(); 
       
    69 
       
    70     /**
       
    71      * This is a call back from the Matrix Menu whenever there is change in focus
       
    72      */
       
    73     TInt HandleNotifyL(
       
    74             TInt aCmdId,
       
    75             TInt aEventId,
       
    76             CLiwGenericParamList& aEventParamList,
       
    77             const CLiwGenericParamList& aInParamList);
       
    78 
       
    79     /**
       
    80      * updates  media list with coressponding context depending on the focus  
       
    81      * to show the thumbnails
       
    82      */
       
    83     void UpdatePreviewThumbnailListL( );
       
    84 
       
    85     /**
       
    86      * Returns the collection items count 
       
    87      */      
       
    88     TInt Count();
       
    89     
       
    90 private:
       
    91 
       
    92     /**
       
    93      * Perform the second phase construction 
       
    94      */      
       
    95     void ConstructL();
       
    96 
       
    97     /**
       
    98      * Default constructor.
       
    99      */
       
   100     CGlxContentHarvesterPluginAlbums( MLiwInterface* aCPSInterface,
       
   101                                       MGlxContentHarvesterPlugin* aCHplugin );
       
   102 
       
   103     /**
       
   104      * Update data in Content Publisher Storage
       
   105      */
       
   106     void UpdateDataInCPSL(TInt aHandle);
       
   107 
       
   108     /**
       
   109      * This retrievs the bitmap handle and updates the index of the 
       
   110      * thumbnail to be shown
       
   111      */
       
   112     TInt UpdateItem(TInt aItemIndex); 
       
   113 
       
   114     /*
       
   115      * This Updates the thumbnail/Preview list with thumbnails already present
       
   116      */
       
   117     void HandleItemChanged();
       
   118 
       
   119     /*
       
   120      * This Function is called when the collection recives a focus and losses the focus
       
   121      * @param aOn :True   : The collection is in focus
       
   122      *            : False : The collection lost the focus 
       
   123      */
       
   124     void ActivateL( TBool aOn );
       
   125 
       
   126     /**
       
   127      * Delets the medial list created. 
       
   128      */
       
   129     void DestroyMedialist();
       
   130 
       
   131     /**
       
   132      * Creates a media list
       
   133      */    
       
   134     void CreateMedialistL();
       
   135 
       
   136     /**
       
   137      * Adds the context and observers to the media list  
       
   138      */
       
   139     void AddContextAndObserverL();
       
   140 
       
   141     /**
       
   142      * Adds the context and observers to the media list  
       
   143      */
       
   144     void RemoveContextAndObserver();
       
   145 
       
   146     //Call back from the Media list for any error occured 
       
   147     void HandleError( TInt /*aError*/ );
       
   148 
       
   149 
       
   150 private: // from MGlxMediaListObserver
       
   151 
       
   152     /**
       
   153      * @ref MGlxMediaListObserver::HandleItemAddedL
       
   154      */
       
   155     void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   156     /**
       
   157      * @ref MGlxMediaListObserver::HandleMediaL
       
   158      */
       
   159     void HandleMediaL( TInt aListIndex, MGlxMediaList* aList );
       
   160     /**
       
   161      * @ref MGlxMediaListObserver::HandleItemRemoved
       
   162      */
       
   163     void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   164     /**
       
   165      * @ref MGlxMediaListObserver::HandleItemModifiedL
       
   166      */
       
   167     void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList );
       
   168     /**
       
   169      * @ref MGlxMediaListObserver::HandleAttributesAvailableL
       
   170      */
       
   171     void HandleAttributesAvailableL(
       
   172             TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );
       
   173     /**
       
   174      * @ref MGlxMediaListObserver::HandleFocusChangedL
       
   175      */
       
   176     void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, TInt aNewIndex,
       
   177             TInt aOldIndex, MGlxMediaList* aList );
       
   178     /**
       
   179      * @ref MGlxMediaListObserver::HandleItemSelected
       
   180      */
       
   181     void HandleItemSelectedL( TInt aIndex, TBool aSelected, MGlxMediaList* aList );
       
   182     /**
       
   183      * @ref MGlxMediaListObserver::HandleMessageL
       
   184      */
       
   185     void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList );
       
   186 
       
   187 private: // data
       
   188 
       
   189     /**
       
   190      * Instance of CPS interface used for update with CPS.
       
   191      */
       
   192     MLiwInterface* iCPSInterface;
       
   193     CLiwGenericParamList* iInParamList;
       
   194     CLiwGenericParamList* iOutParamList;
       
   195     CPeriodic* iPeriodic;
       
   196 
       
   197     /// Owned: Media list
       
   198     MGlxMediaList* iMediaList;
       
   199     
       
   200     /// Own: the thumbnail context
       
   201     CGlxThumbnailContext* iThumbnailContext;
       
   202 
       
   203     /// Own: Thuimbnail Iterator
       
   204     TGlxSequentialIterator iThumbnailIterator;    
       
   205 
       
   206     RArray<TInt> iPreviewItemCount;
       
   207 
       
   208     // Preview thumbnail index
       
   209     TInt iProgressIndex;
       
   210     
       
   211     };
       
   212 
       
   213 #endif /*GLXCONTENTHARVESTERPLUGINALBUMS_H*/