1.1 --- a/epoc32/include/coneresloader.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/coneresloader.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,134 +1,47 @@
1.4 /*
1.5 -* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 * All rights reserved.
1.8 * This component and the accompanying materials are made available
1.9 -* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* under the terms of "Eclipse Public License v1.0"
1.11 * which accompanies this distribution, and is available
1.12 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.13 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.14 *
1.15 * Initial Contributors:
1.16 * Nokia Corporation - initial contribution.
1.17 *
1.18 * Contributors:
1.19 *
1.20 -* Description: Cone Resource Loader API enables adding and removing
1.21 -* localized resource files into the CONE environment.
1.22 +* Description:
1.23 *
1.24 */
1.25
1.26
1.27 +
1.28 #ifndef CONERESLOADER_H
1.29 #define CONERESLOADER_H
1.30
1.31 -// forward declarations
1.32 +#include <e32std.h>
1.33 +
1.34 class CCoeEnv;
1.35
1.36 -/**
1.37 -* Class encapsulates methods for opening and closing localised resource files
1.38 -* in the CONE environment. The actual reading of resources from an opened
1.39 -* resource file is done using various CCoeEnv provided resource-reading
1.40 -* methods. Cone Resource Loader API consist of the RConeResourceLoader class.
1.41 -*
1.42 -* Only one resource at a time may be open by one RConeResourceLoader instance.
1.43 -* You can use several RConeResourceLoader instances for accessing several
1.44 -* resources simultaneously or use one instance and close the previous resource
1.45 -* before opening a new one.
1.46 -*
1.47 -* The implementation uses BaflUtils::NearestLanguageFile to search for
1.48 -* a localised resource in proper search order.
1.49 -*
1.50 -* Usage example:
1.51 -*
1.52 -* @code
1.53 -* #include <ConeResLoader.h>
1.54 -*
1.55 -* // Get CCoeEnv instance
1.56 -* CEikonEnv* eikEnv = CEikonEnv::Static();
1.57 -*
1.58 -* // Initialize loader
1.59 -* RConeResourceLoader rLoader(eikEnv);
1.60 -*
1.61 -* // Open resource file
1.62 -* _LIT( KSampleResourceFileName, "Z:\\System\\Apps\\sample\\sample.rsc" );
1.63 -* TFileName fileName(KSampleResourceFileName);
1.64 -* rLoader.OpenL(fileName);
1.65 -*
1.66 -* // Push resource loader to cleanup stack, so that it will always be properly
1.67 -* // closed when popped.
1.68 -* CleanupClosePushL(rLoader);
1.69 -*
1.70 -* // Read a resource
1.71 -* iSomeArray = eikEnv->ReadDesC16ArrayResourceL(R_SOME_RESOURCE);
1.72 -*
1.73 -* // Pop and destroy rLoader from stack.
1.74 -* // This also calls close on rLoader since CleanupClosePushL was used.
1.75 -* CleanupStack::PopAndDestroy(); // rLoader
1.76 -*
1.77 -* @endcode
1.78 -*
1.79 -* @lib commonengine.lib
1.80 -* @since S60 2.0
1.81 +NONSHARABLE_CLASS(RConeResourceLoader)
1.82 +/**
1.83 +@deprecated
1.84 +@see RCoeResourceLoader
1.85 +@note For compatibility with S60 only
1.86 */
1.87 -class RConeResourceLoader
1.88 - {
1.89 - public:
1.90 - /**
1.91 - * Constructor.
1.92 - *
1.93 - * @param aEnv is a reference to Control environment in which resource
1.94 - * is loaded.
1.95 - */
1.96 - IMPORT_C RConeResourceLoader(CCoeEnv& aEnv);
1.97 + {
1.98 +public:
1.99 + IMPORT_C RConeResourceLoader(CCoeEnv& aCoeEnv);
1.100 + IMPORT_C TInt Open(TFileName& aFileName);
1.101 + IMPORT_C void OpenL(TFileName& aFileName);
1.102 + IMPORT_C void Close();
1.103 +private:
1.104 + // Dummy members to make this the same size as a RCoeResourceLoader so
1.105 + // in-place construction of the RCoeResourceLoader will work
1.106 + void* iDummy1; // was CCoeEnv&
1.107 + TInt iDummy2; // was TInt
1.108 + };
1.109
1.110 - /**
1.111 - * Opens the resource file for reading. Only one resource may be open
1.112 - * at a time. Panics if this instance already has a file open.
1.113 - * The implementation uses BaflUtils::NearestLanguageFile to search
1.114 - * for a localized resource file in proper search order.
1.115 - *
1.116 - * @param aFileName is the resource file name to open. This parameter
1.117 - * value is changed to the best matching language file found. The drive
1.118 - * letter is required in the filename.
1.119 - * @return a Symbian OS error code.
1.120 - *
1.121 - * @panic KErrNotSupported The instance already has a file open.
1.122 - */
1.123 - IMPORT_C TInt Open(TFileName& aFileName);
1.124 +#endif // CONERESLOADER_H
1.125
1.126 - /**
1.127 - * Opens the resource file for reading. Only one resource may be open
1.128 - * at a time. Leaves if this instance already has a file open.
1.129 - * The implementation uses BaflUtils::NearestLanguageFile to search
1.130 - * for a localized resource file in proper search order.
1.131 - *
1.132 - * @param aFileName Reference for resource file name. Please
1.133 - * note that drive letter is required !
1.134 - *
1.135 - * @leave KErrNotSupported The instance already has a file open.
1.136 - */
1.137 - IMPORT_C void OpenL(TFileName& aFileName);
1.138 -
1.139 -
1.140 - /**
1.141 - * Closes the opened resource file, if one is open. Does nothing if no
1.142 - * file has been opened. New resource file may be opened after the
1.143 - * previous has been closed. Always remember to close the resource when
1.144 - * finished using it.
1.145 - */
1.146 - IMPORT_C void Close();
1.147 -
1.148 - private:
1.149 -
1.150 - // Prohibit copy constructor and assigment operator because not deriving from CBase.
1.151 - RConeResourceLoader(const RConeResourceLoader&);
1.152 - RConeResourceLoader& operator= ( const RConeResourceLoader& );
1.153 -
1.154 - // Needed for closing
1.155 - CCoeEnv& iEnv;
1.156 - TInt iResourceFileOffset;
1.157 - };
1.158 -
1.159 -
1.160 -#endif
1.161 -
1.162 -// End of File