ncdengine/provider/deviceinteraction/inc/ncddeviceserviceimpl.h
changeset 0 ba25891c3a9e
child 42 d17dc5398051
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Declaration of CNcdDeviceService
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_NCD_DEVICE_SERVICE_IMPL_H
       
    20 #define C_NCD_DEVICE_SERVICE_IMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <AknsSrvClient.h>
       
    24 
       
    25 #include "ncddeviceservice.h"
       
    26 
       
    27 class CTelephony;
       
    28 class CNcdTestConfig;
       
    29 
       
    30 // Uncomment this if device ID should be retrieved from 
       
    31 // CUserAgent instead of CTelephony
       
    32 #define GET_DEVICE_ID_FROM_USERAGENT
       
    33 
       
    34 
       
    35 /**
       
    36  *
       
    37  */
       
    38 class CNcdDeviceService : public CActive,
       
    39                           public MNcdDeviceService
       
    40     {
       
    41 public: // Construction & destruction
       
    42 
       
    43     /**
       
    44      * Constructor.
       
    45      * @return CNcdDeviceService* Device service.
       
    46      */
       
    47     static CNcdDeviceService* NewL();
       
    48     
       
    49     /**
       
    50      * Constructor.
       
    51      * @return CNcdDeviceService* Device service.
       
    52      */
       
    53     static CNcdDeviceService* NewLC();
       
    54     
       
    55     /**
       
    56      * Destructor.
       
    57      */
       
    58     ~CNcdDeviceService();
       
    59     
       
    60 private: // Construction
       
    61 
       
    62     /**
       
    63      * Constructor.
       
    64      */
       
    65     CNcdDeviceService();
       
    66     
       
    67     void ConstructL();
       
    68 
       
    69 private: // From CActive
       
    70 
       
    71     void RunL();
       
    72     void DoCancel();
       
    73     TInt RunError( TInt aError );
       
    74 
       
    75 public: // From MNcdDeviceService
       
    76 
       
    77     /**
       
    78      * @see MNcdDeviceService::SetAsRingingToneL
       
    79      */
       
    80     void SetAsRingingToneL( const TDesC& aFileName );
       
    81 
       
    82     /**
       
    83      * @see MNcdDeviceService::SetAsWallpaper
       
    84      */
       
    85     void SetAsWallpaperL( const TDesC& aFileName );
       
    86 
       
    87     /**
       
    88      * @see MNcdDeviceService::SetAsThemeL
       
    89      */
       
    90     void SetAsThemeL( const TDesC& aThemeName );
       
    91 
       
    92     /**
       
    93      * @see MNcdDeviceService::CurrentThemeNameL
       
    94      */
       
    95     const TDesC& CurrentThemeNameL();
       
    96 
       
    97     /**
       
    98      * @see MNcdDeviceService::HomeNetworkInfoL
       
    99      */
       
   100     void HomeNetworkInfoL( TDes& aMCC, TDes& aMNC );
       
   101 
       
   102    
       
   103     /**
       
   104      * @see MNcdDeviceService::CurrentMccL
       
   105      */
       
   106     const TDesC& CurrentMccL();
       
   107     
       
   108     /**
       
   109      * @see MNcdDeviceService::CurrentMncL
       
   110      */
       
   111     const TDesC& CurrentMncL();
       
   112     
       
   113     
       
   114     /**
       
   115      * @see MNcdDeviceService::ServiceProviderL
       
   116      */
       
   117     void ServiceProviderL( TDes& aServiceProvider );
       
   118 
       
   119     /**
       
   120      * @see MNcdDeviceService::ImsiL()
       
   121      */
       
   122     const TDesC& ImsiL();
       
   123 
       
   124 
       
   125     const TDesC& ImeiL();
       
   126 
       
   127     /**
       
   128      * @see MNcdDeviceService::DeviceIdentificationLC()
       
   129      */
       
   130     HBufC* DeviceIdentificationLC();
       
   131 
       
   132 
       
   133     /**
       
   134      * @see MNcdDeviceService::DeviceManufacturerL()
       
   135      */
       
   136     const TDesC& DeviceManufacturerL();
       
   137 
       
   138 
       
   139     /**
       
   140      * @see MNcdDeviceService::DeviceModelL()
       
   141      */
       
   142     const TDesC& DeviceModelL();
       
   143     
       
   144     
       
   145     /**
       
   146      * @see MNcdDeviceService::Series60VersionL()
       
   147      */
       
   148     //TVersion Series60VersionL();
       
   149 
       
   150     /**
       
   151      * @see MNcdDeviceService::DeviceLanguageLC()
       
   152      */
       
   153     HBufC* DeviceLanguageLC();
       
   154     
       
   155     
       
   156     /** 
       
   157      * @see MNcdDeviceService::FirmwareL()
       
   158      */
       
   159     const TDesC& FirmwareL();
       
   160 
       
   161 
       
   162     void ConnectL();
       
   163     
       
   164     TInt Close();
       
   165     
       
   166 
       
   167     /** 
       
   168      * @see MNcdDeviceService::AppendVariantToFirmwareL()
       
   169      */
       
   170     void AppendVariantToFirmwareL( RFs& aFs );
       
   171     
       
   172     /**
       
   173      * see MNcdDeviceService::FlashPlayerUidL()
       
   174      */
       
   175     TUid FlashPlayerUidL();
       
   176     
       
   177     
       
   178     void InitializeL();
       
   179     
       
   180     /**
       
   181      * @see MNcdDeviceService::ProductCodeLC()
       
   182      */
       
   183     HBufC* ProductCodeLC();
       
   184     
       
   185     /**
       
   186      * @see MNcdDeviceService::GetProductType()
       
   187      */
       
   188     TInt GetProductType( TDes& aType, RFs& aFs );
       
   189 
       
   190     /**
       
   191      * @see MNcdDeviceService::GetFirmwareId()
       
   192      */
       
   193     TInt GetFirmwareId( TDes& aId, RFs& aFs );
       
   194     
       
   195     
       
   196     void GetFirmwareVersion1( TDes& aTarget );
       
   197 
       
   198     void GetFirmwareVersion2( TDes& aTarget );
       
   199     
       
   200     void GetFirmwareVersion3( TDes& aTarget, RFs& aFs );
       
   201         
       
   202     
       
   203 #ifdef CATALOGS_BUILD_CONFIG_DEBUG
       
   204     /**
       
   205      * Used to set a test configuration that overrides device config
       
   206      *
       
   207      * @note Ownership is transferred to the device service
       
   208      */
       
   209     void SetTestConfig( CNcdTestConfig* aTestConfig );
       
   210 #endif
       
   211 
       
   212 private: // New functions
       
   213 
       
   214     /**
       
   215      * Parses skin package location from path.
       
   216      * @param aPath Skin path.
       
   217      * @return TAknSkinSrvSkinPackageLocation Skin location.
       
   218      */
       
   219     TAknSkinSrvSkinPackageLocation SkinLocationFromPath( const TDesC& aPath );
       
   220     
       
   221 #ifdef GET_DEVICE_ID_FROM_USERAGENT    
       
   222     HBufC8* UserAgentL() const;
       
   223 #endif    
       
   224     
       
   225     void GetPhoneLC( RTelServer& aServer, RPhone& aPhone );
       
   226 
       
   227     void GetSubscriberId();
       
   228     
       
   229     void GetNetworkInfo();
       
   230             
       
   231     void GetNetworkRegistrationStatus();
       
   232 
       
   233     void WaitForInitL();
       
   234     
       
   235     void DeleteWait();
       
   236     
       
   237     // Finishes the initialization 
       
   238     void FinishInitialization();
       
   239 
       
   240     // Reads phone variant information and returns it
       
   241     HBufC* ReadVariantInformationLC( RFs& aFs );
       
   242     
       
   243 private:
       
   244 
       
   245     enum TDeviceServiceState
       
   246         {
       
   247         ENotInitialized = 0,
       
   248         EGetPhoneId,
       
   249         EGetSubscriberId,
       
   250         EGetNetworkInfo,        
       
   251         EInitialized
       
   252         };
       
   253     
       
   254 private: // data
       
   255 
       
   256     HBufC* iCurrentThemeName;    
       
   257 
       
   258     CTelephony* iTelephony;
       
   259     CTelephony::TPhoneIdV1 iPhoneIdV1;
       
   260     CTelephony::TPhoneIdV1Pckg iPhoneIdV1Pckg;
       
   261 
       
   262     CTelephony::TSubscriberIdV1 iSubscriberIdV1;
       
   263     CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg;
       
   264     
       
   265     CTelephony::TNetworkInfoV1 iNetworkInfoV1;
       
   266     CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg;
       
   267                 
       
   268     CActiveSchedulerWait* iWaiter;
       
   269     
       
   270     HBufC* iImsi;
       
   271     HBufC* iFirmware;    
       
   272 
       
   273     HBufC* iDeviceManufacturer;
       
   274     HBufC* iDeviceModel;
       
   275 
       
   276     RTelServer iServer;
       
   277     RMobilePhone iPhone;
       
   278     TBool iConnected;
       
   279     
       
   280     TDeviceServiceState iState;
       
   281     CTelephony::TCancellationRequest iCurrentCancelCode;
       
   282     
       
   283     TInt iError;
       
   284     
       
   285 #ifdef CATALOGS_BUILD_CONFIG_DEBUG
       
   286     CNcdTestConfig* iTestConfig;
       
   287 #endif
       
   288     };
       
   289 
       
   290 #endif // C_NCD_DEVICE_SERVICE_IMPL_H