Subversion Repositories Scribus

Rev

Rev 11058 | 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 */
11058 malex 55
        QString translationDir() const;
11111 malex 56
        /** @brief Return path to the dictionaries directory */
57
        QString dictDir() const;
11051 malex 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);
3096 fschmid 65
 
5917 jghali 66
        /** @brief Return path to application data dir*/
67
        static QString getApplicationDataDir(void);
68
        /** @brief Return path to user documents*/
69
        static QString getUserDocumentDir(void);
70
        /** @brief Return path to directory used for temporary files*/
71
        static QString getTempFileDir(void);
72
 
73
 
1693 craig 74
protected:
75
        /** @brief Constructor. Use ScPaths::instance() instead. */
76
        ScPaths();
77
        /** @brief Destructor. Use ScPaths::destroy() instead. */
78
        ~ScPaths();
79
 
3096 fschmid 80
        /** @brief Return path to a special directory, should be used only on Windows*/
81
        static QString getSpecialDir(int folder);
82
 
1693 craig 83
        /** @brief Pointer to existing instance of ScPaths, if any. */
84
        static ScPaths* m_instance;
85
 
86
        // Members to hold system paths
87
        QString m_docDir;
88
        QString m_iconDir;
3794 cbradney 89
        QString m_fontDir;
1693 craig 90
        QString m_libDir;
91
        QString m_pluginDir;
92
        QString m_sampleScriptDir;
93
        QString m_scriptDir;
94
        QString m_templateDir;
2707 subik 95
        QString m_shareDir;
1693 craig 96
};
97
#endif