Changeset View
Changeset View
Standalone View
Standalone View
mimetreeparser/src/viewer/bodypartformatterfactory.h
- This file was moved from mimetreeparser/src/viewer/bodypartformatterbasefactory.h.
Show All 25 Lines | 1 | /* | |||
---|---|---|---|---|---|
26 | combinations including the two. You must obey the GNU General | 26 | combinations including the two. You must obey the GNU General | ||
27 | Public License in all respects for all of the code used other than | 27 | Public License in all respects for all of the code used other than | ||
28 | Qt. If you modify this file, you may extend this exception to | 28 | Qt. If you modify this file, you may extend this exception to | ||
29 | your version of the file, but you are not obligated to do so. If | 29 | your version of the file, but you are not obligated to do so. If | ||
30 | you do not wish to do so, delete this exception statement from | 30 | you do not wish to do so, delete this exception statement from | ||
31 | your version. | 31 | your version. | ||
32 | */ | 32 | */ | ||
33 | 33 | | |||
34 | #ifndef __MIMETREEPARSER_BODYPARTFORMATTERBASEFACTORY_H__ | 34 | #ifndef __MIMETREEPARSER_BODYPARTFORMATTERFACTORY_H__ | ||
35 | #define __MIMETREEPARSER_BODYPARTFORMATTERBASEFACTORY_H__ | 35 | #define __MIMETREEPARSER_BODYPARTFORMATTERFACTORY_H__ | ||
36 | 36 | | |||
37 | #include "mimetreeparser_export.h" | 37 | #include "mimetreeparser_export.h" | ||
38 | 38 | | |||
39 | #include <QByteArray> | 39 | #include <QByteArray> | ||
40 | #include <QVector> | 40 | #include <QVector> | ||
41 | 41 | | |||
42 | namespace MimeTreeParser { | 42 | namespace MimeTreeParser { | ||
43 | namespace Interface { | 43 | namespace Interface { | ||
44 | class BodyPartFormatter; | 44 | class BodyPartFormatter; | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | class BodyPartFormatterBaseFactoryPrivate; | 47 | class BodyPartFormatterFactoryPrivate; | ||
48 | 48 | | |||
49 | /** The place to obtain BodyPartFormatter candidates for a given mime type. */ | 49 | /** The place to obtain BodyPartFormatter candidates for a given mime type. */ | ||
50 | class MIMETREEPARSER_EXPORT BodyPartFormatterBaseFactory | 50 | class MIMETREEPARSER_EXPORT BodyPartFormatterFactory | ||
51 | { | 51 | { | ||
52 | public: | 52 | public: | ||
53 | BodyPartFormatterBaseFactory(); | 53 | BodyPartFormatterFactory(); | ||
54 | virtual ~BodyPartFormatterBaseFactory(); | 54 | virtual ~BodyPartFormatterFactory(); | ||
55 | | ||||
56 | static BodyPartFormatterFactory* instance(); | ||||
55 | 57 | | |||
56 | /** | 58 | /** | ||
57 | * Returns all suitable formatters for the given mimetype. | 59 | * Returns all suitable formatters for the given mimetype. | ||
58 | * The candidates are ordered by priority, with the catch-call | 60 | * The candidates are ordered by priority, with the catch-call | ||
59 | * formatter coming last. | 61 | * formatter coming last. | ||
60 | */ | 62 | */ | ||
61 | QVector<const Interface::BodyPartFormatter *> formattersForType(const QString &mimeType) const; | 63 | QVector<const Interface::BodyPartFormatter *> formattersForType(const QString &mimeType) const; | ||
62 | 64 | | |||
63 | protected: | 65 | protected: | ||
64 | void insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority); | 66 | void insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority); | ||
65 | virtual void loadPlugins(); | 67 | virtual void loadPlugins(); | ||
66 | 68 | | |||
67 | private: | 69 | private: | ||
68 | Q_DISABLE_COPY(BodyPartFormatterBaseFactory) | 70 | Q_DISABLE_COPY(BodyPartFormatterFactory) | ||
69 | BodyPartFormatterBaseFactoryPrivate *d; | 71 | BodyPartFormatterFactoryPrivate *d; | ||
70 | friend class BodyPartFormatterBaseFactoryPrivate; | 72 | friend class BodyPartFormatterFactoryPrivate; | ||
71 | }; | 73 | }; | ||
72 | } | 74 | } | ||
73 | 75 | | |||
74 | #endif // __MIMETREEPARSER_BODYPARTFORMATTERFACTORY_H__ | 76 | #endif // __MIMETREEPARSER_BODYPARTFORMATTERFACTORY_H__ |