47
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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: Parameter list
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef BT_SERVICE_PARAMETER_LIST_H
|
|
20 |
#define BT_SERVICE_PARAMETER_LIST_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32std.h>
|
|
24 |
#include <badesca.h> // CDesCArray
|
|
25 |
#include <f32file.h>
|
|
26 |
|
|
27 |
// CONSTANTS
|
|
28 |
|
|
29 |
// DATA TYPES
|
|
30 |
|
|
31 |
struct TBTSUXhtmlParam
|
|
32 |
{
|
|
33 |
TDesC* iFileName;
|
|
34 |
CDesCArray* iRefObjectList;
|
|
35 |
};
|
|
36 |
|
|
37 |
struct TBTSUImageParam
|
|
38 |
{
|
|
39 |
RFile iFile;
|
|
40 |
TDesC* iDisplayName;
|
|
41 |
TDesC8* iMimeType;
|
|
42 |
TSize iPixelSize;
|
|
43 |
TInt iFileSize;
|
|
44 |
TBool iSend;
|
|
45 |
|
|
46 |
};
|
|
47 |
|
|
48 |
|
|
49 |
// CLASS DECLARATION
|
|
50 |
|
|
51 |
/**
|
|
52 |
* A class holding paths to different types of files.
|
|
53 |
*
|
|
54 |
* In case of an XHTML file the list collects paths
|
|
55 |
* to objects referenced in the file.
|
|
56 |
*
|
|
57 |
* In case of an image the list resolves the MIME types and
|
|
58 |
* displayable names of the images.
|
|
59 |
*
|
|
60 |
* @lib BtServiceUtils.lib
|
|
61 |
* @since Series 60 2.6
|
|
62 |
*/
|
|
63 |
class CBTServiceParameterList : public CBase
|
|
64 |
{
|
|
65 |
public: // Constructors and destructor
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Two-phased constructor.
|
|
69 |
*/
|
|
70 |
IMPORT_C static CBTServiceParameterList* NewL();
|
|
71 |
IMPORT_C static CBTServiceParameterList* NewLC();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Destructor.
|
|
75 |
*/
|
|
76 |
virtual ~CBTServiceParameterList();
|
|
77 |
|
|
78 |
public: // New functions
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Adds an xhtml file path to the list.
|
|
82 |
* @since Series 60 2.6
|
|
83 |
* @param aFilePath A full path and file name.
|
|
84 |
* @return None.
|
|
85 |
*/
|
|
86 |
IMPORT_C void AddXhtmlL( const TDesC& aFilePath );
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Adds an image file path to the list.
|
|
90 |
* @since Series 60 2.6
|
|
91 |
* @param aFilePath A full path and file name.
|
|
92 |
* @return None.
|
|
93 |
*/
|
|
94 |
IMPORT_C void AddImageL( const TDesC& aFilePath );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Adds an image file path to the list.
|
|
98 |
* @since Series 60 2.6
|
|
99 |
* @param aFile file handle to be send.
|
|
100 |
* @return None.
|
|
101 |
*/
|
|
102 |
IMPORT_C void AddImageL( RFile aFile );
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Adds an object file path to the list.
|
|
106 |
* @since Series 60 2.6
|
|
107 |
* @param aFilePath A full path and file name.
|
|
108 |
* @return None.
|
|
109 |
*/
|
|
110 |
IMPORT_C void AddObjectL( const TDesC& aFilePath );
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Adds an object file path to the list.
|
|
114 |
* @since Series 60 2.6
|
|
115 |
* @param aFile file handle to be send .
|
|
116 |
* @return None.
|
|
117 |
*/
|
|
118 |
IMPORT_C void AddObjectL( RFile aFile );
|
|
119 |
|
|
120 |
public: // New functions (not exported)
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Return the number of xhtml file paths in the list.
|
|
124 |
* @return The count.
|
|
125 |
*/
|
|
126 |
TInt XhtmlCount() const;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Return the number of image file paths in the list.
|
|
130 |
* @return The count.
|
|
131 |
*/
|
|
132 |
TInt ImageCount() const;
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Return the number of object file paths in the list.
|
|
136 |
* @return The count.
|
|
137 |
*/
|
|
138 |
TInt ObjectCount() const;
|
|
139 |
|
|
140 |
/**
|
|
141 |
* Returns a copy of an element of the list from the given index.
|
|
142 |
* @param aIndex The index.
|
|
143 |
* @return The element.
|
|
144 |
*/
|
|
145 |
TBTSUXhtmlParam XhtmlAt( TInt aIndex ) const;
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Returns a copy of an element of the list from the given index.
|
|
149 |
* @param aIndex The index.
|
|
150 |
* @return The element.
|
|
151 |
*/
|
|
152 |
TBTSUImageParam ImageAtL( TInt aIndex ) const;
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Returns a copy of an element of the list from the given index.
|
|
156 |
* @param aIndex The index.
|
|
157 |
* @return The element.
|
|
158 |
*/
|
|
159 |
RFile& ObjectAtL( TInt aIndex );
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Checks whether the list has any xhtml-files with referenced objects.
|
|
163 |
* @return A boolean according to result.
|
|
164 |
*/
|
|
165 |
TBool HasAnyReferencedObjects() const;
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Return the size of objects in the list.
|
|
169 |
* @return The count.
|
|
170 |
*/
|
|
171 |
TInt ObjectListSizeL() const;
|
|
172 |
|
|
173 |
/**
|
|
174 |
* Return the size of images in the list.
|
|
175 |
* @return The count.
|
|
176 |
*/
|
|
177 |
|
|
178 |
TInt ImageListSize() const;
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Remove image from list.
|
|
182 |
* @param aIndex The index.
|
|
183 |
* @return None.
|
|
184 |
*/
|
|
185 |
void RemoveImageL(TInt aIndex);
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Return count of removed image
|
|
189 |
* @return The count of removed images.
|
|
190 |
*/
|
|
191 |
TInt RemovedImageCount();
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Reset image filehandle
|
|
195 |
* @param aIndex The index.
|
|
196 |
* @return None.
|
|
197 |
*/
|
|
198 |
void ResetImageHandleL(TInt aIndex);
|
|
199 |
|
|
200 |
/**
|
|
201 |
* Reset object filehandle
|
|
202 |
* @param aIndex The index.
|
|
203 |
* @return None.
|
|
204 |
*/
|
|
205 |
void ResetObjectHandleL(TInt aIndex);
|
|
206 |
|
|
207 |
|
|
208 |
/**
|
|
209 |
* Reset image filehandle
|
|
210 |
* @param aIndex The index.
|
|
211 |
* @return None.
|
|
212 |
*/
|
|
213 |
void MarkAsSendL(TInt aIndex);
|
|
214 |
|
|
215 |
|
|
216 |
private:
|
|
217 |
|
|
218 |
/**
|
|
219 |
* C++ default constructor.
|
|
220 |
*/
|
|
221 |
CBTServiceParameterList();
|
|
222 |
|
|
223 |
/**
|
|
224 |
* By default Symbian 2nd phase constructor is private.
|
|
225 |
*/
|
|
226 |
void ConstructL();
|
|
227 |
|
|
228 |
private: // Data
|
|
229 |
|
|
230 |
RArray<TBTSUXhtmlParam> iXhtmlList;
|
|
231 |
RArray<TBTSUImageParam> iImageList;
|
|
232 |
RArray<RFile> iObjectList;
|
|
233 |
RFs iFileSession;
|
|
234 |
TInt iRemovedImageCount;
|
|
235 |
};
|
|
236 |
|
|
237 |
#endif // BT_SERVICE_PARAMETER_LIST_H
|
|
238 |
|
|
239 |
// End of File
|