Subversion Repositories Scribus

Rev

Rev 7117 | Rev 11058 | 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
 
7117 jghali 32
        static QString separatorsToSlashes(const QString& path);
33
 
1693 craig 34
        /** @brief Return path to documentation directory */
35
        const QString& docDir() const;
36
        /** @brief Return path to icons directory*/
37
        const QString& iconDir() const;
3794 cbradney 38
        /** @brief Return path to the Scribus font directory */
39
        const QString& fontDir() const;
1693 craig 40
        /** @brief Return path to lib directory containing translations,
41
         *         keysets, etc. */
42
        const QString& libDir() const;
43
        /** @brief Return path to dir containing plugins. */
44
        const QString& pluginDir() const;
45
        /** @brief Return path to dir containing sample Python scripts */
46
        const QString& sampleScriptDir() const;
47
        /** @brief Return path to dir containing "official" Python scripts */
48
        const QString& scriptDir() const;
49
        /** @brief Return path to containing stock templates */
50
        const QString& templateDir() const;
2707 subik 51
        /** @brief Return path to the Scribus share directory */
52
        const QString& shareDir() const;
1693 craig 53
 
11051 malex 54
        /** @brief Return path to the translations directory */
55
        /QString translationDir() const;
56
 
3096 fschmid 57
        /** @brief Return paths to system font directories*/
58
        static QStringList getSystemFontDirs(void);
59
        /** @brief Return paths to system icc profiles directories*/
60
        static QStringList getSystemProfilesDirs(void);
4602 cbradney 61
        /** @brief Return paths to system create project directories*/
5917 jghali 62
        static QStringList getSystemCreateSwatchesDirs(void);
3096 fschmid 63
 
5917 jghali 64
        /** @brief Return path to application data dir*/
65
        static QString getApplicationDataDir(void);
66
        /** @brief Return path to user documents*/
67
        static QString getUserDocumentDir(void);
68
        /** @brief Return path to directory used for temporary files*/
69
        static QString getTempFileDir(void);
70
 
71
 
1693 craig 72
protected:
73
        /** @brief Constructor. Use ScPaths::instance() instead. */
74
        ScPaths();
75
        /** @brief Destructor. Use ScPaths::destroy() instead. */
76
        ~ScPaths();
77
 
3096 fschmid 78
        /** @brief Return path to a special directory, should be used only on Windows*/
79
        static QString getSpecialDir(int folder);
80
 
1693 craig 81
        /** @brief Pointer to existing instance of ScPaths, if any. */
82
        static ScPaths* m_instance;
83
 
84
        // Members to hold system paths
85
        QString m_docDir;
86
        QString m_iconDir;
3794 cbradney 87
        QString m_fontDir;
1693 craig 88
        QString m_libDir;
89
        QString m_pluginDir;
90
        QString m_sampleScriptDir;
91
        QString m_scriptDir;
92
        QString m_templateDir;
2707 subik 93
        QString m_shareDir;
1693 craig 94
};
95
#endif