idlefw/plugins/pslnactiveidleplugin/inc/pslnactiveidlepluginengine.h
branchRCL_3
changeset 9 d0529222e3f0
parent 4 1a2a00e78665
child 10 5ef93ea513cb
child 18 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 9:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Container for Psln Active Idle settings view.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_PSLNACTIVEIDLEPLUGINENGINE_H
       
    19 #define C_PSLNACTIVEIDLEPLUGINENGINE_H
       
    20 
       
    21 #include <pslnfwbasecontainer.h>
       
    22 #include <mpslnfwappthemeobserver.h>
       
    23 
       
    24 // UID of Active Idle.
       
    25 const TUid KUidActiveIdle = { 0x102750F0 };
       
    26 
       
    27 
       
    28 class CPslnFWAppThemeHandler;
       
    29 class CXnODT;
       
    30 class CPslnActiveIdlePlugin; // for notifying MSK chech need
       
    31 class CPeriodic;
       
    32 
       
    33 
       
    34 /**
       
    35  *  CPslnActiveIdlePluginEngine container class
       
    36  *
       
    37  *  @since S60 3.2
       
    38  */
       
    39 class CPslnActiveIdlePluginEngine :
       
    40     public CBase,
       
    41     public MPslnFWAppThemeObserver
       
    42 {
       
    43 public: // Constructors and destructor
       
    44 
       
    45     void ConstructL(const TRect& aRect);
       
    46 
       
    47     CPslnActiveIdlePluginEngine(CPslnActiveIdlePlugin* aPlugin);
       
    48 
       
    49     ~CPslnActiveIdlePluginEngine();
       
    50 
       
    51 // new methods
       
    52 
       
    53     /**
       
    54      * Activates currently highlighted theme.
       
    55      */
       
    56     void ActivateThemeL();
       
    57     
       
    58 // from MPslnFWAppThemeObserver
       
    59 
       
    60     void HandleMessage(TXnServiceCompletedMessage aMessage);
       
    61 
       
    62     void HandleMessage(
       
    63         TXnServiceCompletedMessage aMessage,
       
    64         CArrayPtrFlat<CXnODT>& aAppThemeList);
       
    65         
       
    66     TInt CurrentUIController()
       
    67         {
       
    68         return iCurrentUIController;
       
    69         };
       
    70         
       
    71     void AddThemesToContainerL();
       
    72 
       
    73     void ManualGetSkinsRestartL(TBool aForceStart = EFalse);
       
    74 
       
    75 private: // new methods
       
    76 
       
    77     /**
       
    78      * Adds new theme(s) to the listbox. Multiple themes are
       
    79      * only added when list updation is required (icons need
       
    80      * to be updated). Otherwise latest theme info is inquired
       
    81      * from XUIKON.
       
    82      */
       
    83     void AddNewThemeL(TXnServiceCompletedMessage aMessage);
       
    84     TInt GetExtStandbyScreenState(TInt& aValue);
       
    85 
       
    86     /**
       
    87      * Add HS items to list.
       
    88      */
       
    89     void AddHomeScreenThemesL();
       
    90 
       
    91     void CheckCurrentUIControllerL();
       
    92     
       
    93     void CheckCurrentAi1PluginL();
       
    94     
       
    95     void UpdateUIControllersInCenrepL(TInt aControllerId);
       
    96     
       
    97     void UpdateStatusPaneVisibilityCenrepL(TBool aPaneHidden);
       
    98     
       
    99     void UpdateAi1PluginLoadCenrepL(TInt aNewUid);
       
   100     
       
   101     TInt RestartAifw();
       
   102 
       
   103     TBool IsAiRunning();
       
   104 
       
   105     void UiTimerRestart();
       
   106         
       
   107 private:
       
   108 
       
   109     static TInt RestartTimerCallback( TAny* aSelf );
       
   110 
       
   111     static TInt UiRefreshTimerCallback( TAny* aSelf );
       
   112     
       
   113 private: // data
       
   114 
       
   115     /**
       
   116      * Application specific skin handler.
       
   117      * Own.
       
   118      */
       
   119     CPslnFWAppThemeHandler* iPslnFWThemeHandler;
       
   120 
       
   121     /**
       
   122      * List of themes. Each theme is described within an ODT.
       
   123      * Own.
       
   124      */
       
   125     CArrayPtrFlat<CXnODT>*  iMySkinList;
       
   126 
       
   127     /**
       
   128      * Indicates that skin list should be updated.
       
   129      */
       
   130     TBool                   iThemeListUpdated;
       
   131 
       
   132     /**
       
   133      * HomeScreen items start index in iMySkinList.
       
   134      */
       
   135     TInt                    iHSStartIndex;
       
   136 
       
   137     /**
       
   138      * HomeScreen items end index in iMySkinList.
       
   139      */
       
   140     TInt                    iHSEndIndex;
       
   141 
       
   142     /**
       
   143      * Flag to indicate if we are avaiting the first restart event.
       
   144      */
       
   145     TBool                   iFirstUpdateRound;
       
   146 
       
   147     /**
       
   148      * Flag to indicate if we have injected first round data.
       
   149      */
       
   150     TBool                   iFirstUpdateRoundInjected;
       
   151 
       
   152     /**
       
   153      * Current AI2 UI Controller id.
       
   154      */
       
   155     TInt                    iCurrentUIController;
       
   156     
       
   157     /**
       
   158      * Current AI1 plugin id.
       
   159      */
       
   160     TInt                    iCurrentAi1Plugin;
       
   161 
       
   162     /**
       
   163      * Flag to indicate if we have injected first round data.
       
   164      * Not owned.
       
   165      */
       
   166     CPslnActiveIdlePlugin*  iPlugin;
       
   167 
       
   168     /**
       
   169      * Restart timer. To restart AI2.
       
   170      * Own.
       
   171      */
       
   172     CPeriodic*              iRestartTimer;
       
   173 
       
   174     /**
       
   175      * UI Refresh timer.
       
   176      * Own.
       
   177      */
       
   178     CPeriodic*              iUiRefreshTimer;
       
   179 
       
   180     /**
       
   181      * Restart timer. To restart AI2.
       
   182      * Own.
       
   183      */
       
   184     TInt                    iRestartRetryCount;
       
   185 
       
   186     /**
       
   187      * Kepp track what has been added to list.
       
   188      * Own.
       
   189      */
       
   190     TInt                    iAddIndex;
       
   191     
       
   192 };
       
   193 
       
   194 #endif // C_PSLNACTIVEIDLEPLUGINENGINE_H
       
   195 
       
   196 // End of File.