diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2011-02-01 18:36:00 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2011-02-21 18:33:23 +0100 |
commit | 8d0c47724599ad279a88e3632784be40cc4175da (patch) | |
tree | 7c4408a1d2f14f3ac5d33711fc1241ea8b4821d1 /src/plugins/projectexplorer/toolchainmanager.h | |
parent | be31c80b02f752484e76faa215eae616a80e24e3 (diff) |
ToolChain: Refactor toolchain support
Refactor ToolChains in Qt Creator:
* Allow for several toolchains of the same type
* Be smarter wrt. guessing what kind of output a toolchain
produces. This allows us to eventually handle e.g. embedded
linux setups way better than before.
* Be smarter wrt. guessing what kind of environment a Qt version
needs.
* Improve auto-detection of toolchains a bit
* Decide on which debugger to use based on the kind of output
produced by the compiler.
* Add options page to configure toolchains
* Remove toolchain related options from the Qt version dialog
Reviewed-by: dt
Diffstat (limited to 'src/plugins/projectexplorer/toolchainmanager.h')
-rw-r--r-- | src/plugins/projectexplorer/toolchainmanager.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/toolchainmanager.h b/src/plugins/projectexplorer/toolchainmanager.h new file mode 100644 index 0000000000..c8ed740549 --- /dev/null +++ b/src/plugins/projectexplorer/toolchainmanager.h @@ -0,0 +1,96 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef TOOLCHAINMANAGER_H +#define TOOLCHAINMANAGER_H + +#include "projectexplorer_export.h" + +#include "abi.h" +#include "toolchain.h" + +#include <QtCore/QList> +#include <QtCore/QObject> +#include <QtCore/QString> + +namespace ProjectExplorer { +class ProjectExplorerPlugin; +class ToolChain; +class ToolChainFactory; + +namespace Internal { +class ToolChainManagerPrivate; +} + +// -------------------------------------------------------------------------- +// ToolChainManager +// -------------------------------------------------------------------------- + +class PROJECTEXPLORER_EXPORT ToolChainManager : public QObject +{ + Q_OBJECT + +public: + static ToolChainManager *instance(); + ~ToolChainManager(); + + QList<ToolChain *> toolChains() const; + QList<ToolChain *> findToolChains(const Abi &abi) const; + ToolChain *findToolChain(const QString &id) const; + +public slots: + void registerToolChain(ProjectExplorer::ToolChain *tc); + void deregisterToolChain(ProjectExplorer::ToolChain *tc); + +signals: + void toolChainAdded(ProjectExplorer::ToolChain *); + // ToolChain is still valid when this call happens! + void toolChainRemoved(ProjectExplorer::ToolChain *); + +private: + explicit ToolChainManager(QObject *parent = 0); + + // Make sure the ToolChain Manager is only created after all + // ToolChain Factories are registered! + void restoreToolChains(); + + Internal::ToolChainManagerPrivate *const m_d; + + static ToolChainManager *m_instance; + + friend class ProjectExplorerPlugin; +}; + +} // namespace ProjectExplorer + +#endif // TOOLCHAINMANAGER_H |