xcfw/inc/xcfwlocalizer.h
author Christian Morlok <symbian.org@christianmorlok.de>
Wed, 07 Apr 2010 14:35:19 +0200
branchv5backport
changeset 54 666a2952b5b3
parent 0 79c6a41cd166
permissions -rw-r--r--
renamed dlls+exe to prevent conflicts with existing files in emulator; changelog attached. * renamed dlls/exe: - aifw.dll to aifw_hs.dll - cputils to cputils_hs - aiidleint.dll to aiidleint_hs.dll - aiutils.dll to aiutils_hs.dll - MenuInterface.dll to MenuInterface_hs.dll - XCFW.dll to XCFW_hs.dll - homescreen.exe to homescreen_hs.exe - ailaunch.exe to ailaunch_hs.exe * new UID for Active Idle (aifw_hs.dll, aiidleint_hs.dll and homescreen.exe): #define AI_UID3_AIFW_COMMON 0xEDFF45C4 (was 0x102750F0 = 271012080) * new UID for cputils_hs.dll: 0xE3E7134E (was 0x20016B7F = 536963967) * new UID for AI Utilities Factory (aiutils_hs.dll): 0xEC55106C (was 0x10281865 = 271063141) * new UID for MenuInterface_hs.dll: 0xEEE24485 (was 0x10210EAB = 270601899) * new UID for XCFW_hs.dll: 0xEB12332F (was 0x10210EA0 = 270601888) * new UID for ailaunch_hs.exe: 0xEF5A047A (was 0x200286E3 = 537036515)

/*
* Copyright (c) 2002-2005 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:  Class definition of XCFW DTD handler responsible for 
*                entity conversions (localization)
*
*/



#ifndef CXCFWLOCALIZER_H
#define CXCFWLOCALIZER_H

//  INCLUDES
#include <s32std.h>
#include <badesca.h>
//#include <gmxmlentityconverter.h>
//#include <gmxmlcomposer.h>

// FORWARD DECLARATIONS
class RFileReadStream;
class RFs;

/**
* Localization handling class. Responsible for holding entity references 
* and their corresponding text values loaded from a DTD file. Used for content 
* localization purposes in XCFW.
*
*  @lib XCFW_hs_hs.lib
*  @since Series 60 3.1
*/
class CXCFWLocalizer :  public CBase //CMDXMLEntityConverter
    {
    public:  // Constructors and destructor
        
        /**
        * Two-phased constructor.
        * @param aData Node data object
        */
        static CXCFWLocalizer* NewL();

        /**
        * Destructor.
        */
        virtual ~CXCFWLocalizer();

    public: // New functions
        
        /**
        * Loads Entity references from DTD file
        * @since Series 60 3.1
        * @param aDTD File to load
        * @param aFs File system handle to use
        * @param aStatus Engine's request status, which Localizer will
        *   complete when DTD parsing is ready
        */
        void LoadDTDL(const TDesC& aDTD, 
            RFs& aFileSystem, 
            TRequestStatus* aStatus );
        
        /**
        * Converts a XML entity reference to localized text
        * @since Series 60 3.1
        * @param aRef Entity reference to convert
        * @param aText Localized text returned
        * @return Error code, e.g. KErrNotFound if given entity reference
        *  is not found.
        */
        TInt EntityRefToText(TDesC& aRef, TPtrC& aText);
        
        /** 
        * Converts given localized text into an entity reference
        * @s
        ince Series 60 3.1
        * @param aText text to get entity reference for
        * @param aRef Entity reference returned
        * @return Error code, e.g. KErrNotFound if no entity reference
        *  is found for the given text.
        */
        TInt TextToEntityRef(TDesC& aText, TPtrC& aRef);
        
        /**
        * Returns error code from the last LoadDTDL operation
        * Engine uses this to check that operation was successful when
        * Localizer completes the pending request.
        * @since Series 60 3.1
        * @return Error code from latest DTD load operation
        */
        TInt LastError();

    private:

        /**
        * C++ default constructor.
        */
        CXCFWLocalizer();

        /**
        * By default Symbian 2nd phase constructor is private.
        */
        void ConstructL();

        /**
        * DTD file parsing facility
        * @param aStream file stream to parse
        * @since Series 60 3.1
        */
        void ParseDTDL( RFileReadStream& aStream );

    private:    // Data
        
        //Descriptor arrays for entity references and texts
        CDesCArraySeg*  iReferences; //Own: Entity references without & and ;
        CDesCArraySeg*  iLocStrings; //Own: Localized texts
        TRequestStatus* iStatus; //Not owned: 
                
    };

#endif      // CXCFWLOCALIZER_H   
            
// End of File