stringloader.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : StringLoader.h
00004 *  Part of     : Common Service / Common Engine
00005 *  Interface   : SDK, String Loader API
00006 *  Description : String Loader API provides methods for loading resource
00007 *                strings and formatting them.
00008 *  Version     : %version: ou1s60rt#16 %
00009 *
00010 *  Copyright © 2002-2006 Nokia. All rights reserved.
00011 *  This material, including documentation and any related
00012 *  computer programs, is protected by copyright controlled by
00013 *  Nokia. All rights are reserved. Copying, including
00014 *  reproducing, storing, adapting or translating, any
00015 *  or all of this material requires the prior written consent of
00016 *  Nokia. This material also contains confidential
00017 *  information which may not be disclosed
00018 * ============================================================================
00019 */
00020 #ifndef STRINGLOADER_H
00021 #define STRINGLOADER_H
00022 
00023 // INCLUDE FILES
00024 #include    <coemain.h>
00025 #include    <biditext.h>
00026 
00027 // CLASS DECLARATION
00028 
00204 class StringLoader
00205     {
00206     public:
00207 
00223         IMPORT_C static void Load( TDes& aDest, TInt aResourceId,
00224                                    CCoeEnv* aLoaderEnv = NULL );
00225 
00263         IMPORT_C static void Format( TDes& aDest, const TDesC& aSource,
00264                                    TInt aPosition, TInt aSubs );
00265 
00304         IMPORT_C static void Format( TDes& aDest, const TDesC& aSource,
00305                                    TInt aPosition, const TDesC& aSubs );
00306 
00320         IMPORT_C static HBufC* LoadL( TInt aResourceId,
00321                                       CCoeEnv* aLoaderEnv = NULL );
00322 
00342         IMPORT_C static HBufC* LoadL( TInt aResourceId, TInt aInt,
00343                                       CCoeEnv* aLoaderEnv = NULL );
00344 
00364         IMPORT_C static HBufC* LoadL( TInt aResourceId,
00365                                     const TDesC& aString,
00366                                     CCoeEnv* aLoaderEnv = NULL );
00367 
00390         IMPORT_C static HBufC* LoadL( TInt aResourceId, const TDesC& aString,
00391                                     TInt aInt, CCoeEnv* aLoaderEnv = NULL );
00392 
00413         IMPORT_C static HBufC* LoadL( TInt aResourceId,
00414                                     const CArrayFix<TInt>& aInts,
00415                                     CCoeEnv* aLoaderEnv = NULL );
00416 
00438         IMPORT_C static HBufC* LoadL( TInt aResourceId,
00439                                     const MDesCArray& aStrings,
00440                                     CCoeEnv* aLoaderEnv = NULL );
00441 
00465         IMPORT_C static HBufC* LoadL( TInt aResourceId,
00466                                     const MDesCArray& aStrings,
00467                                     const CArrayFix<TInt>& aInts,
00468                                     CCoeEnv* aLoaderEnv = NULL );
00484         IMPORT_C static HBufC* LoadLC( TInt aResourceId,
00485                                         CCoeEnv* aLoaderEnv = NULL );
00486 
00507         IMPORT_C static HBufC* LoadLC( TInt aResourceId, TInt aInt,
00508                                         CCoeEnv* aLoaderEnv = NULL );
00509 
00530         IMPORT_C static HBufC* LoadLC( TInt aResourceId,
00531                                     const TDesC& aString,
00532                                     CCoeEnv* aLoaderEnv = NULL );
00533 
00557         IMPORT_C static HBufC* LoadLC( TInt aResourceId, const TDesC& aString,
00558                                     TInt aInt, CCoeEnv* aLoaderEnv = NULL );
00559 
00582         IMPORT_C static HBufC* LoadLC( TInt aResourceId,
00583                                     const CArrayFix<TInt>& aInts,
00584                                     CCoeEnv* aLoaderEnv = NULL );
00585 
00608         IMPORT_C static HBufC* LoadLC( TInt aResourceId,
00609                                     const MDesCArray& aStrings,
00610                                     CCoeEnv* aLoaderEnv = NULL );
00611 
00636         IMPORT_C static HBufC* LoadLC( TInt aResourceId,
00637                                     const MDesCArray& aStrings,
00638                                     const CArrayFix<TInt>& aInts,
00639                                     CCoeEnv* aLoaderEnv = NULL );
00640 
00641     private:
00642 
00646         StringLoader();
00647 
00648         // Prohibit copy constructor
00649         StringLoader( const StringLoader& );
00650         // Prohibit assigment operator
00651         StringLoader& operator= ( const StringLoader& );
00652 
00666         static HBufC* FormatStringL(
00667             const TDesC& aSource,
00668             const TDesC& aKey,
00669             const TDesC& aSubs,
00670             TBidiText::TDirectionality aDir
00671             );
00672 
00689         static HBufC* FormatStringL(
00690             const TDesC& aSource,
00691             const TDesC& aKey,
00692             const TDesC& aSubs,
00693             TBidiText::TDirectionality aDirectionality,
00694             TInt& aParamCount,
00695             TInt aSubCount 
00696             );
00697 
00707         static HBufC* FormatStringL( TDesC& aSource,
00708                                    const CArrayFix<TInt>& aInts,
00709                                    TInt aMax, 
00710                                    TBidiText::TDirectionality aDir 
00711                                    );
00712 
00725         static HBufC* FormatStringL( TDesC& aSource,
00726                                    const MDesCArray& aStrings,
00727                                    TInt aMax,
00728                                    TBidiText::TDirectionality aDir
00729                                    );
00743         static TInt Formater(
00744             TDes& aDest,
00745             const TDesC& aSource,
00746             const TDesC& aKey,
00747             const TDesC& aSubs,
00748             TBidiText::TDirectionality aDirectionality
00749             );
00750 
00760         static void KeyStringFormater( TDes& aDest, const TText& aKey,
00761                                         TInt aPosition, const TDesC& aKeyString );
00762         
00767         static TBidiText::TDirectionality ResolveDirectionality( TDes& aText, TBool* aFound );
00768 
00777         static TInt GetParamCount( const TDesC& aText, TInt aIndex = -1);
00778 
00788         static TInt GetSubStringCount( const TDesC& aText );
00789         
00794         static TBidiText::TDirectionality DirectionalityL( const TDesC& aText, TBool* aFound );
00795         
00799         static HBufC* ResolveSubStringDirsL( TDes& aText, TInt aCount, TBool* aMarker );
00800         
00810         static HBufC* ResolveSubStringL( TDes& aText, TBool* aMarker );
00811         
00817         static void RemoveNoDirMarkers( TDes& aText );
00818     
00822         static void FormatL( TDes& aDest, const TDesC& aSource,
00823                              const TDesC& aKeybuf, const TDesC& aSubs );
00824     };
00825 
00826 // STRINGLOADER_H
00827 #endif
00828 
00829 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top