devicesrv_plat/syslangutil_api/inc/syslangutil.h
author William Roberts <williamr@symbian.org>
Sun, 14 Mar 2010 13:15:06 +0000
branchCompilerCompatibility
changeset 6 91ba8de50d7b
parent 0 4e1aa6a622a0
child 52 d6b9e89d80a3
permissions -rw-r--r--
Automatic merge from PDK_3.0.h

/*
* Copyright (c) 2000-2007 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Declaration of SysLangUtil class.
*
*/


#ifndef SYSLANGUTIL_H
#define SYSLANGUTIL_H

#include <e32base.h>

class RFs;

/**
*  Language selection -related utility methods.
*
*  ?more_complete_description
*
*  @lib SysLangUtil.lib
*  @since S60 3.0
*/
class SysLangUtil
    {

public:

    /**
    * Checks if language given as an argument is valid i.e. installed
    * language.
    * @param aLanguage returned Symbian language code matching SIM one.
    * @param aFileServerSession Optional file server session handle. If
    *           omitted, new one will be created.
    * @return ETrue if language is installed, otherwise returns EFalse.
    */
    IMPORT_C static TBool IsValidLanguage(
        const TInt& aLanguage,
        RFs* aFileServerSession = NULL );

    /**
    * Checks and returns the default language in a param given.
    * @param aLanguage  Symbian language as a number
    * @param aFileServerSession Optional file server session handle. If
    *           omitted, new one will be created.
    * @return returns KErrNone if everything went OK, otherwise returns
    *           the errorcode.
    */
    IMPORT_C static TInt GetDefaultLanguage(
        TInt& aLanguage,
        RFs* aFileServerSession = NULL );

    /**
    * Checks and returns installed languages in a param given.
    * @param aLanguages  Symbian languages as a arrayfixflat<int>, ownership
    *           given to user, so user must take care of proper cleanup!
    * @param aFileServerSession Optional file server session handle. If
    *           omitted, new one will be created.
    * @return returns KErrNone if everything went OK, otherwise returns
    *           the errorcode.
    */
    IMPORT_C static TInt GetInstalledLanguages(
        CArrayFixFlat<TInt>*& aLanguages,
        RFs* aFileServerSession = NULL );

    /**
    * Returns SIM preferred languages in a param given.
    * @param aLanguage Language that was stored in flash file system
    * @param aFileServerSession Optional file server session handle. If
    *           omitted, new one will be created.
    * @return returns KErrNone if everything went OK, otherwise returns
    *           the errorcode.
    */
    IMPORT_C static TInt RestoreSIMLanguage(
        TInt &aLanguage,
        RFs* aFileServerSession = NULL );

private:

    // Utility:

    static RFs* CheckFS( RFs* aRFs, TBool &aExist, TInt &aErr );

    };

#endif // SYSLANGUTIL_H