menufw/hierarchynavigator/hnmetadatamodel/inc/hnstringhandler.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HNSTRINGHANDLER_H
       
    20 #define HNSTRINGHANDLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class CDesC16Array;
       
    25 struct THnMdCommonPointers;
       
    26 
       
    27 /**
       
    28  * String Handler.
       
    29  * 
       
    30  * Contains static methods for strings manipulation.
       
    31  *
       
    32  * @lib hnmetadatamodel
       
    33  * @since S60 5.0
       
    34  * @ingroup group_hnmetadatamodel
       
    35  */
       
    36 NONSHARABLE_CLASS(HnStringHandler)
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Localize given string
       
    41      * it is given in format 
       
    42      * @verbatim <namespace>:<id> @endverbatim 
       
    43      * namespace can be declared in XML
       
    44      * it also accepts format myapp.rsc:MY_RESOURCE
       
    45      * 
       
    46      * @param aDestination destiation where localized text is returned
       
    47      * @param aSource string to localize
       
    48      * @param aCmnPtrs common pointers, if not given, 
       
    49      *  taken from THnMdCommonPointers::Static()
       
    50      */
       
    51     static void LocaliseL(  RBuf& aDestination, RBuf& aSource,
       
    52                            THnMdCommonPointers* aCmnPtrs );
       
    53     /**
       
    54      * Localize given string
       
    55      * it is given in format 
       
    56      * @verbatim <namespace>:<id> @endverbatim
       
    57      * namespace can be declared in XML
       
    58      * it also accepts format myapp.rsc:MY_RESOURCE
       
    59      * It formats string based on parameters provided.
       
    60      * 
       
    61      * @param aDestination destiation where localized text is returned
       
    62      * @param aSource string to localize
       
    63      * @param aDesParams list descriptor parameters to format %U, %0U
       
    64      * @param aIntParams list integer parameters to format %N, %0N
       
    65      * @param aCmnPtrs common pointers, if not given, 
       
    66      *  taken from THnMdCommonPointers::Static()
       
    67      */
       
    68     static void LocaliseL( RBuf& aDestination, RBuf& aSource, 
       
    69                             CDesC16Array* aDesParams,
       
    70                             CArrayFix<TInt>* aIntParams,
       
    71                             THnMdCommonPointers* aCmnPtrs );
       
    72     
       
    73     /**
       
    74      * Compares strings ignoring character case.
       
    75      * 
       
    76      * @param aLeft Base descriptor.
       
    77      * @param aRight Descriptor to be compared with the base descriptor.
       
    78      */
       
    79     static TInt CompareIgnoreCaseL( const TDesC& aLeft, const TDesC& aRight );
       
    80     
       
    81     /**
       
    82      * Compares strings ignoring character case.
       
    83      * 
       
    84      * @param aLeft Base descriptor.
       
    85      * @param aRight Descriptor to be compared with the base descriptor.
       
    86      */
       
    87     static TInt CompareIgnoreCaseL( const TDesC8& aLeft, const TDesC8& aRight );
       
    88     };
       
    89 
       
    90 #endif // HNSTRINGHANDLER_H