photosgallery/contentharvesterplugin/inc/glxcontentharvesterpluginbase.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:    Base class for publishing all the content
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GLXCONTENTHARVESTERPLUGINBASE_H
       
    22 #define GLXCONTENTHARVESTERPLUGINBASE_H
       
    23 
       
    24 //includes
       
    25 
       
    26 #include <liwcommon.h>
       
    27 
       
    28 //Forward Declarations
       
    29 
       
    30 class CLiwGenericParamList;
       
    31 class CLiwServiceHandler;
       
    32 class MLiwInterface;
       
    33 class CGlxContentHarvesterPluginBase;
       
    34 class CGlxThumbnailContext;
       
    35 class MGlxMediaList;
       
    36 class MGlxContentHarvesterPlugin;
       
    37 
       
    38 class MGlxContentHarvesterPluginEntry : public MLiwNotifyCallback
       
    39     {
       
    40 public:
       
    41     /**
       
    42      * Virtual destructor
       
    43      */
       
    44     virtual ~MGlxContentHarvesterPluginEntry() {};
       
    45 	virtual void ContainerCacheCleanupL(MGlxMediaList* aMediaList)=0;
       
    46     virtual void UpdatePreviewThumbnailListL()=0;
       
    47     virtual void RemoveContextAndObserver()=0;
       
    48     virtual TBool Focused()=0;
       
    49     virtual TInt Count()=0;
       
    50     };
       
    51 
       
    52 
       
    53 class CGlxContentHarvesterPluginBase : public CBase, public MGlxContentHarvesterPluginEntry
       
    54     {
       
    55 public: // Constructors and destructor
       
    56 
       
    57     /**
       
    58      * Default constructor.
       
    59      */
       
    60     CGlxContentHarvesterPluginBase( );
       
    61     
       
    62     /**
       
    63        * Perform the second phase construction 
       
    64        */     
       
    65     void ConstructL(TInt aDefaultIconId );
       
    66 
       
    67     /**
       
    68      * Destructor.
       
    69      */
       
    70     virtual ~CGlxContentHarvesterPluginBase();
       
    71 
       
    72     TSize GetGridIconSize();
       
    73 
       
    74     /* Calculate the Grid Icon Size for Grid Widget. It always calculate
       
    75      * size for Landscape orientation. This is done to avoid saving two
       
    76      * different thumbnail icons in Thumbnail database.
       
    77      */
       
    78     void SetGridIconSizeL();
       
    79  
       
    80     /**
       
    81      * Returns the focus status of this photossuite collection
       
    82      */
       
    83     TBool Focused();
       
    84 	
       
    85     /*This returns the bitmap handle used to display the 
       
    86      * default thumbnail.
       
    87      */
       
    88     TInt GetBitmapHandle() const;
       
    89 
       
    90 
       
    91     /**
       
    92      * Updates  the focus value of the collection to true or false
       
    93      * @param aFoucs :True :  updates the collection is in focus
       
    94      *               :False : updates the collection is not in  focus  
       
    95      * 
       
    96      */
       
    97     void SetFocus(TBool aFocus );
       
    98     
       
    99     //To check if the matrix menu is in foreground or not
       
   100     TBool IsMatrixMenuInForegroundL();
       
   101 
       
   102     /* To register for Liw notifications 
       
   103      */
       
   104     void GetInterfaceForNotificationL();
       
   105     void RequestCpsNotificationL(TInt aSuiteItem);
       
   106     void SetupPublisherL(TInt aSuiteItem);
       
   107     void HandleStateChangeL(TInt aSuiteItem);
       
   108 
       
   109     /* Virtual APi which will be implemented in child classes 
       
   110      * Basically gives info if the item in suite has gained focus
       
   111      * or lost it
       
   112      */
       
   113     virtual void ActivateL(TBool aOn) = 0;
       
   114 
       
   115     /*
       
   116      * Creates Medialist based on the plugin id
       
   117      */
       
   118     MGlxMediaList* CreateMedialistAndAttributeContextL(const TGlxMediaId& aPluginId,
       
   119     		CGlxAttributeContext* aUriAttributeContext, 
       
   120     		CGlxAttributeContext* aThumbnailAttributeContext) const;
       
   121 
       
   122     /**
       
   123      * Method to fill input list for CPS add command
       
   124      */
       
   125     void FillInputListWithDataL(
       
   126             CLiwGenericParamList* aInParamList,
       
   127             const TDesC& aPublisherId, const TDesC& aContentType, 
       
   128             const TDesC& aContentId, TInt aHandle);
       
   129 
       
   130 	/* Cleanup medialist cache */
       
   131     void ContainerCacheCleanupL(MGlxMediaList* aMediaList);
       
   132     
       
   133     /* Set content harvester plugin instance */
       
   134     void SetCHPlugin(MGlxContentHarvesterPlugin* aCHplugin);
       
   135     
       
   136     /* Get content harvester plugin instance */
       
   137     MGlxContentHarvesterPlugin* GetCHPlugin();
       
   138   
       
   139 private: // data
       
   140 
       
   141     /**
       
   142      * Instance of CPS interface used for update with CPS.
       
   143      */
       
   144     TSize iGridIconSize;
       
   145     CLiwServiceHandler* iServiceHandler;
       
   146     CLiwGenericParamList* iInParamList;
       
   147     CLiwGenericParamList* iOutParamList;
       
   148 
       
   149     MLiwInterface* iCPSNotificationInterface;
       
   150     TGlxSequentialIterator iThumbnailIterator;    
       
   151     
       
   152     // Instance of content harvester plugin
       
   153     MGlxContentHarvesterPlugin* iCHplugin; 
       
   154 
       
   155     //This variable holds the value ,whether the collection is in focus or not
       
   156     TBool iIsFocused;
       
   157     
       
   158     //This variable is initialised with the default bitmap.
       
   159     CFbsBitmap* iBitmap;
       
   160     };
       
   161 #endif /*GLXCONTENTHARVESTERPLUGINBASE_H*/