Files
qt-creator/src/plugins/qt4projectmanager/qt4projectmanager.h

149 lines
4.2 KiB
C
Raw Normal View History

/**************************************************************************
2008-12-02 12:01:29 +01:00
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
2008-12-02 12:01:29 +01:00
**
** Contact: Nokia Corporation (qt-info@nokia.com)
2008-12-02 12:01:29 +01:00
**
**
** GNU Lesser General Public License Usage
**
2011-04-13 08:42:33 +02:00
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
2010-12-17 16:01:08 +01:00
** In addition, as a special exception, Nokia gives you certain additional
2011-04-13 08:42:33 +02:00
** rights. These rights are described in the Nokia Qt LGPL Exception
2010-12-17 16:01:08 +01:00
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
2011-04-13 08:42:33 +02:00
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
2010-12-17 16:01:08 +01:00
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
2008-12-02 12:01:29 +01:00
**
**************************************************************************/
2008-12-02 16:19:05 +01:00
2008-12-02 12:01:29 +01:00
#ifndef QT4PROJECTMANAGER_H
#define QT4PROJECTMANAGER_H
#include "qt4projectmanager_global.h"
2008-12-02 12:01:29 +01:00
#include <projectexplorer/iprojectmanager.h>
#include <projectexplorer/projectnodes.h>
namespace Core {
class IEditor;
}
2008-12-02 12:01:29 +01:00
namespace ExtensionSystem {
class PluginManager;
}
namespace ProjectExplorer {
class Project;
class ProjectExplorerPlugin;
class Node;
class ToolChain;
}
namespace QtSupport {
class QtVersionManager;
class BaseQtVersion;
2008-12-02 12:01:29 +01:00
}
namespace Qt4ProjectManager {
namespace Internal {
class Qt4Builder;
class ProFileEditorWidget;
2008-12-02 12:01:29 +01:00
class Qt4ProjectManagerPlugin;
class UnConfiguredSettings
{
public:
QtSupport::BaseQtVersion *version;
ProjectExplorer::ToolChain *toolchain;
};
2008-12-02 12:01:29 +01:00
}
class Qt4Project;
class QT4PROJECTMANAGER_EXPORT Qt4Manager : public ProjectExplorer::IProjectManager
2008-12-02 12:01:29 +01:00
{
Q_OBJECT
public:
Qt4Manager(Internal::Qt4ProjectManagerPlugin *plugin);
2008-12-02 12:01:29 +01:00
~Qt4Manager();
void init();
void registerProject(Qt4Project *project);
void unregisterProject(Qt4Project *project);
void notifyChanged(const QString &name);
2008-12-02 12:01:29 +01:00
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
virtual QString mimeType() const;
ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString);
2008-12-02 12:01:29 +01:00
// Context information used in the slot implementations
ProjectExplorer::Node *contextNode() const;
void setContextNode(ProjectExplorer::Node *node);
void setContextProject(ProjectExplorer::Project *project);
ProjectExplorer::Project *contextProject() const;
// Return the id string of a file
static QString fileTypeId(ProjectExplorer::FileType type);
enum Action { BUILD, REBUILD, CLEAN };
/// Settings to use for codemodel if no targets exist
Internal::UnConfiguredSettings unconfiguredSettings() const;
void setUnconfiguredSettings(const Internal::UnConfiguredSettings &setting);
signals:
void unconfiguredSettingsChanged();
2008-12-02 12:01:29 +01:00
public slots:
void addLibrary();
void addLibraryContextMenu();
2008-12-02 12:01:29 +01:00
void runQMake();
void runQMakeContextMenu();
void buildSubDirContextMenu();
void rebuildSubDirContextMenu();
void cleanSubDirContextMenu();
2008-12-02 12:01:29 +01:00
private slots:
void editorAboutToClose(Core::IEditor *editor);
void uiEditorContentsChanged();
void editorChanged(Core::IEditor*);
void updateVariable(const QByteArray &variable);
2008-12-02 12:01:29 +01:00
private:
QList<Qt4Project *> m_projects;
void handleSubDirContexMenu(Action action);
void addLibrary(const QString &fileName, Internal::ProFileEditorWidget *editor = 0);
void runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *node);
2008-12-02 12:01:29 +01:00
Internal::Qt4ProjectManagerPlugin *m_plugin;
mutable int m_unConfiguredVersionId;
mutable QString m_unconfiguredToolChainId;
2008-12-02 12:01:29 +01:00
ProjectExplorer::Node *m_contextNode;
ProjectExplorer::Project *m_contextProject;
Core::IEditor *m_lastEditor;
bool m_dirty;
2008-12-02 12:01:29 +01:00
};
2008-12-02 16:19:05 +01:00
} // namespace Qt4ProjectManager
2008-12-02 12:01:29 +01:00
2008-12-02 16:19:05 +01:00
#endif // QT4PROJECTMANAGER_H