OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qt4projectmanager.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef QT4PROJECTMANAGER_H
34 #define QT4PROJECTMANAGER_H
35
36 #include <projectexplorer/iprojectmanager.h>
37 #include <projectexplorer/projectnodes.h>
38
39 namespace Core {
40     class IEditor;
41 }
42
43 namespace ExtensionSystem {
44 class PluginManager;
45 }
46
47 namespace ProjectExplorer {
48 class Project;
49 class ProjectExplorerPlugin;
50 class Node;
51 class QtVersionManager;
52 }
53
54 namespace Qt4ProjectManager {
55
56 namespace Internal {
57 class Qt4Builder;
58 class ProFileEditorWidget;
59 class Qt4ProjectManagerPlugin;
60 }
61
62 class Qt4Project;
63
64 class Qt4Manager : public ProjectExplorer::IProjectManager
65 {
66     Q_OBJECT
67
68 public:
69     Qt4Manager(Internal::Qt4ProjectManagerPlugin *plugin);
70     ~Qt4Manager();
71
72     void init();
73
74     void registerProject(Qt4Project *project);
75     void unregisterProject(Qt4Project *project);
76     void notifyChanged(const QString &name);
77
78     ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
79
80     // ProjectExplorer::IProjectManager
81     Core::Context projectContext() const;
82     Core::Context projectLanguage() const;
83
84     virtual QString mimeType() const;
85     ProjectExplorer::Project *openProject(const QString &fileName);
86
87     // Context information used in the slot implementations
88     ProjectExplorer::Node *contextNode() const;
89     void setContextNode(ProjectExplorer::Node *node);
90     void setContextProject(ProjectExplorer::Project *project);
91     ProjectExplorer::Project *contextProject() const;
92
93     // Return the id string of a file
94     static QString fileTypeId(ProjectExplorer::FileType type);
95
96     enum Action { BUILD, REBUILD, CLEAN };
97
98 public slots:
99     void runQMake();
100     void runQMakeContextMenu();
101     void buildSubDirContextMenu();
102     void rebuildSubDirContextMenu();
103     void cleanSubDirContextMenu();
104
105 private slots:
106     void editorAboutToClose(Core::IEditor *editor);
107     void uiEditorContentsChanged();
108     void editorChanged(Core::IEditor*);
109     void updateVariable(const QString &variable);
110
111 private:
112     QList<Qt4Project *> m_projects;
113     void handleSubDirContexMenu(Action action);
114     void runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *node);
115
116     Internal::Qt4ProjectManagerPlugin *m_plugin;
117
118     ProjectExplorer::Node *m_contextNode;
119     ProjectExplorer::Project *m_contextProject;
120
121     Core::IEditor *m_lastEditor;
122     bool m_dirty;
123 };
124
125 } // namespace Qt4ProjectManager
126
127 #endif // QT4PROJECTMANAGER_H