1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
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.
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
33 #ifndef QT4PROJECTMANAGER_H
34 #define QT4PROJECTMANAGER_H
36 #include <projectexplorer/iprojectmanager.h>
37 #include <projectexplorer/projectnodes.h>
43 namespace ExtensionSystem {
47 namespace ProjectExplorer {
49 class ProjectExplorerPlugin;
51 class QtVersionManager;
54 namespace Qt4ProjectManager {
58 class ProFileEditorWidget;
59 class Qt4ProjectManagerPlugin;
64 class Qt4Manager : public ProjectExplorer::IProjectManager
69 Qt4Manager(Internal::Qt4ProjectManagerPlugin *plugin);
74 void registerProject(Qt4Project *project);
75 void unregisterProject(Qt4Project *project);
76 void notifyChanged(const QString &name);
78 ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
80 // ProjectExplorer::IProjectManager
81 Core::Context projectContext() const;
82 Core::Context projectLanguage() const;
84 virtual QString mimeType() const;
85 ProjectExplorer::Project *openProject(const QString &fileName);
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;
93 // Return the id string of a file
94 static QString fileTypeId(ProjectExplorer::FileType type);
96 enum Action { BUILD, REBUILD, CLEAN };
100 void runQMakeContextMenu();
101 void buildSubDirContextMenu();
102 void rebuildSubDirContextMenu();
103 void cleanSubDirContextMenu();
106 void editorAboutToClose(Core::IEditor *editor);
107 void uiEditorContentsChanged();
108 void editorChanged(Core::IEditor*);
109 void updateVariable(const QString &variable);
112 QList<Qt4Project *> m_projects;
113 void handleSubDirContexMenu(Action action);
114 void runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *node);
116 Internal::Qt4ProjectManagerPlugin *m_plugin;
118 ProjectExplorer::Node *m_contextNode;
119 ProjectExplorer::Project *m_contextProject;
121 Core::IEditor *m_lastEditor;
125 } // namespace Qt4ProjectManager
127 #endif // QT4PROJECTMANAGER_H