psln/Inc/PslnGeneralThemeContainer.h
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 0 2f259fa3e83a
equal deleted inserted replaced
16:71dd06cfe933 18:0aa5fbdfbc30
    19 
    19 
    20 #ifndef PSLNGENERALTHEMECONTAINER_H
    20 #ifndef PSLNGENERALTHEMECONTAINER_H
    21 #define PSLNGENERALTHEMECONTAINER_H
    21 #define PSLNGENERALTHEMECONTAINER_H
    22 
    22 
    23 #include "PslnBaseContainer.h"
    23 #include "PslnBaseContainer.h"
    24 
       
    25 class CAknLocalSkinInstance;
       
    26 
       
    27 /**
       
    28 *  Observer interface for theme preview state changes.
       
    29 *  aPreviewMode new mode for theme preview - ETrue preview is active
       
    30 *                                            EFalse preview is now ready
       
    31 *
       
    32 *  @since S60 v5.0
       
    33 */
       
    34 class MPslnThemePreviewObserver
       
    35     {
       
    36     public:
       
    37         virtual void HandlePreviewStateChange( const TBool& aPreviewMode ) = 0;
       
    38     };
       
    39 
    24 
    40 /**
    25 /**
    41 *  General theme container.
    26 *  General theme container.
    42 *  Contains available skins.
    27 *  Contains available skins.
    43 *
    28 *
    93         * Updates D column icons when skin preview activates.
    78         * Updates D column icons when skin preview activates.
    94         *
    79         *
    95         * @since 5.0
    80         * @since 5.0
    96         */
    81         */
    97         void UpdateSkinListItemsDColumnOnlyL();
    82         void UpdateSkinListItemsDColumnOnlyL();
    98 
       
    99         /**
       
   100         * Starts theme preview.
       
   101         *
       
   102         * @since 5.0
       
   103         */
       
   104         void StartThemePreviewL( TBool aTouch = ETrue );
       
   105                 
       
   106         
       
   107         /**
       
   108         * Cancel theme preview.
       
   109         *
       
   110         * @since 5.0
       
   111         */
       
   112         void CancelThemePreviewL();
       
   113 
       
   114 
       
   115         /**
       
   116         * Sets theme preview change observer (MPslnThemePreviewObserver).
       
   117         * aObserver observer for theme preview changes.
       
   118         *
       
   119         * @since 5.0
       
   120         */
       
   121         void SetThemePreviewObserver( MPslnThemePreviewObserver* aObserver );
       
   122 
       
   123         /**
       
   124         * Locks/enables up and down key events to this container.
       
   125         *
       
   126         * @since 5.0
       
   127         */
       
   128         void LockUpAndDownKeys( const TBool& aLocked );
       
   129         
       
   130         /**
       
   131         * Restart Quick Preview
       
   132         */
       
   133         void RestartQuickPreviewL();
       
   134 
       
   135         /**
       
   136         * Set theme preview state active.
       
   137         */    
       
   138         void SetPreviewStateActive();
       
   139         
       
   140         /**
       
   141         * Is current focus theme in preview state. 
       
   142         * @return ETrue if theme is in preview state.
       
   143         */    
       
   144         TBool CurrentThemeInPreviewState();
       
   145         
    83         
   146 
    84 
   147     private:            
    85     private:            
   148         
    86         
   149         // Gets Help context.        
    87         // Gets Help context.        
   150         void GetHelpContext( TCoeHelpContext& aContext ) const;
    88         void GetHelpContext( TCoeHelpContext& aContext ) const;
   151         // From CPslnBaseContainer
       
   152         TKeyResponse OfferKeyEventL(
       
   153             const TKeyEvent& aKeyEvent, 
       
   154             TEventCode aType );
       
   155         // From CCoeControl
       
   156         void HandlePointerEventL( const TPointerEvent &aPointerEvent );
       
   157 
       
   158         /* Creates (&initializes) a locally skinnable item list.*/
       
   159         void CreateSkinItemList();
       
   160         
       
   161         /* Adds skin item to locally skinnable item list. */
       
   162         TInt AddItemToList( const TAknsItemID& aSkinID );
       
   163 
       
   164         /* Callback interface for idle time. */
       
   165         static TInt DoHandleIdleTimeL( TAny* aAny );
       
   166 
       
   167         /* Callback interface for theme effect ending. */
       
   168         static TInt DoHandleEffectEndL( TAny* aAny );
       
   169 
       
   170         /* Handle idle time. */
       
   171         void HandleIdleTimeL();
       
   172 
       
   173         /* Handle theme effect ending. */
       
   174         void HandleEffectEndL();
       
   175         
       
   176         /*
       
   177         * Get Preview Skin Index.
       
   178         */
       
   179         TInt PreviewSkinIndex();
       
   180 
       
   181         /* Initialize theme preview delay time settings. */
       
   182         void InitPreviewTime();
       
   183         
       
   184         /* Show Error Note. */
       
   185         void ShowErrorNoteL( TInt  aResourceId  ); 
       
   186 
    89 
   187     private: // data
    90     private: // data
   188 
       
   189         /*
       
   190         * List of skin items to skin locally.
       
   191         */
       
   192         RArray<TAknsItemID> iSkinItemList;
       
   193 
       
   194         /*
       
   195         * Timer for delay.
       
   196         * Own.
       
   197         */
       
   198         CPeriodic* iPreviewIdle;
       
   199 
       
   200         /*
       
   201         * Skin preview library instance.
       
   202         * Own.
       
   203         */
       
   204         CAknLocalSkinInstance* iLocalSkinInstance;
       
   205 
       
   206         /*
       
   207         * Theme preview state change observer.
       
   208         * Not own.
       
   209         */
       
   210         MPslnThemePreviewObserver* iObserver;
       
   211 
    91 
   212         /*
    92         /*
   213         * To be used index in highlight when container is updated.
    93         * To be used index in highlight when container is updated.
   214         * This is used when skin is activated and user has already
    94         * This is used when skin is activated and user has already
   215         * highlighted some other theme.
    95         * highlighted some other theme.
   216         */
    96         */
   217         TInt iToBeUsedIndex;
    97         TInt iToBeUsedIndex;
   218 
    98 
   219         /*
    99         /*
   220         * Up and down key events are ignored while a skin is activating.
       
   221         * This is to avoid drawing of container when the skin items might
       
   222         * not be valid.
       
   223         */
       
   224         TBool iLockedKeys;
       
   225                 
       
   226         /*
       
   227         * Current preview theme index in listbox.
   100         * Current preview theme index in listbox.
   228         */
   101         */
   229         TInt iActiveSkinItemIndex;
   102         TInt iActiveSkinItemIndex;
   230         
   103 
   231         /*
       
   232         * Theme preview delay time.
       
   233         */
       
   234         TInt iPreviewDelayTime;
       
   235         
       
   236         /*
       
   237         * Theme preview delay time, arisen by navigation key.
       
   238         */
       
   239         TInt iPreviewDelayTimeOnHardKey;
       
   240         
       
   241         /*
       
   242         * Theme preview interval time.
       
   243         */
       
   244         TInt iPreviewIntervalTime;
       
   245         
       
   246         /*
   104         /*
   247         * Old Skin Num.
   105         * Old Skin Num.
   248         */
   106         */
   249         TInt iOldSkinNum;
   107         TInt iOldSkinNum;
   250     };
   108     };