phonebookui/Phonebook2/Presentation/inc/CPbk2LocalizedText.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 Localized Text.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2LOCALIZEDTEXT_H
       
    20 #define CPBK2LOCALIZEDTEXT_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class TResourceReader;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31  * CPbk2LocalizedText defines phonebook2 localized context sensitive text.
       
    32  * Localized text consist of context id and text. Context id defines the 
       
    33  * context, where text is used.
       
    34  *
       
    35  * Localized texts can be defined in resource files.
       
    36  *
       
    37  * @see PHONEBOOK2_LOCALIZED_TEXT
       
    38  */
       
    39 NONSHARABLE_CLASS( CPbk2LocalizedText ): public CBase
       
    40     {
       
    41     public: // Construtor and destructor
       
    42     
       
    43         /**
       
    44          * Symbian constructor. Creates and initializes new 
       
    45          * CPbk2LocalizedText object. Reads information from resource
       
    46          * file. Ownership is transferred to caller.
       
    47          *
       
    48          * @param aReader Reference to resource reader containing 
       
    49          *                localized text information.
       
    50          */
       
    51         static CPbk2LocalizedText* NewL( TResourceReader& aReader );
       
    52         
       
    53         /**
       
    54          * Symbian constructor. Creates and initializes new 
       
    55          * CPbk2LocalizedText object with given parameters. 
       
    56          * Ownership is transferred to caller.
       
    57          *
       
    58          * @param aUid Localized text's context id.
       
    59          * @param aText Localized text. Ownership is transferred.
       
    60          */        
       
    61         static CPbk2LocalizedText* NewL( 
       
    62                 TInt aUid, 
       
    63                 HBufC* aText );
       
    64         
       
    65         /**
       
    66          * Destructor.
       
    67          */
       
    68         ~CPbk2LocalizedText();
       
    69         
       
    70     public: // Interface
       
    71         /**
       
    72          * Fetches context id. Context id defines the context where localized
       
    73          * text should be used.
       
    74          * 
       
    75          * @return Context id
       
    76          */
       
    77         TInt ContextUid() const;
       
    78 
       
    79         /**
       
    80          * Fetches the localized text.
       
    81          *
       
    82          * @return Text
       
    83          */
       
    84         const TDesC& Text() const;
       
    85         
       
    86     private: // Implementation
       
    87         CPbk2LocalizedText();
       
    88         CPbk2LocalizedText(
       
    89                 TInt aUid, 
       
    90                 HBufC* aText );
       
    91         void ConstructL( TResourceReader& aReader );
       
    92         
       
    93     private: // Data
       
    94         /// Own: Context id
       
    95         TInt iContextUid;   // WORD context
       
    96         /// Own: Localized text buffer
       
    97         HBufC* iText;       // LTEXT text
       
    98     };
       
    99     
       
   100 #endif // CPBK2LOCALIZEDTEXT_H
       
   101 
       
   102 // End of file