scrsaver/screensaveraiwplugin/inc/screensaveraiwplugin.h
branchRCL_3
changeset 26 e8d784ac1a4b
parent 0 040fcad49f44
equal deleted inserted replaced
25:aaeeca1f15af 26:e8d784ac1a4b
       
     1 /*
       
     2 * Copyright (c) 2005 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:     Header file for class CScreenSaverAIWPlugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_CSCREENSAVERAIWPLUGIN_H
       
    22 #define C_CSCREENSAVERAIWPLUGIN_H
       
    23 
       
    24 #include <AiwServiceIfMenu.h>
       
    25 #include <ConeResLoader.h>
       
    26 
       
    27 #define CSCREENSAVERAIWPLUGIN_TRACES
       
    28 
       
    29 
       
    30 class CRepository;
       
    31 
       
    32 /**
       
    33  *  CScreenSaverAIWPlugin plugin implementation.
       
    34  *
       
    35  *  This plugin implements an AIW provider for setting image files as slide set
       
    36  *  screen saver or setting a single animated image file as animated screen saver.
       
    37  *  
       
    38  *
       
    39  *  @since S60 v3.2
       
    40  */ 
       
    41 class CScreenSaverAIWPlugin : public CAiwServiceIfMenu 
       
    42     {
       
    43     public: 
       
    44         static CScreenSaverAIWPlugin* NewL();
       
    45         virtual ~CScreenSaverAIWPlugin();
       
    46 
       
    47     private: 
       
    48     // from base class CAiwServiceIfMenu
       
    49     
       
    50         void InitialiseL(
       
    51             MAiwNotifyCallback& aFrameworkCallback,
       
    52             const RCriteriaArray& aInterest);
       
    53 
       
    54         void HandleServiceCmdL(
       
    55             const TInt& aCmdId,
       
    56             const CAiwGenericParamList& aInParamList,
       
    57             CAiwGenericParamList& aOutParamList,
       
    58             TUint aCmdOptions = 0,
       
    59             const MAiwNotifyCallback* aCallback = NULL);
       
    60             
       
    61         void InitializeMenuPaneL(
       
    62             CAiwMenuPane& aMenuPane,
       
    63             TInt aIndex,
       
    64             TInt aCascadeId,
       
    65             const CAiwGenericParamList& aInParamList);
       
    66 
       
    67         void HandleMenuCmdL(
       
    68             TInt aMenuCmdId,
       
    69             const CAiwGenericParamList& aInParamList,
       
    70             CAiwGenericParamList& aOutParamList,
       
    71             TUint aCmdOptions = 0,
       
    72             const MAiwNotifyCallback* aCallback = NULL);
       
    73 
       
    74     private:
       
    75         CScreenSaverAIWPlugin();
       
    76         void ConstructL();
       
    77 
       
    78     private: // New
       
    79     
       
    80         struct TImageFile
       
    81             {
       
    82                 TPtrC iFileName;
       
    83                 TPtrC iMimeType;
       
    84             };    
       
    85             
       
    86         void DisplayInfoNoteL(TInt aTextResourceId);
       
    87         void ValidateParamListL(const CAiwGenericParamList& aParamList);
       
    88         TBool AnyMimeTypeSupportedL(const CAiwGenericParamList& aParamList);
       
    89         TBool IsMimeTypeSupportedL(const TDesC& aMimeTypeString);
       
    90         TBool IsAnimatedMimeTypeL( const TDesC& aMimeTypeString, TBool& aUseImageDecoder );
       
    91         TPtrC GetAiwParamAsDescriptor(TInt& aIndex,
       
    92                                       const CAiwGenericParamList& aParamList,
       
    93 									  TGenericParamId aParamType);
       
    94         void StoreImageListToFileL( const RArray<TImageFile>& aSupportedImageFiles  );
       
    95         void OpenImageFileL( RFile& aImageFile, const TInt aSlideSetType );
       
    96         TBool IsAnimatedImageL( const TDesC& aFileName, const TDesC& aMimeTypeString );
       
    97         TBool IsReallyAnimatedImageL( const TDesC& aFileName );
       
    98 									  
       
    99 #ifdef CSCREENSAVERAIWPLUGIN_TRACES	
       
   100 								  
       
   101         void DumpParamList(const TDesC& aMethod, const CAiwGenericParamList& aParamList);
       
   102         void DumpParamList(const TDesC& aMethod, 
       
   103                            TGenericParamId aParamType,
       
   104                            const CAiwGenericParamList& aParamList);	
       
   105         void DumpSupportedImageFileList(const RArray<TImageFile>& aSupportedImageFiles);                       								  
       
   106 #endif    
       
   107 
       
   108                                   
       
   109         void GetSupportedImageFilesL(const CAiwGenericParamList& aParamList,
       
   110                              RArray<TImageFile>& aSupportedImageFiles);
       
   111         void SetAnimatedScreenSaverL( const RArray<TImageFile>& aSupportedImageFiles );                             
       
   112         void SetSlideShowScreenSaverL( const RArray<TImageFile>& aSupportedImageFiles );
       
   113         
       
   114     private:
       
   115         RConeResourceLoader iConeResLoader;        
       
   116         RArray<TImageFile> iSupportedImageFiles;
       
   117         CRepository* iScreensaverRepository;
       
   118         CRepository* iAnimationRepository;
       
   119         CRepository* iSlideshowRepository;         
       
   120     };
       
   121     
       
   122 #endif // C_CSCREENSAVERAIWPLUGIN_H