devicesrv_plat/syslangutil_api/inc/syslangutil.h
changeset 0 4e1aa6a622a0
child 52 d6b9e89d80a3
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2000-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:  Declaration of SysLangUtil class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SYSLANGUTIL_H
       
    20 #define SYSLANGUTIL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class RFs;
       
    25 
       
    26 /**
       
    27 *  Language selection -related utility methods.
       
    28 *
       
    29 *  ?more_complete_description
       
    30 *
       
    31 *  @lib SysLangUtil.lib
       
    32 *  @since S60 3.0
       
    33 */
       
    34 class SysLangUtil
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39     /**
       
    40     * Checks if language given as an argument is valid i.e. installed
       
    41     * language.
       
    42     * @param aLanguage returned Symbian language code matching SIM one.
       
    43     * @param aFileServerSession Optional file server session handle. If
       
    44     *           omitted, new one will be created.
       
    45     * @return ETrue if language is installed, otherwise returns EFalse.
       
    46     */
       
    47     IMPORT_C static TBool IsValidLanguage(
       
    48         const TInt& aLanguage,
       
    49         RFs* aFileServerSession = NULL );
       
    50 
       
    51     /**
       
    52     * Checks and returns the default language in a param given.
       
    53     * @param aLanguage  Symbian language as a number
       
    54     * @param aFileServerSession Optional file server session handle. If
       
    55     *           omitted, new one will be created.
       
    56     * @return returns KErrNone if everything went OK, otherwise returns
       
    57     *           the errorcode.
       
    58     */
       
    59     IMPORT_C static TInt GetDefaultLanguage(
       
    60         TInt& aLanguage,
       
    61         RFs* aFileServerSession = NULL );
       
    62 
       
    63     /**
       
    64     * Checks and returns installed languages in a param given.
       
    65     * @param aLanguages  Symbian languages as a arrayfixflat<int>, ownership
       
    66     *           given to user, so user must take care of proper cleanup!
       
    67     * @param aFileServerSession Optional file server session handle. If
       
    68     *           omitted, new one will be created.
       
    69     * @return returns KErrNone if everything went OK, otherwise returns
       
    70     *           the errorcode.
       
    71     */
       
    72     IMPORT_C static TInt GetInstalledLanguages(
       
    73         CArrayFixFlat<TInt>*& aLanguages,
       
    74         RFs* aFileServerSession = NULL );
       
    75 
       
    76     /**
       
    77     * Returns SIM preferred languages in a param given.
       
    78     * @param aLanguage Language that was stored in flash file system
       
    79     * @param aFileServerSession Optional file server session handle. If
       
    80     *           omitted, new one will be created.
       
    81     * @return returns KErrNone if everything went OK, otherwise returns
       
    82     *           the errorcode.
       
    83     */
       
    84     IMPORT_C static TInt RestoreSIMLanguage(
       
    85         TInt &aLanguage,
       
    86         RFs* aFileServerSession = NULL );
       
    87 
       
    88 private:
       
    89 
       
    90     // Utility:
       
    91 
       
    92     static RFs* CheckFS( RFs* aRFs, TBool &aExist, TInt &aErr );
       
    93 
       
    94     };
       
    95 
       
    96 #endif // SYSLANGUTIL_H