apengine/apsettingshandlerui/inc/TextOverrides.h
changeset 71 9f263f780e41
parent 70 ac5daea24fb0
child 72 0c32cf868819
equal deleted inserted replaced
70:ac5daea24fb0 71:9f263f780e41
     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: 
       
    15 *     Declares the CTextOverrides class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef TEXT_OVERRIDES_H
       
    21 #define TEXT_OVERRIDES_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <commdb.h>
       
    27 
       
    28 #include <ApSettingsHandlerCommons.h>
       
    29 
       
    30 // CONST
       
    31 const TInt  KTxtOverrideGran   = KTTextIdMax+1;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * CTextOverrides class: It is a helper class for the Access Point settings.
       
    37 *
       
    38 */
       
    39 NONSHARABLE_CLASS( CTextOverrides ) : public CBase
       
    40     {
       
    41 
       
    42     public: // Constructors and destructor
       
    43 
       
    44 
       
    45         /**
       
    46         * Two-phased constructor. Leaves on failure.
       
    47         * @return The constructed CTextOverrides.
       
    48         */
       
    49         static CTextOverrides* NewL();
       
    50 
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         ~CTextOverrides();
       
    56 
       
    57 
       
    58     protected:
       
    59         /**
       
    60         * Constructor.
       
    61         */
       
    62         CTextOverrides();
       
    63 
       
    64 
       
    65         /**
       
    66         * Second-phase constructor.
       
    67         */
       
    68         void ConstructL();
       
    69 
       
    70 
       
    71 
       
    72     public: // New functions
       
    73         /**
       
    74         * Sets possible overrides of some texts.
       
    75         * By default, text is read from resources. This provides a way to 
       
    76         * change some of the text to a caller-supplied one. The text must 
       
    77         * be read from resource and must be already localized.
       
    78         * More than one text can be substituted, they are stored internally 
       
    79         * in an array.
       
    80         * @param aText2Change TTextID to identify the text to be replaced with
       
    81         * @param aNewText Reference to the substitute text.
       
    82         */
       
    83         void SetTextOverrideL( TTextID aText2Change, const TDesC& aNewText );
       
    84 
       
    85 
       
    86         /**
       
    87         * Gets overrides of the given text.
       
    88         * By default, text is read from resources. This provides a way to 
       
    89         * change some of the text to a caller-supplied one. The text must 
       
    90         * be read from resource and must be already localized.
       
    91         * More than one text can be substituted, they are stored internally 
       
    92         * in an array.
       
    93         * @param aTextId TTextID type to identify the text to get
       
    94         * @return Reference to the overriding text.
       
    95         */
       
    96         const TDesC& TextOverrideL( TTextID aTextId );
       
    97 
       
    98         /**
       
    99         * Checks whether a given text is overriden or not.
       
   100         * By default, text is read from resources. This provides a way to 
       
   101         * change some of the text to a caller-supplied one. The text must 
       
   102         * be read from resource and must be already localized.
       
   103         * More than one text can be substituted, they are stored internally
       
   104         * in an array.
       
   105         * @param aTextId TTextID type to identify the text to check
       
   106         * @return Boolean indicatiing whether the given text is 
       
   107         * overriden or not.
       
   108         */
       
   109         TBool IsTextOverridenL( TTextID aTextId );
       
   110 
       
   111         /*
       
   112         * Validates the passed ID. If invalid, leaves with KErrInvalidTextId
       
   113         * @param aTextId The text ID to validate
       
   114         */
       
   115         void ValidateIdL( TTextID aTextId );
       
   116 
       
   117     private: //data
       
   118         CArrayPtrFlat<HBufC>*   iTxtArray;
       
   119 
       
   120     };
       
   121 
       
   122 #endif
       
   123 
       
   124 // End of File