diff -r 000000000000 -r f72a12da539e menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalizationelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdlocalizationelement.h Thu Dec 17 08:40:49 2009 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2007-2008 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: +* +*/ + + + +#ifndef C_HNMDLOCALIZATIONELEMENT_H +#define C_HNMDLOCALIZATIONELEMENT_H + + +#include +#include //RHashMap +#include +#include + + +/** + * Localization Element. + * + * This is the localization element which is wrapped by the localization + * class. + * + * @lib hnmetadatamodel + * @since S60 5.0 + * @ingroup group_hnmetadatamodel + */ +NONSHARABLE_CLASS(CHnMdLocalizationElement) : public CBase + { + /** + * State of element - used for caching purpose + */ + enum TLocalizationElementStates { + EInitialized = 1, + EWholeFileCached = 2, + EUsedItemsCached = 4 + }; +public: + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aElement Xml element. + * @return Fully constructed element. + */ + static CHnMdLocalizationElement* NewL( TXmlEngElement aElement ); + + /** + * Two-phase constructor. + * + * @since S60 5.0 + * @param aNamespace namespace + * @param aSource source + * @return Fully constructed element. + */ + static CHnMdLocalizationElement* NewL( const TDesC& aNamespace, + const TDesC& aSource); + + /** + * Standard C++ virtal destructor. + * + * @since S60 5.0 + */ + virtual ~CHnMdLocalizationElement(); + + /** + * Gets namespace. + * + * @since S60 5.0 + * @return Namespace. + */ + const TDesC& Namespace() const; + + /** + * Gets source. + * + * @since S60 5.0 + * @return Source. + */ + const TDesC& Source() const; + + /** + * Gets source path. + * + * @since S60 5.0 + * @return Source. + */ + HBufC* SourcePath() const; + + /** + * Returns true if path to source exists. + * + * @since S60 5.0 + * @return Does path to source exist. + */ + TBool SourceExists() const; + + /** + * Reloads the resource file path. + * + * @since S60 5.0 + */ + void LocateLanguageFileL(); + + /** + * Gets resource id from corresponsing rsg if exist + * Inside it implemented caching mechanism + * If file is small ( iResourceIDs; + + /** + * State of element. + */ + TInt iState; + }; + +#endif // C_HNMMLOCALIZATIONELEMENT_H