profilesservices/ProfileEngine/EngSrc/CProfileImpl.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 implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPROFILEIMPL_H__
       
    21 #define __CPROFILEIMPL_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MProfileExtended.h"
       
    26 #include <centralrepository.h> // NCentralRepositoryConstants::KMaxBinaryLength
       
    27 
       
    28 // CONSTANTS
       
    29 // MACROS
       
    30 // DATA TYPES
       
    31 // FUNCTION PROTOTYPES
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CProfileNameImpl;
       
    35 class CProfileTonesImpl;
       
    36 class CProfilePresenceImpl;
       
    37 class CProfileExtraTonesImpl;
       
    38 class CProfileExtraSettingsImpl;
       
    39 class CPGFileGenerator;
       
    40 class MProfilesNamesArray;
       
    41 class MProfilesLocalFeatures;
       
    42 struct TProfilePresenceSettings;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  Profile implementation.
       
    48 *
       
    49 *  @lib ?library
       
    50 *  @since 2.0
       
    51 */
       
    52 NONSHARABLE_CLASS(CProfileImpl) : public CBase,
       
    53                      public MProfileExtended
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         * @param aFs Ref. to file server session.
       
    60         */
       
    61         static CProfileImpl* NewL( RFs& aFs );
       
    62 
       
    63         /**
       
    64         * Two-phased constructor.
       
    65         * @param aFs Ref. to file server session.
       
    66         */
       
    67         static CProfileImpl* NewLC( RFs& aFs );
       
    68 
       
    69         /**
       
    70         * Two-phased constructor. Copy constructor.
       
    71         * @param aFs Ref. to file server session
       
    72         * @param aProfile Profile settings
       
    73         * @param aId Profile ID
       
    74         */
       
    75         static CProfileImpl* NewLC(
       
    76             RFs& aFs, const MProfileExtended& aProfile, TInt aId );
       
    77 
       
    78         /**
       
    79         * Destructor.
       
    80         */
       
    81         virtual ~CProfileImpl();
       
    82 
       
    83     public: // New functions
       
    84 
       
    85         /**
       
    86         * Is profile names changed.
       
    87         * @since 2.0
       
    88         * @return ETrue if profile name is changed
       
    89         */
       
    90         TBool IsProfileNameChanged() const;
       
    91 
       
    92         /**
       
    93         * Set profile localized name.
       
    94         * @since 2.0
       
    95         * @param aNameArray Profiles names array
       
    96         */
       
    97         void SetLocalizedProfileNameL( const MProfilesNamesArray& aNameArray );
       
    98 
       
    99         /**
       
   100         * Set localised profile name.
       
   101         * @since 3.1
       
   102         * @param aNameImpl Profiles name impl from which the name and short name
       
   103         *        are copied into this Profile.
       
   104         * @param aUniquePart contains the part which is used to differentiate
       
   105         *        the automatically generated names from each other. This is
       
   106         *        merged in the name.
       
   107         */
       
   108         void SetLocalizedProfileNameL( const CProfileNameImpl& aNameImpl,
       
   109                                        const TDesC& aUniquePart );
       
   110 
       
   111         /**
       
   112         * Internalize data from the central repository.
       
   113         * @since 2.8
       
   114         * @param aCenRep Central Repository object to read the settings
       
   115         * @param aProfileId the id of the profile to be internalized
       
   116         */
       
   117         void InternalizeL( CRepository& aCenRep, TInt aProfileId );
       
   118 
       
   119     public: // Functions from base classes
       
   120 
       
   121         /**
       
   122         * From MProfile.
       
   123         */
       
   124         virtual void Release();
       
   125 
       
   126         /**
       
   127         * From MProfile.
       
   128         */
       
   129         virtual const TArray<TContactItemId> AlertForL();
       
   130 
       
   131         /**
       
   132         * From MProfile.
       
   133         */
       
   134         virtual TBool IsSilent() const;
       
   135 
       
   136         /**
       
   137         * From MProfile.
       
   138         */
       
   139         virtual const MProfileName& ProfileName() const;
       
   140 
       
   141         /**
       
   142         * From MProfile.
       
   143         */
       
   144         virtual const MProfileTones& ProfileTones() const;
       
   145 
       
   146         /**
       
   147         * From MProfile.
       
   148         */
       
   149         virtual const MProfileExtraTones& ProfileExtraTones() const;
       
   150 
       
   151         /**
       
   152         * From MProfileExtended.
       
   153         */
       
   154         virtual void SetAlertForL( const TArray<TContactItemId>& aAlertFor );
       
   155 
       
   156         /**
       
   157         * From MProfileExtended.
       
   158         */
       
   159         virtual MProfileSetName& ProfileSetName() const;
       
   160 
       
   161         /**
       
   162         * From MProfileExtended.
       
   163         */
       
   164         virtual MProfileSetTones& ProfileSetTones() const;
       
   165 
       
   166         /**
       
   167         * From MProfileExtended.
       
   168         */
       
   169         virtual const MProfilePresence& ProfilePresence() const;
       
   170 
       
   171         /**
       
   172         * From MProfileExtended.
       
   173         */
       
   174         virtual MProfileSetPresence& ProfileSetPresence() const;
       
   175 
       
   176         /**
       
   177         * From MProfileExtended.
       
   178         */
       
   179         virtual MProfileSetExtraTones& ProfileSetExtraTones() const;
       
   180 
       
   181         /**
       
   182         * From MProfileExtended.
       
   183         */
       
   184         virtual TUint32 ModifiableFlags() const;
       
   185 
       
   186         /**
       
   187         * From MProfileExtended.
       
   188         */
       
   189         virtual TUint32 VisibleFlags() const;
       
   190 
       
   191         /**
       
   192         * From MProfile.
       
   193         */
       
   194         virtual const MProfileExtraSettings& ProfileExtraSettings() const;
       
   195 
       
   196         /**
       
   197         * From MProfileExtended.
       
   198         */
       
   199         virtual MProfileSetExtraSettings& ProfileSetExtraSettings() const;
       
   200 
       
   201         /**
       
   202         * Externalize data to Central Repository.
       
   203         * @since 2.8
       
   204         * @param aCenRep Central Repository object to write the settings
       
   205         */
       
   206         void ExternalizeL( CRepository& aCenRep );
       
   207 
       
   208     private:
       
   209 
       
   210         /**
       
   211         * C++ default constructor.
       
   212         * aParam aFs Ref. to file server session
       
   213         */
       
   214         CProfileImpl( RFs& aFs );
       
   215 
       
   216         /**
       
   217         * By default Symbian 2nd phase constructor is private.
       
   218         */
       
   219         void ConstructL();
       
   220 
       
   221         /**
       
   222         * By default Symbian 2nd phase constructor is private.
       
   223         * @param aProfile Profile settings
       
   224         * @param aId Profile ID
       
   225         */
       
   226         void ConstructL( const MProfileExtended& aProfile, TInt aId );
       
   227 
       
   228         /**
       
   229          * This method does the common part of the construction.
       
   230          */
       
   231         void CommonConstructL();
       
   232 
       
   233     private:    // Data
       
   234 
       
   235         // Own: Contact item array for alert for settings.
       
   236         RArray<TContactItemId> iAlertFor;
       
   237 
       
   238         // Own: Profile name implementation
       
   239         CProfileNameImpl* iProfileName;
       
   240 
       
   241         // Own: Profile tone settings implementation
       
   242         CProfileTonesImpl* iProfileTones;
       
   243 
       
   244         // Own: Profile extra tones settings implementation
       
   245         CProfileExtraTonesImpl* iProfileExtraTones;
       
   246 
       
   247         // Own: Profile extra settings implementation
       
   248         CProfileExtraSettingsImpl* iProfileExtraSettings;
       
   249 
       
   250         // Own: Profile presence settings implementation
       
   251         CProfilePresenceImpl* iProfilePresence;
       
   252 
       
   253         // Own: Profile modifiable flags
       
   254         TUint32 iModifiableFlags;
       
   255 
       
   256         // Own: Profile visible flags
       
   257         TUint32 iVisibleFlags;
       
   258 
       
   259         // Ref: File Server session
       
   260         RFs& iFs;
       
   261 
       
   262         // Not owned: Locally variated features of Profiles:
       
   263         MProfilesLocalFeatures* iFeatures;
       
   264 
       
   265         // Own: Contains the path to the empty sound file:
       
   266         HBufC* iSilentTone;
       
   267 
       
   268         // Buffer for storing/reading alert for groups in/from CenRep:
       
   269         TBuf8< NCentralRepositoryConstants::KMaxBinaryLength > iAlertForBuf;
       
   270 
       
   271         // Supported features
       
   272         TBool iAlwaysOnLineEmail;
       
   273         TBool iOmaPoc;
       
   274     };
       
   275 
       
   276 #endif      // __CPROFILEIMPL_H__
       
   277 
       
   278 // End of File