diff -r f5907b1a1053 -r 0396474f30f5 emailservices/emailstore/base_plugin/inc/basepluginresourceloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailstore/base_plugin/inc/basepluginresourceloader.h Mon Mar 15 12:39:10 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2010 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: Library to handle resource loading when +* CCoeEnv is not available. +*/ + +#ifndef __BASEPLUGINRESOURCELOADER_H__ +#define __BASEPLUGINRESOURCELOADER_H__ + +// INCLUDES +#include +#include +#include + +/** + * Library to handle resource loading when CCoeEnv is not available. + */ +class CResourceLoader : public CBase + { +public: + + /** + * A constructor. + * @param aName a resource name + * @return created object. + */ + IMPORT_C static CResourceLoader* NewL( const TDesC& aName ); + + /** + * Destructor + */ + virtual ~CResourceLoader(); + + /** + * @return reference to opened file session + */ + IMPORT_C RFs& Fs(); + + /** + * @param aResourceId a resource key + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* LoadLC(TInt aResourceId ); + + /** + * @param aReader a reader + * @param aResourceId a resource key + * @return pointer to resource buffer placed on leave stack + */ + IMPORT_C HBufC8* CreateResourceReaderLC( TResourceReader& aReader,TInt aResourceId ) const; + +private: + + /** + * A constructor + */ + CResourceLoader(); + + /** + * A 2nd phase constructor + * @param aName a HTML macro, e.g. lt + */ + void ConstructL( const TDesC& aName ); + +private: + + RFs iFs; + RResourceFile iResFile; + }; + + +#endif // __BASEPLUGINRESOURCELOADER_H__