memana/analyzetoolclient/configurationappgui/inc/atconfigurationappguiappui.h
changeset 0 f0f2b8682603
equal deleted inserted replaced
-1:000000000000 0:f0f2b8682603
       
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ATCONFIGURATIONAPPGUIAPPUI_H
       
    19 #define ATCONFIGURATIONAPPGUIAPPUI_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <aknviewappui.h>
       
    23 #include <analyzetool/atstorageserverclnt.h>
       
    24 #include <analyzetool/atcommon.h>
       
    25 #include <analyzetool/analyzetool.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CApaApplication;
       
    29 class CATConfigurationAppGuiListBoxView;
       
    30 class CATConfigurationAppGuiProcessView;
       
    31 //class CATConfigurationAppGuiSettingItemListView;
       
    32 
       
    33 // CONSTANTS
       
    34 const TUint32 KATHundred = 100;
       
    35 const TUint32 KATThousand = 1000;
       
    36 const TUint32 KATMillion = 1000000;
       
    37 _LIT( KATB, "B" );
       
    38 _LIT( KATKB, "KB" );
       
    39 _LIT( KATMB, "MB" );
       
    40 
       
    41 /**
       
    42  * @class CATConfigurationAppGuiAppUi ATConfigurationAppGuiAppUi.h
       
    43  * @brief The AppUi class handles application-wide aspects of the user interface, including
       
    44  *        view management and the default menu, control pane, and status pane.
       
    45  */
       
    46 class CATConfigurationAppGuiAppUi : public CAknViewAppUi
       
    47     {
       
    48 public: 
       
    49     /**
       
    50     * C++ default constructor.
       
    51     */
       
    52     CATConfigurationAppGuiAppUi();
       
    53     
       
    54     /**
       
    55     * Destructor.
       
    56     */
       
    57     virtual ~CATConfigurationAppGuiAppUi();
       
    58     
       
    59     /**
       
    60     * ConstructL.
       
    61     */
       
    62     void ConstructL();
       
    63 
       
    64 public:
       
    65     /**
       
    66     * From CCoeAppUi.
       
    67     */
       
    68     TKeyResponse HandleKeyEventL(
       
    69                 const TKeyEvent& aKeyEvent,
       
    70                 TEventCode aType );
       
    71 
       
    72     /**
       
    73     * from CEikAppUi.
       
    74     */
       
    75     void HandleCommandL( TInt aCommand );
       
    76     
       
    77     /**
       
    78     * From CEikAppUi.
       
    79     */
       
    80     void HandleResourceChangeL( TInt aType );
       
    81 
       
    82     /**
       
    83     * From CAknAppUi.
       
    84     */
       
    85     void HandleViewDeactivation( 
       
    86             const TVwsViewId& aViewIdToBeDeactivated, 
       
    87             const TVwsViewId& aNewlyActivatedViewId );
       
    88     
       
    89     /**
       
    90     * Returns handle to the storage server
       
    91     * @return RATStorageServer handle to the storage server
       
    92     */  
       
    93     inline RATStorageServer StorageServer()
       
    94         {
       
    95         return iStorageServer;    
       
    96         }
       
    97     
       
    98     /**
       
    99     * Sets current process's process ID.
       
   100     * @param aProcessId current process's process ID
       
   101     */
       
   102     inline void SetCurrentProcessId( TUint aProcessId )
       
   103         {
       
   104         iCurrentProcessId = aProcessId;
       
   105         }
       
   106     
       
   107     /**
       
   108     * Gets current process ID.
       
   109     * @return TUint process ID
       
   110     */
       
   111     inline TUint GetCurrentProcessId()
       
   112         {
       
   113         return iCurrentProcessId;    
       
   114         }
       
   115     
       
   116     /**
       
   117     * Sets member variable's process start time.
       
   118     * @param aProcessStartTime current process's start time
       
   119     */
       
   120     inline void SetCurrentProcessStartTime( TInt64 aProcessStartTime )
       
   121         {
       
   122         iCurrentProcessStartTime = aProcessStartTime;
       
   123         }
       
   124     
       
   125     /**
       
   126     * Get current opened process's start time.
       
   127     * @return TInt64 start time presented in microseconds
       
   128     */
       
   129     inline TInt64 GetCurrentProcessStartTime()
       
   130         {
       
   131         return iCurrentProcessStartTime;    
       
   132         }
       
   133 
       
   134     /**
       
   135     * Starts a subtest for a process.
       
   136     * @param aProcessId ID of the process
       
   137     */
       
   138     void SetProcessSubTestStartL( TUint aProcessId );
       
   139     
       
   140     /**
       
   141     * Stops a subtest for a process.
       
   142     * @param aProcessId ID of the process
       
   143     */
       
   144     
       
   145     void SetProcessSubTestStopL( TUint aProcessId );
       
   146     
       
   147     /**
       
   148     * Checks if subtest is running for a process.
       
   149     * @param aProcessId ID of the process
       
   150     * @return The index of the first matching aProcessId 
       
   151     * within the array. KErrNotFound, if no matching 
       
   152     * aProcessId can be found.
       
   153     */
       
   154     TInt IsSubTestRunning( TUint aProcessId );
       
   155 
       
   156     /**
       
   157     * Loads application settings.
       
   158     * @return TInt KErrNone if loading succeeds.
       
   159     */
       
   160     TInt LoadSettingsL();
       
   161     
       
   162     /**
       
   163     * Shows error note.
       
   164     * @param aResourceId resource id of the text which
       
   165     * is to be shown to the user.
       
   166     */    
       
   167     void ShowErrorNoteL( TInt aResourceId );
       
   168 
       
   169     /**        
       
   170     * From CEikAppUi.
       
   171     */      
       
   172     void HandleForegroundEventL( TBool aForeground );
       
   173     
       
   174 
       
   175     /**        
       
   176     * Starts periodic timer with an interval.
       
   177     */      
       
   178     void StartTimerL();
       
   179 
       
   180     /**        
       
   181     * Periodic timer's callback function.
       
   182     * @param ptr TAny pointer.
       
   183     * @return TInt KErrNone.
       
   184     */      
       
   185     static TInt CallBackFunctionL( TAny* ptr )
       
   186         {
       
   187         ( static_cast<CATConfigurationAppGuiAppUi*>( ptr ) )->TimerNotifyL( ETrue );
       
   188         return KErrNone;
       
   189         };
       
   190 
       
   191     /**        
       
   192     * Periodic timer's notify function.
       
   193     * @param aPeriod ETrue if certain time interval is reached, EFalse otherwise.
       
   194     */        
       
   195     void TimerNotifyL( TBool aPeriod );
       
   196  
       
   197     /**        
       
   198     * Stops all the subtests currently running.
       
   199     */   
       
   200     void StopAllSubtestsL();
       
   201 
       
   202 private:
       
   203     /**
       
   204     * Constructs needed components in the AppUi.
       
   205     */
       
   206     void InitializeContainersL();
       
   207     
       
   208 private:
       
   209     // Processes view pointer
       
   210     CATConfigurationAppGuiListBoxView* iATConfigurationAppGuiListBoxView;
       
   211     // Process view pointer
       
   212     CATConfigurationAppGuiProcessView* iATConfigurationAppGuiProcessView;
       
   213     // Settings view pointer
       
   214     //CATConfigurationAppGuiSettingItemListView* iATConfigurationAppGuiSettingItemListView; 
       
   215     // Handle to the RATStorageServer
       
   216     RATStorageServer iStorageServer;
       
   217     // Current process ID
       
   218     TUint iCurrentProcessId;
       
   219     // Current process's start time
       
   220     TInt64 iCurrentProcessStartTime;
       
   221     // Warning tones setting
       
   222     TInt iWarningTones;
       
   223     // Update interval setting
       
   224     TInt iUpdateInterval;
       
   225     // array containing all the processes which subtest is running
       
   226     RArray<TUint> iSubTestProcesses;
       
   227     // Periodic timer to handle timer events
       
   228     CPeriodic*  iPeriodicTimer;
       
   229     // Deactivated view's Id
       
   230     TVwsViewId  iDeactivatedId;
       
   231     };
       
   232 
       
   233 #endif // ATCONFIGURATIONAPPGUIAPPUI_H