1 /* |
|
2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Static factory class for creating image instances. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IHLIMAGEFACTORY_H |
|
20 #define IHLIMAGEFACTORY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // FORWARD DECLARATION |
|
26 class RFs; |
|
27 class RFile; |
|
28 class MIHLFileImage; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * IHLImageFactory |
|
33 * |
|
34 * Static factory class for creating file instances. |
|
35 * @lib IHL.lib |
|
36 * @since 3.0 |
|
37 */ |
|
38 class IHLImageFactory |
|
39 { |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Open file and create new image instance. |
|
44 * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used. |
|
45 * Method leaves with appropriate error code if file could not be opened. |
|
46 * If file is multi-image, new image contains handle to the first image. |
|
47 * |
|
48 * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called! |
|
49 * |
|
50 * @since 3.0 |
|
51 * @param aFs Fileserver reference. |
|
52 * @param aFilename Full path of image file. |
|
53 * @return New image instance. |
|
54 */ |
|
55 IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename ); |
|
56 |
|
57 /** |
|
58 * Open file and create new image instance. |
|
59 * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used. |
|
60 * Method leaves with appropriate error code if |
|
61 * file could not be opened or index is out of bounds. |
|
62 * |
|
63 * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called! |
|
64 * |
|
65 * @since 3.0 |
|
66 * @param aFs Fileserver reference. |
|
67 * @param aFilename Full path of image file. |
|
68 * @param aImageIndex Image index. This is used in multi-image |
|
69 * file to determine which image is opened. |
|
70 * @return New image instance. |
|
71 */ |
|
72 IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename, |
|
73 TInt aImageIndex ); |
|
74 |
|
75 /** |
|
76 * Open file and create new image instance. |
|
77 * Default filemode is EFileShareReadersOnly and if opening fails, EFileShareAny is used. |
|
78 * Method leaves with appropriate error code if |
|
79 * file could not be opened or index is out of bounds. |
|
80 * |
|
81 * Note! Method may leave with KErrBadHandle if RFs::ShareProtected() method is not called! |
|
82 * |
|
83 * @since 3.0 |
|
84 * @param aFs Fileserver reference. |
|
85 * @param aFilename Full path of image file. |
|
86 * @param aImageIndex Image index. This is used in multi-image |
|
87 * file to determine which image is opened. |
|
88 * @param aOptions Special opening options. Refer to MIHLFileImage header. |
|
89 * @return New image instance. |
|
90 */ |
|
91 IMPORT_C static MIHLFileImage* OpenFileImageL( RFs& aFs, const TDesC& aFilename, |
|
92 TInt aImageIndex, const TUint32 aOptions ); |
|
93 |
|
94 /** |
|
95 * Create new image instance. |
|
96 * Method leaves with appropriate error code if file type is unknown. |
|
97 * @since 3.0 |
|
98 * @param aFile Open file handle. |
|
99 * @return New image instance. |
|
100 */ |
|
101 IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile ); |
|
102 |
|
103 /** |
|
104 * Create new image instance. |
|
105 * Method leaves with appropriate error code if |
|
106 * file type is unknown or index is out of bounds. |
|
107 * @since 3.0 |
|
108 * @param aFile Open file handle. |
|
109 * @param aImageIndex Image index. This is used in multi-image |
|
110 * file to determine which image is opened. |
|
111 * @return New image instance. |
|
112 */ |
|
113 IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile, TInt aImageIndex ); |
|
114 |
|
115 /** |
|
116 * Create new image instance. |
|
117 * Method leaves with appropriate error code if |
|
118 * file type is unknown or index is out of bounds. |
|
119 * @since 3.0 |
|
120 * @param aFile Open file handle. |
|
121 * @param aImageIndex Image index. This is used in multi-image |
|
122 * file to determine which image is opened. |
|
123 * @param aOptions Special opening options. Refer to MIHLFileImage header. |
|
124 * @return New image instance. |
|
125 */ |
|
126 IMPORT_C static MIHLFileImage* OpenFileImageL( RFile& aFile, TInt aImageIndex, |
|
127 const TUint32 aOptions ); |
|
128 |
|
129 /** |
|
130 * Create new image instance from buffered image data. |
|
131 * Method leaves with appropriate error code if buffer data could not be used. |
|
132 * If buffer contains multi-image, created image instance contains handle to |
|
133 * the first image. |
|
134 * @since 3.0 |
|
135 * @param aFs Fileserver reference. |
|
136 * @param aDataBuf Buffer reference. |
|
137 * @return New image instance. |
|
138 */ |
|
139 IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf ); |
|
140 |
|
141 /** |
|
142 * Create new image instance from buffered image data. |
|
143 * Method leaves with appropriate error code if buffer data could not be used |
|
144 * or image index is out of bounds. If buffer contains multi-image, created |
|
145 * image instance contains handle to the first image. |
|
146 * @since 3.0 |
|
147 * @param aFs Fileserver reference. |
|
148 * @param aDataBuf Buffer reference. |
|
149 * @param aImageIndex Image index. This is used in multi-image |
|
150 * file to determine which image is opened. |
|
151 * @return New image instance. |
|
152 */ |
|
153 IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf, |
|
154 TInt aImageIndex ); |
|
155 |
|
156 /** |
|
157 * Create new image instance from buffered image data. |
|
158 * Method leaves with appropriate error code if buffer data could not be used |
|
159 * or image index is out of bounds. If buffer contains multi-image, created |
|
160 * image instance contains handle to the first image. |
|
161 * @since 3.0 |
|
162 * @param aFs Fileserver reference. |
|
163 * @param aDataBuf Buffer reference. |
|
164 * @param aImageIndex Image index. This is used in multi-image |
|
165 * file to determine which image is opened. |
|
166 * @param aOptions Special opening options. Refer to MIHLFileImage header. |
|
167 * @return New image instance. |
|
168 */ |
|
169 IMPORT_C static MIHLFileImage* OpenBufferedFileImageL( RFs& aFs, const TDesC8& aDataBuf, |
|
170 TInt aImageIndex, const TUint32 aOptions ); |
|
171 |
|
172 }; |
|
173 |
|
174 #endif // IHLIMAGEFACTORY_H |
|
175 |
|
176 // End of File |
|