Subversion Repositories Scribus

Rev

Rev 4805 | Rev 7117 | 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
 
3484 avox 10
#include <qstring.h>
11
#include <qstringlist.h>
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
 
3096 fschmid 52
        /** @brief Return paths to system font directories*/
53
        static QStringList getSystemFontDirs(void);
54
        /** @brief Return paths to system icc profiles directories*/
55
        static QStringList getSystemProfilesDirs(void);
4602 cbradney 56
        /** @brief Return paths to system create project directories*/
5917 jghali 57
        static QStringList getSystemCreateSwatchesDirs(void);
3096 fschmid 58
 
5917 jghali 59
        /** @brief Return path to application data dir*/
60
        static QString getApplicationDataDir(void);
61
        /** @brief Return path to user documents*/
62
        static QString getUserDocumentDir(void);
63
        /** @brief Return path to directory used for temporary files*/
64
        static QString getTempFileDir(void);
65
 
66
 
1693 craig 67
protected:
68
        /** @brief Constructor. Use ScPaths::instance() instead. */
69
        ScPaths();
70
        /** @brief Destructor. Use ScPaths::destroy() instead. */
71
        ~ScPaths();
72
 
3096 fschmid 73
        /** @brief Return path to a special directory, should be used only on Windows*/
74
        static QString getSpecialDir(int folder);
75
 
1693 craig 76
        /** @brief Pointer to existing instance of ScPaths, if any. */
77
        static ScPaths* m_instance;
78
 
79
        // Members to hold system paths
80
        QString m_docDir;
81
        QString m_iconDir;
3794 cbradney 82
        QString m_fontDir;
1693 craig 83
        QString m_libDir;
84
        QString m_pluginDir;
85
        QString m_sampleScriptDir;
86
        QString m_scriptDir;
87
        QString m_templateDir;
2707 subik 88
        QString m_shareDir;
1693 craig 89
};
90
#endif