~s-cecilio/lenmus/v5.1.x

« back to all changes in this revision

Viewing changes to src/globals/Paths.h

  • Committer: cecilios
  • Date: 2011-06-12 17:25:18 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:branches/TRY-5.0:687
Initial update for v5.0 first working core using lomse

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//--------------------------------------------------------------------------------------
2
 
//    LenMus Phonascus: The teacher of music
3
 
//    Copyright (c) 2002-2010 LenMus project
4
 
//
5
 
//    This program is free software; you can redistribute it and/or modify it under the
6
 
//    terms of the GNU General Public License as published by the Free Software Foundation,
7
 
//    either version 3 of the License, or (at your option) any later version.
8
 
//
9
 
//    This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
 
//    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
 
//    PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12
 
//
13
 
//    You should have received a copy of the GNU General Public License along with this
14
 
//    program. If not, see <http://www.gnu.org/licenses/>.
15
 
//
16
 
//    For any comment, suggestion or feature request, please contact the manager of
17
 
//    the project at cecilios@users.sourceforge.net
18
 
//
19
 
//-------------------------------------------------------------------------------------
20
 
 
21
 
#ifndef __LM_PATH_H__
22
 
#define __LM_PATH_H__
23
 
 
24
 
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
25
 
#pragma interface "Paths.cpp"
26
 
#endif
27
 
 
28
 
#include <wx/config.h>
29
 
#include <wx/filename.h>
30
 
 
31
 
class lmPaths
32
 
{
33
 
public:
34
 
    lmPaths(wxString sBinPath);
35
 
    ~lmPaths();
36
 
 
37
 
    void LoadUserPreferences();
38
 
    void SaveUserPreferences();
39
 
 
40
 
    //Access to paths
41
 
    wxString GetRootPath() { return m_root.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR); }
42
 
    wxString GetBinPath() { return m_sBin; }
43
 
    wxString GetXrcPath() { return m_sXrc; }
44
 
    wxString GetTempPath() { return m_sTemp; }
45
 
    wxString GetImagePath() { return m_sImages; }
46
 
    wxString GetCursorsPath() { return m_sCursors; }
47
 
    wxString GetSoundsPath() { return m_sSounds; }
48
 
    wxString GetLocaleRootPath() { return m_sLocaleRoot; }
49
 
    wxString GetScoresPath() { return m_sScores; }
50
 
    wxString GetTestScoresPath() { return m_sTestScores; }
51
 
    wxString GetSamplesPath() { return m_sSamples; }
52
 
    wxString GetTemplatesPath() { return m_sTemplates; }
53
 
    wxString GetConfigPath() { return m_sConfig; }
54
 
    wxString GetLogPath() { return m_sLogs; }
55
 
    wxString GetFontsPath() { return m_sFonts; }
56
 
 
57
 
    // paths that depend on the language name
58
 
    wxString GetLocalePath() { return m_sLocale; }
59
 
    wxString GetHelpPath() { return m_sHelp; }
60
 
    wxString GetBooksPath() { return m_sBooks; }
61
 
 
62
 
    void SetLanguageCode(wxString sLangCode);
63
 
 
64
 
    // Set paths selecteble by user
65
 
    void SetScoresPath(wxString sPath) { m_sScores = sPath; }
66
 
 
67
 
private:
68
 
        void ClearTempFiles();
69
 
 
70
 
        //
71
 
        // member variables
72
 
        //
73
 
 
74
 
    //root (instalation path) for LenMus
75
 
    wxFileName    m_root;
76
 
 
77
 
    //path names
78
 
    wxString    m_sLocaleRoot;  //root path for locale (it is m_sLocale without the language subfolder)
79
 
    wxString    m_sLocale;      //path containing program translation files ( .mo catalogs)
80
 
    wxString    m_sLangCode;    //language code (2 or 5 chars: i.e. "en", "en_US")
81
 
    wxString    m_sScores;      //path for scores
82
 
    wxString    m_sTestScores;  //path for scores for unit tests
83
 
    wxString    m_sSamples;     //path for sample scores
84
 
    wxString    m_sTemplates;   //path for templates
85
 
    wxString    m_sTemp;        //path for temporary files (help books preprocessed, ...)
86
 
    wxString    m_sBooks;       //path for books
87
 
    wxString    m_sHelp;        //path for help files
88
 
    wxString    m_sBin;         //path for binaries
89
 
    wxString    m_sXrc;         //path for .xrc and .xrs resource files
90
 
    wxString    m_sImages;      //path for resource images
91
 
    wxString    m_sCursors;     //path for resource cursors
92
 
    wxString    m_sSounds;      //path for wave sounds
93
 
    wxString    m_sConfig;      //path for user configuration file
94
 
    wxString    m_sLogs;        //path for logs and dumps
95
 
    wxString    m_sFonts;       //path for resource fonts
96
 
 
97
 
};
98
 
 
99
 
extern lmPaths* g_pPaths;
100
 
 
101
 
#endif    // __LM_PATH_H__