~s-cecilio/lenmus/v5.3

« back to all changes in this revision

Viewing changes to include/lenmus_injectors.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-2011 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 __LENMUS_INJECTORS_H__
 
22
#define __LENMUS_INJECTORS_H__
 
23
 
 
24
#include <wx/wxprec.h>
 
25
#include <wx/string.h>
 
26
#include <wx/config.h>
 
27
 
 
28
#include <iostream>
 
29
using namespace std;
 
30
 
 
31
namespace lenmus
 
32
{
 
33
 
 
34
//forward declarations
 
35
class Paths;
 
36
class MidiServer;
 
37
 
 
38
//---------------------------------------------------------------------------------------
 
39
class ApplicationScope
 
40
{
 
41
protected:
 
42
    ostream& m_reporter;
 
43
    Paths* m_pPaths;
 
44
    wxConfigBase* m_pPrefs;
 
45
    MidiServer* m_pMidi;
 
46
 
 
47
    wxString m_sAppName;
 
48
    wxString m_sVendorName;
 
49
    wxString m_sVersionString;
 
50
    wxString m_sHomeDir;
 
51
 
 
52
public:
 
53
    ApplicationScope(ostream& reporter=cout);
 
54
    ~ApplicationScope();
 
55
 
 
56
 
 
57
    //settings
 
58
    void set_bin_folder(const wxString& sBinPath);
 
59
    void create_preferences_object();
 
60
 
 
61
    //access to global objects/variables
 
62
    Paths* get_paths();
 
63
    wxConfigBase* get_preferences();
 
64
    MidiServer* get_midi_server();
 
65
 
 
66
//    inline ostream& default_reporter() { return m_reporter; }
 
67
//    inline LomseDoorway* platform_interface() { return m_pDoorway; }
 
68
//    LdpFactory* ldp_factory();
 
69
//    FontStorage* font_storage();
 
70
//
 
71
//    void notify_user_about(EventInfo& event);
 
72
//
 
73
//    double get_screen_ppi() const;
 
74
//    int get_pixel_format() const;
 
75
//    //MusicGlyphs* music_glyphs();
 
76
//
 
77
//    //global options, mainly for debug
 
78
    //inline void set_justify_systems(bool value) { m_sAppName = value; }
 
79
    inline wxString& get_app_name() { return m_sAppName; }
 
80
    inline wxString& get_vendor_name() { return m_sVendorName; }
 
81
    inline wxString& get_version_string() { return m_sVersionString; }
 
82
    wxString get_app_full_name();
 
83
 
 
84
//    inline void set_dump_column_tables(bool value) { m_fDumpColumnTables = value; }
 
85
//    inline bool dump_column_tables() { return m_fDumpColumnTables; }
 
86
 
 
87
protected:
 
88
    void set_version_string();
 
89
 
 
90
};
 
91
 
 
92
////---------------------------------------------------------------------------------------
 
93
//class DocumentScope
 
94
//{
 
95
//public:
 
96
//    DocumentScope(ostream& reporter=cout) : m_reporter(reporter) {}
 
97
//    ~DocumentScope() {}
 
98
//
 
99
//    ostream& default_reporter() { return m_reporter; }
 
100
//    IdAssigner* id_assigner() { return &m_idAssigner; }
 
101
//
 
102
//protected:
 
103
//    ostream& m_reporter;
 
104
//    IdAssigner m_idAssigner;
 
105
//
 
106
//};
 
107
 
 
108
//---------------------------------------------------------------------------------------
 
109
class Injector
 
110
{
 
111
public:
 
112
    Injector() {}
 
113
    ~Injector() {}
 
114
 
 
115
//    static LdpParser* inject_LdpParser(ApplicationScope& libraryScope,
 
116
//                                       DocumentScope& documentScope);
 
117
//    static Analyser* inject_Analyser(ApplicationScope& libraryScope,
 
118
//                                     DocumentScope& documentScope);
 
119
//    static ModelBuilder* inject_ModelBuilder(DocumentScope& documentScope);
 
120
//    static LdpCompiler* inject_LdpCompiler(ApplicationScope& libraryScope,
 
121
//                                           DocumentScope& documentScope);
 
122
//    static Document* inject_Document(ApplicationScope& libraryScope);
 
123
//    static ScreenDrawer* inject_ScreenDrawer(ApplicationScope& libraryScope);
 
124
////    static UserCommandExecuter* inject_UserCommandExecuter(Document* pDoc);
 
125
//    static View* inject_View(ApplicationScope& libraryScope, int viewType, Document* pDoc);  //UserCommandExecuter* pExec)
 
126
//    static SimpleView* inject_SimpleView(ApplicationScope& libraryScope, Document* pDoc);  //UserCommandExecuter* pExec)
 
127
//    static VerticalBookView* inject_VerticalBookView(ApplicationScope& libraryScope,
 
128
//                                                     Document* pDoc);  //UserCommandExecuter* pExec)
 
129
//    static HorizontalBookView* inject_HorizontalBookView(ApplicationScope& libraryScope,
 
130
//                                                         Document* pDoc);  //UserCommandExecuter* pExec)
 
131
//    static Interactor* inject_Interactor(ApplicationScope& libraryScope,
 
132
//                                         Document* pDoc, View* pView);   //, UserCommandExecuter* pExec);
 
133
//    static Presenter* inject_Presenter(ApplicationScope& libraryScope,
 
134
//                                       int viewType, Document* pDoc);
 
135
//    static Task* inject_Task(int taskType, Interactor* pIntor);
 
136
 
 
137
};
 
138
 
 
139
 
 
140
 
 
141
}   //namespace lenmus
 
142
 
 
143
#endif      //__LENMUS_INJECTORS_H__