profilesservices/ProfileEngine/EngSrc/CProfileTonesImpl.h
changeset 0 8c5d936e5675
child 8 f62c3a3d66b8
equal deleted inserted replaced
-1:000000000000 0:8c5d936e5675
       
     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:  Profile tones implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPROFILETONESIMPL_H
       
    21 #define __CPROFILETONESIMPL_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MProfileTones.h>
       
    26 #include <TProfileToneSettings.h>
       
    27 #include "MProfileSetTones.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class RWriteStream;
       
    31 class CRepository;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  Profile tones implementation.
       
    37 *  This class implements MProfileTones and MProfileSetTones interfaces.
       
    38 *
       
    39 *  @lib ?library
       
    40 *  @since 2.0
       
    41 */
       
    42 NONSHARABLE_CLASS(CProfileTonesImpl) : public CBase,
       
    43                           public MProfileTones,
       
    44                           public MProfileSetTones
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         static CProfileTonesImpl* NewL();
       
    52 
       
    53         /**
       
    54         * Two-phased constructor. Copy constructor.
       
    55         * @param aProfileTones Profile tones
       
    56         */
       
    57         static CProfileTonesImpl* NewL( const MProfileTones& aProfileTones );
       
    58 
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CProfileTonesImpl();
       
    63 
       
    64     public: // New functions
       
    65 
       
    66         /**
       
    67         * Internalize data from the central repository.
       
    68         * @since 2.8
       
    69         * @param aCenRep Central Repository object to read the settings
       
    70         * @param aProfileId the id of the profile to be internalized
       
    71         */
       
    72         void InternalizeL( CRepository& aCenRep, TInt aProfileId );
       
    73 
       
    74         /**
       
    75         * Externalize data to Central Repository.
       
    76         * @since 2.8
       
    77         * @param aCenRep Central Repository object to write the settings
       
    78         */
       
    79         void ExternalizeL( CRepository& aCenRep, TInt aProfileId ) const;
       
    80 
       
    81     public: // Functions from base classes
       
    82 
       
    83         /**
       
    84         * From MProfileTones.
       
    85         */
       
    86         virtual const TDesC& RingingTone1() const;
       
    87 
       
    88         /**
       
    89         * From MProfileTones.
       
    90         */
       
    91         virtual const TDesC& RingingTone2() const;
       
    92 
       
    93         /**
       
    94         * From MProfileTones.
       
    95         */
       
    96         virtual const TDesC& MessageAlertTone() const;
       
    97 
       
    98         /**
       
    99         * From MProfileTones.
       
   100         */
       
   101         virtual const TProfileToneSettings& ToneSettings() const;
       
   102 
       
   103         /**
       
   104         * From MProfileSetTones.
       
   105         */
       
   106         virtual void SetRingingTone1L( const TDesC& aRingingTone );
       
   107 
       
   108         /**
       
   109         * From MProfileSetTones.
       
   110         */
       
   111         virtual void SetRingingTone2L( const TDesC& aRingingTone );
       
   112 
       
   113         /**
       
   114         * From MProfileSetTones.
       
   115         */
       
   116         virtual void SetMessageAlertToneL( const TDesC& aMessageAlertTone );
       
   117 
       
   118         /**
       
   119         * From MProfileSetTones.
       
   120         */
       
   121         virtual TProfileToneSettings& SetToneSettings();
       
   122 
       
   123     private:
       
   124 
       
   125         /**
       
   126         * By default Symbian 2nd phase constructor is private.
       
   127         */
       
   128         void ConstructL();
       
   129 
       
   130         /**
       
   131         * By default Symbian 2nd phase constructor is private.
       
   132         * @param aProfileTones Profile tones
       
   133         */
       
   134         void ConstructL( const MProfileTones& aProfileTones );
       
   135 
       
   136     private:
       
   137         void InitPowerSaveMode();
       
   138         void ReadPowerSaveConfigL();
       
   139         
       
   140     private:    // Data
       
   141 
       
   142         // Own: Line 1 Ringing tone file name
       
   143         HBufC* iRingingTone1;
       
   144 
       
   145         // Own: Line 2 Ringing tone file name
       
   146         HBufC* iRingingTone2;
       
   147 
       
   148         // Own: Message alert tone file name
       
   149         HBufC* iMessageAlertTone;
       
   150 
       
   151         // Own: Tone settings
       
   152         TProfileToneSettings iProfileToneSettings;
       
   153         
       
   154         TInt iPsmConfigVibra;
       
   155         TInt iPsmConfigKeypadVolume;
       
   156         TBool iPowerSaveMode;
       
   157     };
       
   158 
       
   159 #endif      // __CPROFILETONESIMPL_H
       
   160 
       
   161 // End of File