profilesservices/ProfileEngine/EngSrc/CProfileNameImpl.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 name implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPROFILENAMEIMPL_H
       
    21 #define __CPROFILENAMEIMPL_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <MProfileName.h>
       
    25 #include <e32base.h>
       
    26 #include "MProfileSetName.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RWriteStream;
       
    30 class MProfilesNamesArray;
       
    31 class CRepository;
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Profile name implementation.
       
    36 *  This class implements MProfileName and MProfileSetName interfaces.
       
    37 *
       
    38 *  @lib ?library
       
    39 *  @since 2.0
       
    40 */
       
    41 NONSHARABLE_CLASS(CProfileNameImpl) : public CBase,
       
    42                          public MProfileName,
       
    43                          public MProfileSetName
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         */
       
    50         static CProfileNameImpl* NewL();
       
    51 
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         * @param aProfileId Profile ID
       
    55         * @param aProfileName Profile name
       
    56         */
       
    57         static CProfileNameImpl* NewLC(
       
    58             TInt aProfileId, const TDesC& aProfileName );
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         * @param aProfileId Profile ID
       
    63         * @param aProfileName Profile name
       
    64         * @param aShortName Profile short name
       
    65         * @param aNaviName Profile short name
       
    66         */
       
    67         static CProfileNameImpl* NewLC(
       
    68             TInt aProfileId,
       
    69             const TDesC& aProfileName,
       
    70             const TDesC& aShortName,
       
    71             const TDesC& aNaviName,
       
    72             const TDesC& aTitleName );
       
    73 
       
    74         /**
       
    75         * Two-phased copy-constructor.
       
    76         * @param aProfileNameImpl profile name implementation to be copied.
       
    77         */
       
    78         static CProfileNameImpl* NewLC(
       
    79                 const CProfileNameImpl& aProfileNameImpl );
       
    80             
       
    81         /**
       
    82         * Destructor.
       
    83         */
       
    84         virtual ~CProfileNameImpl();
       
    85 
       
    86     public: // New functions
       
    87 
       
    88         /**
       
    89         * Is profile names changed.
       
    90         * @since 2.0
       
    91         * @return ETrue if names is changed
       
    92         */
       
    93         TBool IsProfileNameChanged() const;
       
    94 
       
    95         /**
       
    96         * Set localised profile name.
       
    97         * @since 2.0
       
    98         * @param aNameArray Profiles names array
       
    99         */
       
   100         void SetLocalizedProfileNameL( const MProfilesNamesArray& aNameArray );
       
   101 
       
   102         /**
       
   103         * Set localised profile name.
       
   104         * @since 3.1
       
   105         * @param aNameImpl Profiles name impl from which the name and short name
       
   106         *        are copied into this Profile Name.
       
   107         * @param aUniquePart contains the part which is used to differentiate
       
   108         *        the automatically generated names from each other. This is
       
   109         *        merged in the name.
       
   110         */
       
   111         void SetLocalizedProfileNameL( const CProfileNameImpl& aNameImpl,
       
   112                                        const TDesC& aUniquePart );
       
   113     
       
   114         /**
       
   115         * Internalize data from the central repository.
       
   116         * @since 2.8
       
   117         * @param aCenRep Central Repository object to read the settings
       
   118         * @param aProfileId the id of the profile to be internalized
       
   119         */
       
   120         void InternalizeL( CRepository& aCenRep, TInt aProfileId );
       
   121 
       
   122         /**
       
   123         * Externalize data to the stream.
       
   124         * @since 2.0
       
   125         * @param aStream Write stream
       
   126         */
       
   127         void ExternalizeL( CRepository& aCenRep ) const;
       
   128 
       
   129     public: // Functions from base classes
       
   130 
       
   131         /**
       
   132         * From MProfileName.
       
   133         */
       
   134         virtual const TDesC& Name() const;
       
   135 
       
   136         /**
       
   137         * From MProfileName.
       
   138         */
       
   139         virtual TInt Id() const;
       
   140 
       
   141         /**
       
   142         * From MProfileSetName.
       
   143         */
       
   144         virtual void SetNameL( const TDesC& aName );
       
   145 
       
   146         /**
       
   147         * From MProfileName.
       
   148         */
       
   149         virtual const TDesC& ShortName() const;
       
   150 
       
   151         /**
       
   152         * From MProfileName.
       
   153         */
       
   154         virtual const TDesC& NaviName() const;
       
   155 
       
   156         /**
       
   157         * From MProfileName.
       
   158         */
       
   159         virtual const TDesC& TitleName() const;
       
   160 
       
   161     protected: // New functions
       
   162 
       
   163         /**
       
   164         * Set profile name, do not set iNameChanged.
       
   165         * @since 3.2
       
   166         * @param aName Profile name
       
   167         */
       
   168         void SetNameInternalL( HBufC*& aNameFieldRef, const TDesC& aName );
       
   169 
       
   170     private:
       
   171 
       
   172         /**
       
   173         * C++ default constructor.
       
   174         * @param aProfileId Profile ID
       
   175         */
       
   176         CProfileNameImpl( TInt aProfileId );
       
   177 
       
   178         /**
       
   179         * By default Symbian 2nd phase constructor is private.
       
   180         * @param aProfileName Profile name
       
   181         */
       
   182         void ConstructL( const TDesC& aProfileName );
       
   183 
       
   184         /**
       
   185         * By default Symbian 2nd phase constructor is private.
       
   186         * @param aProfileName Profile name
       
   187         * @param aShortName Profile short name
       
   188         * @param aNaviName Profile navi name
       
   189         */
       
   190         void ConstructL( const TDesC& aProfileName, const TDesC& aShortName,
       
   191                          const TDesC& aNaviName, const TDesC& aTitleName );
       
   192 
       
   193         /**
       
   194         * By default Symbian 2nd phase constructor is private.
       
   195         * @param aProfileNameImpl a profile name implementation to be copied.
       
   196         */
       
   197         void ConstructL( const CProfileNameImpl& aProfileNameImpl );
       
   198             
       
   199     private:    // Data
       
   200 
       
   201         // Own: Is name changed
       
   202         TBool iNameChanged;
       
   203 
       
   204         // Own: Profile ID
       
   205         TInt iId;
       
   206 
       
   207         // Own: Profile Name
       
   208         HBufC* iProfileName;
       
   209 
       
   210         // Own: Profile Name for navi pane with tabs
       
   211         HBufC* iShortName;
       
   212 
       
   213         // Own: Profile Name for navi pane
       
   214         HBufC* iNaviName;
       
   215 
       
   216         // Own: Profile Name for title pane
       
   217         HBufC* iTitleName;
       
   218 
       
   219     };
       
   220 
       
   221 #endif      // __CPROFILENAMEIMPL_H
       
   222 
       
   223 // End of File