photosgallery/contentharvesterplugin/inc/glxcontentharvesterpluginalbums.h
branchRCL_3
changeset 13 bcb43dc84c44
parent 12 ce1c7ad1f18b
child 14 2dac0fdba72b
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
     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 Function is called when the collection recives a focus and losses the focus
       
   116      * @param aOn :True   : The collection is in focus
       
   117      *            : False : The collection lost the focus 
       
   118      */
       
   119     void ActivateL( TBool aOn );
       
   120 
       
   121     /**
       
   122      * Delets the medial list created. 
       
   123      */
       
   124     void DestroyMedialist();
       
   125 
       
   126     /**
       
   127      * Creates a media list
       
   128      */    
       
   129     void CreateMedialistL();
       
   130 
       
   131     /**
       
   132      * Adds the context and observers to the media list  
       
   133      */
       
   134     void AddContextAndObserverL();
       
   135 
       
   136     /**
       
   137      * Adds the context and observers to the media list  
       
   138      */
       
   139     void RemoveContextAndObserver();
       
   140 
       
   141     //Call back from the Media list for any error occured 
       
   142     void HandleError( TInt /*aError*/ );
       
   143 
       
   144 
       
   145 private: // from MGlxMediaListObserver
       
   146 
       
   147     /**
       
   148      * @ref MGlxMediaListObserver::HandleItemAddedL
       
   149      */
       
   150     void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   151     /**
       
   152      * @ref MGlxMediaListObserver::HandleMediaL
       
   153      */
       
   154     void HandleMediaL( TInt aListIndex, MGlxMediaList* aList );
       
   155     /**
       
   156      * @ref MGlxMediaListObserver::HandleItemRemoved
       
   157      */
       
   158     void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
       
   159     /**
       
   160      * @ref MGlxMediaListObserver::HandleItemModifiedL
       
   161      */
       
   162     void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList );
       
   163     /**
       
   164      * @ref MGlxMediaListObserver::HandleAttributesAvailableL
       
   165      */
       
   166     void HandleAttributesAvailableL(
       
   167             TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );
       
   168     /**
       
   169      * @ref MGlxMediaListObserver::HandleFocusChangedL
       
   170      */
       
   171     void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, TInt aNewIndex,
       
   172             TInt aOldIndex, MGlxMediaList* aList );
       
   173     /**
       
   174      * @ref MGlxMediaListObserver::HandleItemSelected
       
   175      */
       
   176     void HandleItemSelectedL( TInt aIndex, TBool aSelected, MGlxMediaList* aList );
       
   177     /**
       
   178      * @ref MGlxMediaListObserver::HandleMessageL
       
   179      */
       
   180     void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList );
       
   181 
       
   182 private: // data
       
   183 
       
   184     /**
       
   185      * Instance of CPS interface used for update with CPS.
       
   186      */
       
   187     MLiwInterface* iCPSInterface;
       
   188     CLiwGenericParamList* iInParamList;
       
   189     CLiwGenericParamList* iOutParamList;
       
   190 
       
   191     /// Owned: Media list
       
   192     MGlxMediaList* iMediaList;
       
   193     
       
   194     /// Own: Attribute Context
       
   195     CGlxAttributeContext* iUriAttributeContext;
       
   196     
       
   197     CGlxAttributeContext* iThumbnailAttributeContext;
       
   198 
       
   199     /// Own: Thumbnail Iterator
       
   200     TGlxSequentialIterator iThumbnailIterator;  
       
   201 
       
   202     };
       
   203 
       
   204 #endif /*GLXCONTENTHARVESTERPLUGINALBUMS_H*/