logsui/EngineInc/CLogsSharedData.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Implements interface MLogsSharedData
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __Logs_Engine_CLogsSharedData_H__
       
    21 #define __Logs_Engine_CLogsSharedData_H__
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 
       
    26 #include <centralrepository.h>      
       
    27 #include <cenrepnotifyhandler.h>    
       
    28 
       
    29 
       
    30 
       
    31 #include <e32std.h>
       
    32 #include "MLogsSharedData.h"
       
    33 #include "MLogsStateHolder.h"
       
    34 
       
    35 // CONSTANTS
       
    36 
       
    37 // MACROS
       
    38 
       
    39 // DATA TYPES
       
    40 
       
    41 // FUNCTION PROTOTYPES
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 class CLogsSharedDataListener;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 *  Implements interface MLogsSharedData
       
    50 */
       
    51 class CLogsSharedData :	public CBase,
       
    52                         public MLogsSharedData,
       
    53                         public MLogsStateHolder
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56        /**
       
    57         * Two-phased constructor.
       
    58         *
       
    59         * @param aHandler pointer to handler
       
    60         * @return pointer to new object
       
    61         */
       
    62         static CLogsSharedData* NewL();
       
    63 
       
    64        /**
       
    65         * Destructor.
       
    66         */
       
    67         virtual ~CLogsSharedData();
       
    68 
       
    69     private:
       
    70         /**
       
    71          * Second phase constructor.
       
    72          */
       
    73         void ConstructL();
       
    74 
       
    75         /**
       
    76          * C++ constructor.
       
    77          *
       
    78          * @param aHandler pointer to handler
       
    79          */
       
    80         CLogsSharedData();
       
    81 
       
    82     public: // from MLogsSharedData
       
    83         /**
       
    84          *  Returns whether MSK is enabled in platform
       
    85          *
       
    86          *  @return MSKEnabled true/false
       
    87          */            
       
    88         TBool IsMSKEnabledInPlatform();
       
    89          /**
       
    90          *  Returns whether VoIP is enabled in platform
       
    91          *
       
    92          *  @return VoIPEnabled true/false
       
    93          */            
       
    94         
       
    95         /**
       
    96          *  Returns whether Logging is enabled 
       
    97          *  (Log length is != "no log")
       
    98          *
       
    99          *  @return LoggingEnabled true/false
       
   100          */        
       
   101         TBool IsLoggingEnabled();
       
   102          
       
   103         TBool IsVoIPEnabledInPlatform();   
       
   104         TInt LastCallTimer( TAlsEnum aLine, TVoipEnum aVoip ); 
       
   105         TInt DialledCallsTimer( TAlsEnum,   TVoipEnum aVoip );
       
   106         TInt ReceivedCallsTimer( TAlsEnum,  TVoipEnum aVoip );
       
   107         TInt AllCallsTimer( TAlsEnum,       TVoipEnum aVoip );
       
   108         void ClearCallTimers();
       
   109         void SetLoggingEnabled( TBool aSwitch );
       
   110         TInt64 GprsSentCounter();
       
   111         TInt64 GprsReceivedCounter();
       
   112         void ClearGprsCounters();
       
   113         TBool ShowCallDurationLogsL();    
       
   114         TBool ShowRingDuration() const;     //For ring duation feature
       
   115         
       
   116         /*******************************************************************************
       
   117         FIXME: Toolbar is currently always on - keeping the toolbar visibility handling 
       
   118         sources in comments for now - remove later.
       
   119  
       
   120         TInt ToolbarVisibility() const;
       
   121         void SetToolbarVisibility( TInt aToolbarVisibility );   
       
   122         *******************************************************************************/     
       
   123         
       
   124         TInt NewMissedCalls( const TBool aClear = EFalse );
       
   125         void SetObserver( MLogsObserver* aObserver );
       
   126 
       
   127         //Callbacks needed by CLogsSharedDataListener listerner objects
       
   128         void HandleNotifyGeneric( TUid aCategory, TUint32 aId );
       
   129         void HandleNotifyInt( TUid aCategory, TUint32 aKey, TInt aNewValue);
       
   130         
       
   131     public: // from MLogsStateHolder
       
   132 
       
   133         TLogsState State() const;
       
   134 		
       
   135     private:
       
   136     
       
   137         /**
       
   138          *  Informs observer when contents of a central repository key has changed
       
   139          *
       
   140          *  @param aCategory Central key category id 
       
   141          *  @param aKey Central repository key 
       
   142          */
       
   143         void InformObserver( TUid aCategory, TUint32 aKey );
       
   144 
       
   145         /**
       
   146          *  Checks from central repository whether data call numbers should be shown to
       
   147          *  users
       
   148          */
       
   149         void CheckShowCsdNumberStatusL();                
       
   150 
       
   151 //For ring duation feature
       
   152         /**
       
   153          *  Checks from central repository whether ring duration for missed calls
       
   154          *  should be shown to users
       
   155          */
       
   156         void CheckShowRingDurationL();  
       
   157          
       
   158          /**
       
   159          *  Checks from central repository whether MSK is enabled and set
       
   160          *  iMSKEnabledInPlatform
       
   161          */             
       
   162          void CheckMSKEnabledInPlatformL();
       
   163          
       
   164          /**
       
   165          *  Checks from central repository whether VoIP is enabled and set
       
   166          *  iVoIPEnabledInPlatform
       
   167          */             
       
   168          void CheckVoIPEnabledInPlatform();  
       
   169          
       
   170     private:    // Data
       
   171     
       
   172     
       
   173         /// Own: Central repository
       
   174         CRepository* iRepository_Logs;
       
   175         CRepository* iRepository_Dcl;        
       
   176         CRepository* iRepository_Voip;                
       
   177         
       
   178         /// Own: Central repository notification handlers        
       
   179         CLogsSharedDataListener* iNotifyHandler_Logs;                        
       
   180         CLogsSharedDataListener* iNotifyHandler_Dcl;                                
       
   181         CLogsSharedDataListener* iNotifyHandler_Voip;                                        
       
   182        
       
   183         //For ring duation feature
       
   184         TBool iShowRingDuration;
       
   185        
       
   186         // For checking wether the MSK is supported in platform or not
       
   187         TBool iMSKEnabledInPlatform;   
       
   188 
       
   189         // For checking if the VoIP is supported in platform or not
       
   190         TBool iVoIPEnabledInPlatform;   
       
   191             
       
   192         /// Own: observer
       
   193         MLogsObserver*      iObserver;
       
   194 		
       
   195         /// own: state for observer
       
   196         TLogsState      iState;  
       
   197    
       
   198     };
       
   199 
       
   200 #endif  // __Logs_Engine_CLogsSharedData_H__
       
   201 
       
   202 // End of File