Subversion Repositories Scribus

Rev

Rev 15496 | Rev 17525 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 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
*/
1693 craig 7
#ifndef SCPATHS_H
8
#define SCPATHS_H
9
 
10220 cbradney 10
#include <QString>
11
#include <QStringList>
2969 craig 12
#include "scribusapi.h"
1693 craig 13
 
2969 craig 14
class SCRIBUS_API ScPaths
1693 craig 15
{
16
public:
17
        /**
18
         * @brief Get a reference to the ScPaths instance
19
         *        creating it if necessary.
20
         * @sa ScPaths::destroy()
21
         */
22
        static const ScPaths& instance();
23
        /**
24
         * @brief Destroy the ScPaths instance, if any.
25
         * @sa ScPaths::instnace()
26
         */
27
        static void destroy();
28
 
4194 fschmid 29
        /*** The separator used between path list entries in environment variables */
30
        static const char envPathSeparator;
31
 
1693 craig 32
        /** @brief Return path to documentation directory */
33
        const QString& docDir() const;
34
        /** @brief Return path to icons directory*/
35
        const QString& iconDir() const;
3794 cbradney 36
        /** @brief Return path to the Scribus font directory */
37
        const QString& fontDir() const;
1693 craig 38
        /** @brief Return path to lib directory containing translations,
39
         *         keysets, etc. */
40
        const QString& libDir() const;
41
        /** @brief Return path to dir containing plugins. */
42
        const QString& pluginDir() const;
43
        /** @brief Return path to dir containing sample Python scripts */
44
        const QString& sampleScriptDir() const;
45
        /** @brief Return path to dir containing "official" Python scripts */
46
        const QString& scriptDir() const;
47
        /** @brief Return path to containing stock templates */
48
        const QString& templateDir() const;
2707 subik 49
        /** @brief Return path to the Scribus share directory */
50
        const QString& shareDir() const;
1693 craig 51
 
10997 jghali 52
        /** @brief Return path to the translations directory */
53
        QString translationDir() const;
11120 malex 54
        /** @brief Return path to the dicts directory */
55
        QString dictDir() const;
17501 craig 56
        /** @brief Return path to the spelling dictionary directory */
57
        QStringList spellDirs() const;
10997 jghali 58
 
3096 fschmid 59
        /** @brief Return paths to system font directories*/
60
        static QStringList getSystemFontDirs(void);
61
        /** @brief Return paths to system icc profiles directories*/
62
        static QStringList getSystemProfilesDirs(void);
4602 cbradney 63
        /** @brief Return paths to system create project directories*/
5917 jghali 64
        static QStringList getSystemCreateSwatchesDirs(void);
15496 craig 65
        /** @brief Return paths to directories held in an environment variable*/
66
        static QStringList getDirsFromEnvVar(const QString envVar, const QString dirToFind);
5917 jghali 67
        /** @brief Return path to application data dir*/
68
        static QString getApplicationDataDir(void);
14539 jghali 69
        /** @brief Return path to image cache dir*/
70
        static QString getImageCacheDir(void);
13608 jghali 71
        /** @brief Return path to plugin data dir*/
72
        static QString getPluginDataDir(void);
5917 jghali 73
        /** @brief Return path to user documents*/
74
        static QString getUserDocumentDir(void);
75
        /** @brief Return path to directory used for temporary files*/
76
        static QString getTempFileDir(void);
13179 cbradney 77
        /** @brief Return path to Contents OSX subdirectory*/
78
        QString bundleDir(void) const;
5917 jghali 79
 
1693 craig 80
protected:
81
        /** @brief Constructor. Use ScPaths::instance() instead. */
82
        ScPaths();
83
        /** @brief Destructor. Use ScPaths::destroy() instead. */
84
        ~ScPaths();
85
 
3096 fschmid 86
        /** @brief Return path to a special directory, should be used only on Windows*/
87
        static QString getSpecialDir(int folder);
88
 
1693 craig 89
        /** @brief Pointer to existing instance of ScPaths, if any. */
90
        static ScPaths* m_instance;
91
 
92
        // Members to hold system paths
93
        QString m_docDir;
94
        QString m_iconDir;
3794 cbradney 95
        QString m_fontDir;
1693 craig 96
        QString m_libDir;
97
        QString m_pluginDir;
98
        QString m_sampleScriptDir;
99
        QString m_scriptDir;
100
        QString m_templateDir;
2707 subik 101
        QString m_shareDir;
1693 craig 102
};
103
#endif