satengine/SatServer/SystemState/inc/CSatSystemState.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  Provides system state information to SAT Server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSATSYSTEMSTATE_H
       
    21 #define CSATSYSTEMSTATE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <e32property.h>
       
    26 #include <msvapi.h>
       
    27 #include "MSatSystemState.h"
       
    28 #include "csatnetworkregstatusmonitor.h"
       
    29 
       
    30 // PREDEFINED CLASS
       
    31 class MSatMultiModeApi;
       
    32 
       
    33 // CONSTANTS
       
    34 const TInt KMaxSCANumberSize = 251;
       
    35 
       
    36 /**
       
    37 *  Accessors for system state information.
       
    38 *
       
    39 *  @lib SatSystemState
       
    40 *  @since Series 60 3.0
       
    41 */
       
    42 class CSatSystemState : public CBase,
       
    43                         public MSatSystemState,
       
    44                         public MMsvSessionObserver
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @param aPhone Reference to mobile phone
       
    51         */
       
    52         static MSatSystemState* NewL( MSatMultiModeApi& aPhone );
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CSatSystemState();
       
    58 
       
    59     public: // Functions from base classes
       
    60 
       
    61         /**
       
    62         * From MSatSystemState Gets the network registrtaion status
       
    63         * @return Mobile phone's registration status
       
    64         */
       
    65         RMobilePhone::TMobilePhoneRegistrationStatus
       
    66             GetNetworkRegistrationStatus();
       
    67 
       
    68         /**
       
    69         * From MSatSystemState Checks is call active.
       
    70         * @return TBool indicating wether call is active or not
       
    71         */
       
    72         TBool IsCallActive();
       
    73 
       
    74         /**
       
    75         * From MSatSystemState Checks is call active.
       
    76         * @return TBool indicating wether call is coming or not
       
    77         */
       
    78         TBool IsCallIncoming();
       
    79 
       
    80         /**
       
    81         * From MSatSystemState Gets SCA number from CommsDB and
       
    82         * returns it.
       
    83         * @return SCANumber from CommsDB.
       
    84         */
       
    85         const TDesC& SCANumber();
       
    86 
       
    87         /**
       
    88         * From MSatSystemState Checks is phone in silent mode.
       
    89         * @return TBool indicating wether phone is in silent mode
       
    90         */
       
    91         TBool IsSilentMode();
       
    92 
       
    93         /**
       
    94         * From MSatSystemState Checks is phone in idle state.
       
    95         * @return TBool indicating wether phone is in idle mode
       
    96         */
       
    97         TBool IsPhoneInIdleStateL();
       
    98 
       
    99         /**
       
   100         * From MSatSystemState Checks is screen saver actived from idle.
       
   101         * @return TBool indicating whether screen saver is actived from idle.
       
   102         */
       
   103         TBool IsScreenSaverActivedFromIdle();
       
   104         
       
   105         /**
       
   106         * From MSatSystemState Sets time between language selection and reboot.
       
   107         * @param aTime Time before reboot.
       
   108         * @return KErrNone if time is set successfully.
       
   109         */
       
   110         TInt WriteLanguageSelectionTime(
       
   111             TInt aTime );
       
   112 
       
   113         /**
       
   114         * From MSatSystemState Puts proactive Idle Mode Text command data to
       
   115         * shared data.
       
   116         * @param aString Idle mode text string
       
   117         * @param aIconId Idle mode text icon ID
       
   118         * @param aIconQualifier Idle mode text icon qualifier
       
   119         * @return KErrNone if setting data is OK
       
   120         */
       
   121         TInt WriteSetIdleModeText(
       
   122             const TDesC& aString,
       
   123             TInt aIconId,
       
   124             RSat::TIconQualifier aIconQualifier );
       
   125 
       
   126         /**
       
   127         * From MSatSystemState Checks is backup / restore process ongoing.
       
   128         * @return TBool indicating is process ongoing or not.
       
   129         */
       
   130         TBool IsBackupProcessOngoing();
       
   131 
       
   132         /**
       
   133         * From MSatSystemState Checks is ConfirmSatOperations on.
       
   134         * @return TBool indicating is confirmation on or off.
       
   135         */
       
   136         TBool IsConfirmSatOperationsOn();
       
   137 
       
   138         /**
       
   139         * From MSatSystemState Gets the display language from
       
   140         * CentRep and returns it.
       
   141         * @return ID indicating the selected language.
       
   142         */
       
   143         TInt DisplayTextLanguage();
       
   144 
       
   145         /**
       
   146         * Checks is Bluetooth SIM Access Profile active
       
   147         * @return ETrue if BT SAP is active
       
   148         */
       
   149         TBool IsBtSapActive();
       
   150 
       
   151         /**
       
   152         * From MMsvSessionObserver Indicates an event has occurred from a
       
   153         * Message Server session.
       
   154         * @param aEvent  Indicates the event type
       
   155         * @param aArg1  Event type-specific argument value
       
   156         * @param aArg2  Event type-specific argument value
       
   157         * @param aArg3  Event type-specific argument value
       
   158         */
       
   159         virtual void HandleSessionEventL(
       
   160             TMsvSessionEvent /*aEvent*/,
       
   161             TAny* /*aArg1*/,
       
   162             TAny* /*aArg2*/,
       
   163             TAny* /*aArg3*/) {};
       
   164             
       
   165         /**
       
   166         * From MSatSystemState Checks are phone warnings and game tones on.
       
   167         * @return TBool indicating wether phone are warnings and game tone on.
       
   168         */
       
   169         TBool IsWarningAndGameTonesOn();
       
   170 
       
   171     private:
       
   172 
       
   173         /**
       
   174         * C++ default constructor.
       
   175         * @param aPhone Reference to mobile phone
       
   176         */
       
   177         CSatSystemState( MSatMultiModeApi& aPhone );
       
   178 
       
   179         /**
       
   180         * By default Symbian 2nd phase constructor is private.
       
   181         */
       
   182         void ConstructL( MSatMultiModeApi& aPhone );
       
   183 
       
   184         /**
       
   185         * Reads current Short Message Service Center Address.
       
   186         * @param aAddress The reference for SCA number.
       
   187         */
       
   188         void ReadCurrentSMSCL( TDes& aAddress );
       
   189 
       
   190         /**
       
   191         * Specifies an entry in the Message Server index.
       
   192         * @param aSession The current message server session.
       
   193         * @param aMtm The SMS messaging type module UID.
       
   194         * @return The entry in the Message Server index.
       
   195         */
       
   196         TMsvId ServiceForMTML(
       
   197             CMsvSession& aSession,
       
   198             const TUid& aMtm ) const;
       
   199 
       
   200     private:    // Data
       
   201 
       
   202         // Network registration status monitor
       
   203         CSatNetworkRegStatusMonitor* iNetworkRegStatusMonitor;
       
   204 
       
   205         // Descriptor for SCA number
       
   206         TBuf<KMaxSCANumberSize> iScaAddress;
       
   207 
       
   208         // Reference for MSatMultiModeApi
       
   209         MSatMultiModeApi& iPhone;
       
   210 
       
   211     };
       
   212 
       
   213 #endif      // CSATSYSTEMSTATE_H
       
   214 
       
   215 // End of File