author | Christian Morlok <symbian.org@christianmorlok.de> |
Wed, 07 Apr 2010 14:35:19 +0200 | |
branch | v5backport |
changeset 54 | 666a2952b5b3 |
parent 21 | 11157e26c4a7 |
permissions | -rw-r--r-- |
21
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
1 |
/* |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
3 |
* All rights reserved. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
8 |
* |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
11 |
* |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
12 |
* Contributors: |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
13 |
* |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
14 |
* Description: Mifconv converter manager class. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
15 |
* |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
16 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
17 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
18 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
19 |
#ifndef __MIFCONVCONVERTERMANAGER_H__ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
20 |
#define __MIFCONVCONVERTERMANAGER_H__ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
21 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
22 |
#include "mifconv_fileconverter.h" |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
23 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
24 |
typedef std::map<MifConvString, MifConvFileConverterList> FileConverterMap; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
25 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
26 |
class MifConvConverterManager |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
27 |
{ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
28 |
public: |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
29 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
30 |
static MifConvConverterManager* Instance(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
31 |
static void Reset(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
32 |
~MifConvConverterManager(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
33 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
34 |
/** |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
35 |
* Initializes the converter manager. Note! Argument manager must be initialized |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
36 |
* before calling this. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
37 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
38 |
void Init(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
39 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
40 |
/** |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
41 |
* This method initializes the file converter list and processes the source |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
42 |
* files given in arguments. It finds the correct file converter for each |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
43 |
* source file and lets it do the file conversion. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
44 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
45 |
void ProcessIcons(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
46 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
47 |
/** |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
48 |
* This method runs the cleanup method of each file converter in the file converter list. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
49 |
* @param error True if error situation |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
50 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
51 |
void Cleanup(bool error = false); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
52 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
53 |
/** |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
54 |
* Returns all the converters for the given type of file. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
55 |
* @return List of the matching converters. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
56 |
* @param source Source file object |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
57 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
58 |
MifConvFileConverterList& GetConverters(const MifConvSourceFile& source); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
59 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
60 |
/** |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
61 |
* Returns all the converters for the given type of file. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
62 |
* @return List of the matching converters. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
63 |
* @param filename Source file name |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
64 |
*/ |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
65 |
MifConvFileConverterList& GetConverters(const MifConvString& filename); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
66 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
67 |
private: |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
68 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
69 |
MifConvConverterManager(); |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
70 |
// File converter map containing all the converters needed to process the source icons. |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
71 |
// Map is ordered by file-extensions: |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
72 |
FileConverterMap iFileConverters; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
73 |
MifConvFileConverterList iAllConverters; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
74 |
MifConvFileConverterList iDummyConverterList; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
75 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
76 |
static MifConvConverterManager* iInstance; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
77 |
}; |
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
78 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
79 |
|
11157e26c4a7
added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
80 |
#endif |