Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Cone Resource Loader API enables adding and removing
15 * localized resource files into the CONE environment.
20 #ifndef CONERESLOADER_H
21 #define CONERESLOADER_H
23 // forward declarations
27 * Class encapsulates methods for opening and closing localised resource files
28 * in the CONE environment. The actual reading of resources from an opened
29 * resource file is done using various CCoeEnv provided resource-reading
30 * methods. Cone Resource Loader API consist of the RConeResourceLoader class.
32 * Only one resource at a time may be open by one RConeResourceLoader instance.
33 * You can use several RConeResourceLoader instances for accessing several
34 * resources simultaneously or use one instance and close the previous resource
35 * before opening a new one.
37 * The implementation uses BaflUtils::NearestLanguageFile to search for
38 * a localised resource in proper search order.
43 * #include <ConeResLoader.h>
45 * // Get CCoeEnv instance
46 * CEikonEnv* eikEnv = CEikonEnv::Static();
48 * // Initialize loader
49 * RConeResourceLoader rLoader(eikEnv);
51 * // Open resource file
52 * _LIT( KSampleResourceFileName, "Z:\\System\\Apps\\sample\\sample.rsc" );
53 * TFileName fileName(KSampleResourceFileName);
54 * rLoader.OpenL(fileName);
56 * // Push resource loader to cleanup stack, so that it will always be properly
57 * // closed when popped.
58 * CleanupClosePushL(rLoader);
61 * iSomeArray = eikEnv->ReadDesC16ArrayResourceL(R_SOME_RESOURCE);
63 * // Pop and destroy rLoader from stack.
64 * // This also calls close on rLoader since CleanupClosePushL was used.
65 * CleanupStack::PopAndDestroy(); // rLoader
69 * @lib commonengine.lib
72 class RConeResourceLoader
78 * @param aEnv is a reference to Control environment in which resource
81 IMPORT_C RConeResourceLoader(CCoeEnv& aEnv);
84 * Opens the resource file for reading. Only one resource may be open
85 * at a time. Panics if this instance already has a file open.
86 * The implementation uses BaflUtils::NearestLanguageFile to search
87 * for a localized resource file in proper search order.
89 * @param aFileName is the resource file name to open. This parameter
90 * value is changed to the best matching language file found. The drive
91 * letter is required in the filename.
92 * @return a Symbian OS error code.
94 * @panic KErrNotSupported The instance already has a file open.
96 IMPORT_C TInt Open(TFileName& aFileName);
99 * Opens the resource file for reading. Only one resource may be open
100 * at a time. Leaves if this instance already has a file open.
101 * The implementation uses BaflUtils::NearestLanguageFile to search
102 * for a localized resource file in proper search order.
104 * @param aFileName Reference for resource file name. Please
105 * note that drive letter is required !
107 * @leave KErrNotSupported The instance already has a file open.
109 IMPORT_C void OpenL(TFileName& aFileName);
113 * Closes the opened resource file, if one is open. Does nothing if no
114 * file has been opened. New resource file may be opened after the
115 * previous has been closed. Always remember to close the resource when
118 IMPORT_C void Close();
122 // Prohibit copy constructor and assigment operator because not deriving from CBase.
123 RConeResourceLoader(const RConeResourceLoader&);
124 RConeResourceLoader& operator= ( const RConeResourceLoader& );
126 // Needed for closing
128 TInt iResourceFileOffset;