Rev 10181 | Rev 10271 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10124 | cbradney | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
7 | |||
8 | //Added by Craig Bradney in July 2007 |
||
9 | //To be used for basic format detection and checking |
||
10 | //One central place for storing all our extensions we support, etc |
||
11 | |||
10212 | cbradney | 12 | #ifndef _UTIL_FORMATs_H |
13 | #define _UTIL_FORMATs_H |
||
10124 | cbradney | 14 | |
10181 | cbradney | 15 | #include <QByteArray> |
16 | #include <QList> |
||
17 | #include <QMap> |
||
10124 | cbradney | 18 | #include <QString> |
10181 | cbradney | 19 | #include <QStringList> |
10137 | jghali | 20 | #include "scribusapi.h" |
10124 | cbradney | 21 | |
10137 | jghali | 22 | bool SCRIBUS_API extensionIndicatesEPS(const QString &ext); |
23 | bool SCRIBUS_API extensionIndicatesEPSorPS(const QString &ext); |
||
10181 | cbradney | 24 | bool SCRIBUS_API extensionIndicatesJPEG(const QString &ext); |
25 | bool SCRIBUS_API extensionIndicatesPDF(const QString &ext); |
||
26 | bool SCRIBUS_API extensionIndicatesPSD(const QString &ext); |
||
27 | bool SCRIBUS_API extensionIndicatesPattern(const QString &ext); |
||
10137 | jghali | 28 | bool SCRIBUS_API extensionIndicatesTIFF(const QString &ext); |
10124 | cbradney | 29 | |
10181 | cbradney | 30 | |
31 | class SCRIBUS_API FormatsManager |
||
32 | { |
||
33 | public: |
||
34 | |||
35 | enum scFormatTypes |
||
36 | { |
||
37 | TIFF = 1, // TIFF |
||
38 | PS = 2, // PostScript |
||
39 | EPS = 4, // Encapsulated PostScript |
||
40 | JPEG = 8, // JPEG |
||
41 | PSD = 16, // Photoshop Format |
||
42 | PDF = 32, // PDF Format |
||
43 | PAT = 64 // Pattern files |
||
44 | }; |
||
45 | |||
46 | FormatsManager(); |
||
47 | ~FormatsManager(); |
||
48 | |||
49 | /** |
||
50 | * @brief Returns a pointer to the FormatsManager instance |
||
51 | * @return A pointer to the FormatsManager instance |
||
52 | */ |
||
53 | static FormatsManager* instance(); |
||
54 | /** |
||
55 | * @brief Deletes the FormatsManager Instance |
||
56 | * Must be called when FormatsManager is no longer needed. |
||
57 | */ |
||
58 | static void deleteInstance(); |
||
59 | void imageFormatSupported(const QString&); |
||
60 | |||
61 | void fileTypeStrings(int type, QString& formatList, QString& formatText, bool lowerCaseOnly=false); |
||
62 | |||
63 | protected: |
||
64 | QMap<int, QStringList> m_fmts; |
||
65 | QStringList m_fmtList; |
||
66 | QList<QByteArray> m_supportedImageFormats; |
||
67 | void updateSupportedImageFormats(QList<QByteArray>& supportedImageFormats); |
||
68 | |||
69 | private: |
||
70 | /** |
||
71 | * @brief The only instance of FormatsManager available. |
||
72 | * |
||
73 | * FormatsManager is singleton and the instance can be queried with the method |
||
74 | * instance(). |
||
75 | */ |
||
76 | static FormatsManager* _instance; |
||
77 | }; |
||
78 | |||
10124 | cbradney | 79 | #endif |