From b3efcb271d46e04c95a2547422a1ec0e2286152d Mon Sep 17 00:00:00 2001 From: Radovan Zivkovic Date: Mon, 7 Oct 2013 12:48:27 +0200 Subject: Renamed ITool to IConfigurationTool. Change-Id: I81a0944ddc611a93c1d7fda95d72dc00b7960db5 Reviewed-by: Tobias Hunger --- .../interfaces/iconfigurationtool.h | 55 ++++ .../vcprojectmanager/interfaces/interfaces.pri | 4 +- src/plugins/vcprojectmanager/interfaces/itool.h | 55 ---- .../vcprojectmanager/interfaces/itooldescription.h | 4 +- src/plugins/vcprojectmanager/interfaces/itools.h | 10 +- src/plugins/vcprojectmanager/vcproject.cpp | 2 +- .../vcprojectmodel/activexreference.cpp | 317 +++------------------ .../vcprojectmodel/activexreference.h | 62 +--- .../vcprojectmodel/configuration.cpp | 6 +- .../vcprojectmodel/configurationtools.cpp | 20 +- .../vcprojectmodel/configurationtools.h | 10 +- .../vcprojectmodel/tools/configurationtool.cpp | 2 +- .../vcprojectmodel/tools/configurationtool.h | 6 +- .../tools/toolattributes/tooldescription.cpp | 2 +- .../tools/toolattributes/tooldescription.h | 2 +- .../vcprojectmodel/vcprojectdocument_constants.h | 11 + .../widgets/configurationswidgets.cpp | 2 +- .../widgets/configurationwidgets.cpp | 2 +- 18 files changed, 160 insertions(+), 412 deletions(-) create mode 100644 src/plugins/vcprojectmanager/interfaces/iconfigurationtool.h delete mode 100644 src/plugins/vcprojectmanager/interfaces/itool.h diff --git a/src/plugins/vcprojectmanager/interfaces/iconfigurationtool.h b/src/plugins/vcprojectmanager/interfaces/iconfigurationtool.h new file mode 100644 index 0000000000..51472ee9ed --- /dev/null +++ b/src/plugins/vcprojectmanager/interfaces/iconfigurationtool.h @@ -0,0 +1,55 @@ +/************************************************************************** +** +** Copyright (c) 2013 Bojan Petrovic +** Copyright (c) 2013 Radovan Zivkovic +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#ifndef VCPROJECTMANAGER_INTERNAL_ITOOL_H +#define VCPROJECTMANAGER_INTERNAL_ITOOL_H + +#include +#include "../vcprojectmodel/ivcprojectnodemodel.h" + +namespace VcProjectManager { +namespace Internal { + +class ISectionContainer; +class IToolDescription; + +class IConfigurationTool : public IVcProjectXMLNode +{ +public: + virtual ~IConfigurationTool() {} + + virtual ISectionContainer* sectionContainer() const = 0; + virtual const IToolDescription* toolDescription() const = 0; + virtual IConfigurationTool* clone() const = 0; +}; + +} // namespace Internal +} // namespace VcProjectManager + +#endif // VCPROJECTMANAGER_INTERNAL_ITOOL_H diff --git a/src/plugins/vcprojectmanager/interfaces/interfaces.pri b/src/plugins/vcprojectmanager/interfaces/interfaces.pri index 98fcd874d7..4bd95259e9 100644 --- a/src/plugins/vcprojectmanager/interfaces/interfaces.pri +++ b/src/plugins/vcprojectmanager/interfaces/interfaces.pri @@ -1,6 +1,5 @@ HEADERS += \ interfaces/itools.h \ - interfaces/itool.h \ interfaces/iconfiguration.h \ interfaces/iattributecontainer.h \ interfaces/isectioncontainer.h \ @@ -12,4 +11,5 @@ HEADERS += \ interfaces/iconfigurations.h \ interfaces/ifile.h \ interfaces/ifilecontainer.h \ - interfaces/ifiles.h + interfaces/ifiles.h \ + interfaces/iconfigurationtool.h diff --git a/src/plugins/vcprojectmanager/interfaces/itool.h b/src/plugins/vcprojectmanager/interfaces/itool.h deleted file mode 100644 index 347f547f50..0000000000 --- a/src/plugins/vcprojectmanager/interfaces/itool.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** -** -** Copyright (c) 2013 Bojan Petrovic -** Copyright (c) 2013 Radovan Zivkovic -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ -#ifndef VCPROJECTMANAGER_INTERNAL_ITOOL_H -#define VCPROJECTMANAGER_INTERNAL_ITOOL_H - -#include -#include "../vcprojectmodel/ivcprojectnodemodel.h" - -namespace VcProjectManager { -namespace Internal { - -class ISectionContainer; -class IToolDescription; - -class ITool : public IVcProjectXMLNode -{ -public: - virtual ~ITool() {} - - virtual ISectionContainer* sectionContainer() const = 0; - virtual const IToolDescription* toolDescription() const = 0; - virtual ITool* clone() const = 0; -}; - -} // namespace Internal -} // namespace VcProjectManager - -#endif // VCPROJECTMANAGER_INTERNAL_ITOOL_H diff --git a/src/plugins/vcprojectmanager/interfaces/itooldescription.h b/src/plugins/vcprojectmanager/interfaces/itooldescription.h index 803101ffef..77eca758e0 100644 --- a/src/plugins/vcprojectmanager/interfaces/itooldescription.h +++ b/src/plugins/vcprojectmanager/interfaces/itooldescription.h @@ -35,7 +35,7 @@ namespace VcProjectManager { namespace Internal { -class ITool; +class IConfigurationTool; class IToolSectionDescription; class IToolDescription @@ -53,7 +53,7 @@ public: virtual QString toolDisplayName() const = 0; virtual void setToolDisplayName(const QString &toolDisplayName) = 0; - virtual ITool* createTool() const = 0; + virtual IConfigurationTool* createTool() const = 0; }; } // Internal diff --git a/src/plugins/vcprojectmanager/interfaces/itools.h b/src/plugins/vcprojectmanager/interfaces/itools.h index 25a7663938..1ab44380ad 100644 --- a/src/plugins/vcprojectmanager/interfaces/itools.h +++ b/src/plugins/vcprojectmanager/interfaces/itools.h @@ -36,17 +36,17 @@ namespace VcProjectManager { namespace Internal { -class ITool; +class IConfigurationTool; class ITools { public: virtual ~ITools() {} virtual ITools& operator= (const ITools &tools) = 0; - virtual void addTool(ITool *tool) = 0; - virtual void removeTool(ITool *tool) = 0; - virtual ITool* tool(const QString &toolKey) const = 0; - virtual ITool* tool(int index) const = 0; + virtual void addTool(IConfigurationTool *tool) = 0; + virtual void removeTool(IConfigurationTool *tool) = 0; + virtual IConfigurationTool* tool(const QString &toolKey) const = 0; + virtual IConfigurationTool* tool(int index) const = 0; virtual int toolCount() const = 0; virtual void appendToXMLNode(QDomElement &domElement, QDomDocument &domDocument) const = 0; }; diff --git a/src/plugins/vcprojectmanager/vcproject.cpp b/src/plugins/vcprojectmanager/vcproject.cpp index 9272e43866..eaace93b85 100644 --- a/src/plugins/vcprojectmanager/vcproject.cpp +++ b/src/plugins/vcprojectmanager/vcproject.cpp @@ -311,7 +311,7 @@ void VcProject::updateCodeModels() IConfiguration *configModel = m_projectFile->documentModel()->vcProjectDocument()->configurations()->configurationContainer()->configuration(configName); if (configModel) { - ITool *configTool = configModel->tools()->tool(QLatin1String(ToolConstants::strVCCLCompilerTool)); + IConfigurationTool *configTool = configModel->tools()->tool(QLatin1String(ToolConstants::strVCCLCompilerTool)); if (configTool) { for (int i = 0; i < configTool->sectionContainer()->sectionCount(); ++i) { IToolSection *toolSection = configTool->sectionContainer()->section(i); diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.cpp b/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.cpp index d03af533a0..36ed79ab49 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.cpp +++ b/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.cpp @@ -31,13 +31,38 @@ #include #include "configurationsfactory.h" +#include "generalattributecontainer.h" +#include "configurationcontainer.h" namespace VcProjectManager { namespace Internal { +ActiveXReference::ActiveXReference() +{ +} + +ActiveXReference::ActiveXReference(const ActiveXReference &ref) +{ + m_attributeContainer = new GeneralAttributeContainer; + m_configurations = new ConfigurationContainer; + *m_attributeContainer = *ref.m_attributeContainer; + *m_configurations = *ref.m_configurations; +} + +IReference &ActiveXReference::operator =(const IReference &ref) +{ + if (this != &ref) { + *m_attributeContainer = *ref.attributeContainer(); + *m_configurations = *ref.configurations(); + } + + return *this; +} + ActiveXReference::~ActiveXReference() { - qDeleteAll(m_referenceConfigurations); + delete m_attributeContainer; + delete m_configurations; } void ActiveXReference::processNode(const QDomNode &node) @@ -65,14 +90,16 @@ void ActiveXReference::processNodeAttributes(const QDomElement &element) if (domNode.nodeType() == QDomNode::AttributeNode) { QDomAttr domElement = domNode.toAttr(); - if (domElement.name() == QLatin1String("ControlGUID")) - m_controlGUID = domElement.value(); - - else if (domElement.name() == QLatin1String("ControlVersion")) - m_controlVersion = domElement.value(); - - else if (domElement.name() == QLatin1String("WrapperTool")) - m_wrapperTool = domElement.value(); + if (domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_CONTROL_GUID) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_CONTROL_VERSION) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_WRAPPER_TOOL) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_LOCAL_ID) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_USE_IN_BUILD) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_COPY_LOCAL) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_COPY_LOCAL_DEPENDENCIES) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_COPY_LOCAL_SATELITE_ASSEMBLIES) || + domElement.name() == QLatin1String(VcDocConstants::ACTIVEX_REFERENCE_USE_DEPENDENCIES_IN_BUILD)) + m_attributeContainer->setAttribute(domElement.name(), domElement.value()); } } } @@ -86,122 +113,32 @@ VcNodeWidget *ActiveXReference::createSettingsWidget() QDomNode ActiveXReference::toXMLDomNode(QDomDocument &domXMLDocument) const { QDomElement activeXNode = domXMLDocument.createElement(QLatin1String("ActiveXReference")); - - activeXNode.setAttribute(QLatin1String("ControlGUID"), m_controlGUID); - activeXNode.setAttribute(QLatin1String("ControlVersion"), m_controlVersion); - activeXNode.setAttribute(QLatin1String("WrapperTool"), m_wrapperTool); - - foreach (const IConfiguration *refConfig, m_referenceConfigurations) - activeXNode.appendChild(refConfig->toXMLDomNode(domXMLDocument)); + m_attributeContainer->appendToXMLNode(activeXNode); + m_configurations->appendToXMLNode(activeXNode, domXMLDocument); return activeXNode; } -void ActiveXReference::addReferenceConfiguration(IConfiguration *refConfig) -{ - if (m_referenceConfigurations.contains(refConfig)) - return; - - // Don't add configuration with the same name - foreach (const IConfiguration *refConf, m_referenceConfigurations) { - if (refConfig->fullName() == refConf->fullName()) - return; - } - - m_referenceConfigurations.append(refConfig); -} - -void ActiveXReference::removeReferenceConfiguration(IConfiguration *refConfig) -{ - m_referenceConfigurations.removeAll(refConfig); -} - -void ActiveXReference::removeReferenceConfiguration(const QString &refConfigName) -{ - foreach (IConfiguration *refConfig, m_referenceConfigurations) { - if (refConfig->fullName() == refConfigName) { - m_referenceConfigurations.removeOne(refConfig); - delete refConfig; - return; - } - } -} - -IConfiguration* ActiveXReference::referenceConfiguration(const QString &refConfigName) const -{ - foreach (IConfiguration *refConfig, m_referenceConfigurations) { - if (refConfig->fullName() == refConfigName) - return refConfig; - } - - return 0; -} - -QString ActiveXReference::controlGUID() const +IAttributeContainer *ActiveXReference::attributeContainer() const { - return m_controlGUID; + return m_attributeContainer; } -void ActiveXReference::setControlGUID(const QString &ctrlGUID) +ConfigurationContainer *ActiveXReference::configurations() const { - m_controlGUID = ctrlGUID; + return m_configurations; } -QString ActiveXReference::controlVersion() const +QString ActiveXReference::type() const { - return m_controlVersion; -} - -void ActiveXReference::setControlVersion(const QString &ctrlVersion) -{ - m_controlVersion = ctrlVersion; -} - -QString ActiveXReference::wrapperTool() const -{ - return m_wrapperTool; -} - -void ActiveXReference::setWrapperTool(const QString &wrapperTool) -{ - m_wrapperTool = wrapperTool; -} - -ActiveXReference::ActiveXReference() -{ -} - -ActiveXReference::ActiveXReference(const ActiveXReference &ref) -{ - m_controlGUID = ref.m_controlGUID; - m_controlVersion = ref.m_controlVersion; - m_wrapperTool = ref.m_wrapperTool; - - foreach (const IConfiguration *refConf, ref.m_referenceConfigurations) - m_referenceConfigurations.append(refConf->clone()); -} - -ActiveXReference &ActiveXReference::operator =(const ActiveXReference &ref) -{ - if (this != &ref) { - m_controlGUID = ref.m_controlGUID; - m_controlVersion = ref.m_controlVersion; - m_wrapperTool = ref.m_wrapperTool; - - m_referenceConfigurations.clear(); - - foreach (const IConfiguration *refConf, ref.m_referenceConfigurations) - m_referenceConfigurations.append(refConf->clone()); - } - - return *this; + return QLatin1String(VcDocConstants::ACTIVEX_REFERENCE); } void ActiveXReference::processReferenceConfig(const QDomNode &referenceConfig) { IConfiguration *referenceConfiguration = createReferenceConfiguration(); referenceConfiguration->processNode(referenceConfig); - m_referenceConfigurations.append(referenceConfiguration); + m_configurations->addConfiguration(referenceConfiguration); // process next sibling QDomNode nextSibling = referenceConfig.nextSibling(); @@ -214,12 +151,6 @@ ActiveXReference2003::ActiveXReference2003(const ActiveXReference2003 &ref) { } -ActiveXReference2003 &ActiveXReference2003::operator =(const ActiveXReference2003 &ref) -{ - ActiveXReference::operator =(ref); - return *this; -} - ActiveXReference2003::~ActiveXReference2003() { } @@ -244,90 +175,15 @@ ActiveXReference2005::ActiveXReference2005(const ActiveXReference2005 &ref) { } -ActiveXReference2005 &ActiveXReference2005::operator =(const ActiveXReference2005 &ref) -{ - ActiveXReference2003::operator =(ref); - return *this; -} - ActiveXReference2005::~ActiveXReference2005() { } -void ActiveXReference2005::processNodeAttributes(const QDomElement &element) -{ - ActiveXReference2003::processNodeAttributes(element); - - QDomNamedNodeMap namedNodeMap = element.attributes(); - - for (int i = 0; i < namedNodeMap.size(); ++i) { - QDomNode domNode = namedNodeMap.item(i); - - if (domNode.nodeType() == QDomNode::AttributeNode) { - QDomAttr domElement = domNode.toAttr(); - - if (domElement.name() == QLatin1String("LocaleID")) - m_localeID = domElement.value(); - - else if (domElement.name() == QLatin1String("CopyLocal")) - m_copyLocal = domElement.value(); - - else if (domElement.name() == QLatin1String("UseInBuild")) { - if (domElement.value() == QLatin1String("false")) - m_useInBuild = false; - else - m_useInBuild = true; - } - } - } -} - -QDomNode ActiveXReference2005::toXMLDomNode(QDomDocument &domXMLDocument) const -{ - QDomElement activeXNode = ActiveXReference2003::toXMLDomNode(domXMLDocument).toElement(); - - activeXNode.setAttribute(QLatin1String("LocaleID"), m_localeID); - activeXNode.setAttribute(QLatin1String("CopyLocal"), m_copyLocal); - activeXNode.setAttribute(QLatin1String("UseInBuild"), QVariant(m_useInBuild).toString()); - - return activeXNode; -} - ActiveXReference::Ptr ActiveXReference2005::clone() const { return ActiveXReference::Ptr(new ActiveXReference2005(*this)); } -QString ActiveXReference2005::localeID() const -{ - return m_localeID; -} - -void ActiveXReference2005::setLocaleID(const QString &localeID) -{ - m_localeID = localeID; -} - -QString ActiveXReference2005::copyLocal() const -{ - return m_copyLocal; -} - -void ActiveXReference2005::setCopyLocal(const QString ©Local) -{ - m_copyLocal = copyLocal; -} - -bool ActiveXReference2005::useInBuild() const -{ - return m_useInBuild; -} - -void ActiveXReference2005::setUseInBuild(bool useInBuild) -{ - m_useInBuild = useInBuild; -} - ActiveXReference2005::ActiveXReference2005() { } @@ -343,98 +199,15 @@ ActiveXReference2008::ActiveXReference2008(const ActiveXReference2008 &ref) { } -ActiveXReference2008 &ActiveXReference2008::operator =(const ActiveXReference2008 &ref) -{ - ActiveXReference2005::operator =(ref); - return *this; -} - ActiveXReference2008::~ActiveXReference2008() { } -void ActiveXReference2008::processNodeAttributes(const QDomElement &element) -{ - ActiveXReference2005::processNodeAttributes(element); - - QDomNamedNodeMap namedNodeMap = element.attributes(); - - for (int i = 0; i < namedNodeMap.size(); ++i) { - QDomNode domNode = namedNodeMap.item(i); - - if (domNode.nodeType() == QDomNode::AttributeNode) { - QDomAttr domElement = domNode.toAttr(); - - if (domElement.name() == QLatin1String("CopyLocalDependencies")) { - if (domElement.value() == QLatin1String("false")) - m_copyLocalDependencies = false; - else - m_copyLocalDependencies = true; - } - - else if (domElement.name() == QLatin1String("CopyLocalSatelliteAssemblies")) { - if (domElement.value() == QLatin1String("false")) - m_copyLocalSatelliteAssemblies = false; - else - m_copyLocalSatelliteAssemblies = true; - } - - else if (domElement.name() == QLatin1String("UseDependenciesInBuild")) { - if (domElement.value() == QLatin1String("false")) - m_useDependenciesInBuild = false; - else - m_useDependenciesInBuild = true; - } - } - } -} - -QDomNode ActiveXReference2008::toXMLDomNode(QDomDocument &domXMLDocument) const -{ - QDomElement activeXNode = ActiveXReference2005::toXMLDomNode(domXMLDocument).toElement(); - - activeXNode.setAttribute(QLatin1String("CopyLocalDependencies"), QVariant(m_copyLocalDependencies).toString()); - activeXNode.setAttribute(QLatin1String("CopyLocalSatelliteAssemblies"), QVariant(m_copyLocalSatelliteAssemblies).toString()); - activeXNode.setAttribute(QLatin1String("UseDependenciesInBuild"), QVariant(m_useDependenciesInBuild).toString()); - - return activeXNode; -} - ActiveXReference::Ptr ActiveXReference2008::clone() const { return ActiveXReference::Ptr(new ActiveXReference2005(*this)); } -bool ActiveXReference2008::copyLocalDependencies() const -{ - return m_copyLocalDependencies; -} - -void ActiveXReference2008::setCopyLocalDependencies(bool copyLocalDependencies) -{ - m_copyLocalDependencies = copyLocalDependencies; -} - -bool ActiveXReference2008::copyLocalSatelliteAssemblies() const -{ - return m_copyLocalSatelliteAssemblies; -} - -void ActiveXReference2008::setCopyLocalSatelliteAssemblies(bool copyLocalSatelliteAssemblies) -{ - m_copyLocalSatelliteAssemblies = copyLocalSatelliteAssemblies; -} - -bool ActiveXReference2008::useDependenciesInBuild() const -{ - return m_useDependenciesInBuild; -} - -void ActiveXReference2008::setUseDependenciesInBuild(bool useDependenciesInBuild) -{ - m_useDependenciesInBuild = useDependenciesInBuild; -} - ActiveXReference2008::ActiveXReference2008() { } diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.h b/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.h index e079b58ccf..45c878a6d3 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.h +++ b/src/plugins/vcprojectmanager/vcprojectmodel/activexreference.h @@ -37,40 +37,35 @@ namespace VcProjectManager { namespace Internal { -class ActiveXReference : public IVcProjectXMLNode +class ActiveXReference : public IReference { friend class ActiveXReferenceFactory; public: typedef QSharedPointer Ptr; + ActiveXReference(); + ActiveXReference(const ActiveXReference &ref); + IReference &operator =(const IReference &ref); + virtual ~ActiveXReference(); void processNode(const QDomNode &node); VcNodeWidget* createSettingsWidget(); QDomNode toXMLDomNode(QDomDocument &domXMLDocument) const; + // IReference interface + IAttributeContainer *attributeContainer() const; + ConfigurationContainer *configurations() const; + QString type() const; + /*! * Implement in order to support creating a clone of a ActiveXReference instance. * \return A shared pointer to a newly created clone. */ virtual ActiveXReference::Ptr clone() const = 0; - void addReferenceConfiguration(IConfiguration *refConfig); - void removeReferenceConfiguration(IConfiguration *refConfig); - void removeReferenceConfiguration(const QString &refConfigName); - IConfiguration *referenceConfiguration(const QString &refConfigName) const; - - QString controlGUID() const; - void setControlGUID(const QString &ctrlGUID); - QString controlVersion() const; - void setControlVersion(const QString &ctrlVersion); - QString wrapperTool() const; - void setWrapperTool(const QString &wrapperTool); - protected: - ActiveXReference(); - ActiveXReference(const ActiveXReference &ref); - ActiveXReference& operator=(const ActiveXReference &ref); + virtual void processNodeAttributes(const QDomElement &element); virtual void processReferenceConfig(const QDomNode &referenceConfig); @@ -80,10 +75,8 @@ protected: */ virtual IConfiguration* createReferenceConfiguration() const = 0; - QString m_controlGUID; // required - QString m_controlVersion; // required - QString m_wrapperTool; // required - QList m_referenceConfigurations; + IAttributeContainer *m_attributeContainer; + ConfigurationContainer *m_configurations; }; class ActiveXReference2003 : public ActiveXReference @@ -92,7 +85,6 @@ class ActiveXReference2003 : public ActiveXReference public: ActiveXReference2003(const ActiveXReference2003 &ref); - ActiveXReference2003& operator=(const ActiveXReference2003 &ref); ~ActiveXReference2003(); ActiveXReference::Ptr clone() const; @@ -109,27 +101,13 @@ class ActiveXReference2005 : public ActiveXReference2003 public: ActiveXReference2005(const ActiveXReference2005 &ref); - ActiveXReference2005& operator=(const ActiveXReference2005 &ref); ~ActiveXReference2005(); - QDomNode toXMLDomNode(QDomDocument &domXMLDocument) const; ActiveXReference::Ptr clone() const; - QString localeID() const; - void setLocaleID(const QString &localeID); - QString copyLocal() const; - void setCopyLocal(const QString ©Local); - bool useInBuild() const; - void setUseInBuild(bool useInBuild); - protected: ActiveXReference2005(); IConfiguration *createReferenceConfiguration() const; - void processNodeAttributes(const QDomElement &element); - - QString m_localeID; // opt - QString m_copyLocal; // opt - bool m_useInBuild; // opt, default "true" }; class ActiveXReference2008 : public ActiveXReference2005 @@ -138,27 +116,13 @@ class ActiveXReference2008 : public ActiveXReference2005 public: ActiveXReference2008(const ActiveXReference2008 &ref); - ActiveXReference2008& operator=(const ActiveXReference2008 &ref); ~ActiveXReference2008(); - QDomNode toXMLDomNode(QDomDocument &domXMLDocument) const; ActiveXReference::Ptr clone() const; - bool copyLocalDependencies() const; - void setCopyLocalDependencies(bool copyLocalDependencies); - bool copyLocalSatelliteAssemblies() const; - void setCopyLocalSatelliteAssemblies(bool copyLocalSatelliteAssemblies); - bool useDependenciesInBuild() const; - void setUseDependenciesInBuild(bool useDependenciesInBuild); - protected: ActiveXReference2008(); IConfiguration* createReferenceConfiguration() const; - void processNodeAttributes(const QDomElement &element); - - bool m_copyLocalDependencies; //optional default: true - bool m_copyLocalSatelliteAssemblies; //optional default: true - bool m_useDependenciesInBuild; //optional default: true }; class ActiveXReferenceFactory diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/configuration.cpp b/src/plugins/vcprojectmanager/vcprojectmodel/configuration.cpp index 0afd0da71a..aa5e09f69a 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/configuration.cpp +++ b/src/plugins/vcprojectmanager/vcprojectmodel/configuration.cpp @@ -166,7 +166,7 @@ ITools *Configuration::tools() const void Configuration::processToolNode(const QDomNode &toolNode) { - ITool *toolConf = 0; + IConfigurationTool *toolConf = 0; QDomNamedNodeMap namedNodeMap = toolNode.toElement().attributes(); for (int i = 0; i < namedNodeMap.size(); ++i) { @@ -253,7 +253,7 @@ Configuration2005 &Configuration2005::operator=(const Configuration2005 &config) void Configuration2005::processToolNode(const QDomNode &toolNode) { if (toolNode.nodeName() == QLatin1String("Tool")) { - ITool *toolConf = 0; + IConfigurationTool *toolConf = 0; QDomNamedNodeMap namedNodeMap = toolNode.toElement().attributes(); for (int i = 0; i < namedNodeMap.size(); ++i) { @@ -374,7 +374,7 @@ Configuration2008::~Configuration2008() void Configuration2008::processToolNode(const QDomNode &toolNode) { if (toolNode.nodeName() == QLatin1String("Tool")) { - ITool *toolConf = 0; + IConfigurationTool *toolConf = 0; QDomNamedNodeMap namedNodeMap = toolNode.toElement().attributes(); for (int i = 0; i < namedNodeMap.size(); ++i) { diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.cpp b/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.cpp index c98a6c91ec..3d270b3ad2 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.cpp +++ b/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.cpp @@ -28,7 +28,7 @@ ** ****************************************************************************/ #include "configurationtools.h" -#include "../interfaces/itool.h" +#include "../interfaces/iconfigurationtool.h" #include "../interfaces/itooldescription.h" namespace VcProjectManager { @@ -45,7 +45,7 @@ ITools &ConfigurationTools::operator =(const ITools &tools) m_tools.clear(); for (int i = 0; i < tools.toolCount(); ++i) { - ITool *tool = tools.tool(i); + IConfigurationTool *tool = tools.tool(i); if (tool) m_tools.append(tool->clone()); @@ -55,12 +55,12 @@ ITools &ConfigurationTools::operator =(const ITools &tools) return *this; } -void ConfigurationTools::addTool(ITool *tool) +void ConfigurationTools::addTool(IConfigurationTool *tool) { if (!tool || m_tools.contains(tool)) return; - foreach (ITool *toolPtr, m_tools) { + foreach (IConfigurationTool *toolPtr, m_tools) { if (toolPtr->toolDescription()->toolKey() == tool->toolDescription()->toolKey()) return; } @@ -68,9 +68,9 @@ void ConfigurationTools::addTool(ITool *tool) m_tools.append(tool); } -void ConfigurationTools::removeTool(ITool *tool) +void ConfigurationTools::removeTool(IConfigurationTool *tool) { - foreach (ITool *toolPtr, m_tools) { + foreach (IConfigurationTool *toolPtr, m_tools) { if (toolPtr->toolDescription()->toolKey() == tool->toolDescription()->toolKey()) { m_tools.removeOne(toolPtr); delete toolPtr; @@ -79,9 +79,9 @@ void ConfigurationTools::removeTool(ITool *tool) } } -ITool *ConfigurationTools::tool(const QString &toolKey) const +IConfigurationTool *ConfigurationTools::tool(const QString &toolKey) const { - foreach (ITool *toolPtr, m_tools) { + foreach (IConfigurationTool *toolPtr, m_tools) { if (toolPtr->toolDescription()->toolKey() == toolKey) { return toolPtr; } @@ -90,7 +90,7 @@ ITool *ConfigurationTools::tool(const QString &toolKey) const return 0; } -ITool *ConfigurationTools::tool(int index) const +IConfigurationTool *ConfigurationTools::tool(int index) const { if (0 <= index && index < m_tools.size()) return m_tools[index]; @@ -105,7 +105,7 @@ int ConfigurationTools::toolCount() const void ConfigurationTools::appendToXMLNode(QDomElement &domElement, QDomDocument &domDocument) const { - foreach (const ITool *confTool, m_tools) + foreach (const IConfigurationTool *confTool, m_tools) domElement.appendChild(confTool->toXMLDomNode(domDocument)); } diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.h b/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.h index 59ccb4ee96..d5e7f966d2 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.h +++ b/src/plugins/vcprojectmanager/vcprojectmodel/configurationtools.h @@ -44,15 +44,15 @@ public: // ITools interface ITools &operator =(const ITools &tools); - void addTool(ITool *tool); - void removeTool(ITool *tool); - ITool *tool(const QString &toolKey) const; - ITool *tool(int index) const; + void addTool(IConfigurationTool *tool); + void removeTool(IConfigurationTool *tool); + IConfigurationTool *tool(const QString &toolKey) const; + IConfigurationTool *tool(int index) const; int toolCount() const; void appendToXMLNode(QDomElement &domElement, QDomDocument &domDocument) const; private: - QList m_tools; + QList m_tools; }; } // namespace Internal diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.cpp b/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.cpp index bb29466ceb..d7e0253d0d 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.cpp +++ b/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.cpp @@ -93,7 +93,7 @@ ISectionContainer *ConfigurationTool::sectionContainer() const return m_sectionContainer; } -ITool *ConfigurationTool::clone() const +IConfigurationTool *ConfigurationTool::clone() const { return new ConfigurationTool(*this); } diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.h b/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.h index c9411a7139..782aac4501 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.h +++ b/src/plugins/vcprojectmanager/vcprojectmodel/tools/configurationtool.h @@ -32,7 +32,7 @@ #include "../ivcprojectnodemodel.h" #include "../../widgets/toolwidgets/toolsettingswidget.h" -#include "../../interfaces/itool.h" +#include "../../interfaces/iconfigurationtool.h" #include #include @@ -44,7 +44,7 @@ class IToolAttribute; class ToolDescription; class ToolSection; -class ConfigurationTool : public ITool +class ConfigurationTool : public IConfigurationTool { public: ConfigurationTool(const IToolDescription* toolDesc); @@ -59,7 +59,7 @@ public: VcNodeWidget* createSettingsWidget(); ISectionContainer *sectionContainer() const; - ITool *clone() const; + IConfigurationTool *clone() const; private: void processNodeAttributes(const QDomElement &domElement); diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.cpp b/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.cpp index bc8a2a3880..994ce2ed10 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.cpp +++ b/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.cpp @@ -107,7 +107,7 @@ void ToolDescription::setToolDisplayName(const QString &toolName) m_displayName = toolName; } -ITool *ToolDescription::createTool() const +IConfigurationTool *ToolDescription::createTool() const { return new ConfigurationTool(this); } diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.h b/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.h index 557cc8a8f5..27513a6f92 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.h +++ b/src/plugins/vcprojectmanager/vcprojectmodel/tools/toolattributes/tooldescription.h @@ -57,7 +57,7 @@ public: QString toolDisplayName() const; void setToolDisplayName(const QString &toolDisplayName); - ITool* createTool() const; + IConfigurationTool* createTool() const; private: QString m_displayName; diff --git a/src/plugins/vcprojectmanager/vcprojectmodel/vcprojectdocument_constants.h b/src/plugins/vcprojectmanager/vcprojectmodel/vcprojectdocument_constants.h index 1d50fae1a1..3f715644fc 100644 --- a/src/plugins/vcprojectmanager/vcprojectmodel/vcprojectdocument_constants.h +++ b/src/plugins/vcprojectmanager/vcprojectmodel/vcprojectdocument_constants.h @@ -42,6 +42,17 @@ enum DocumentVersion DV_MSVC_2008 }; +const char ACTIVEX_REFERENCE [] = "VC_Doc_Model.ActiveXReference"; +const char ACTIVEX_REFERENCE_CONTROL_GUID [] = "ControlGUID"; +const char ACTIVEX_REFERENCE_CONTROL_VERSION [] = "ControlVersion"; +const char ACTIVEX_REFERENCE_WRAPPER_TOOL [] = "WrapperTool"; +const char ACTIVEX_REFERENCE_LOCAL_ID [] ="LocaleID"; +const char ACTIVEX_REFERENCE_COPY_LOCAL [] = "CopyLocal"; +const char ACTIVEX_REFERENCE_USE_IN_BUILD [] = "UseInBuild"; +const char ACTIVEX_REFERENCE_COPY_LOCAL_DEPENDENCIES [] = "CopyLocalDependencies"; +const char ACTIVEX_REFERENCE_COPY_LOCAL_SATELITE_ASSEMBLIES [] = "CopyLocalSatelliteAssemblies"; +const char ACTIVEX_REFERENCE_USE_DEPENDENCIES_IN_BUILD [] = "UseDependenciesInBuild"; + } // VcDocConstants } // namespace Internal } // namespace VcProjectManager diff --git a/src/plugins/vcprojectmanager/widgets/configurationswidgets.cpp b/src/plugins/vcprojectmanager/widgets/configurationswidgets.cpp index d4171f3063..4a0a4dfcee 100644 --- a/src/plugins/vcprojectmanager/widgets/configurationswidgets.cpp +++ b/src/plugins/vcprojectmanager/widgets/configurationswidgets.cpp @@ -273,7 +273,7 @@ IConfiguration *ConfigurationsBaseWidget::createConfiguration(const QString &con ToolDescription *toolDesc = tDDM->toolDescription(i); if (toolDesc) { - ITool *configTool = toolDesc->createTool(); + IConfigurationTool *configTool = toolDesc->createTool(); if (configTool) config->tools()->addTool(configTool); diff --git a/src/plugins/vcprojectmanager/widgets/configurationwidgets.cpp b/src/plugins/vcprojectmanager/widgets/configurationwidgets.cpp index 724c503f20..e6ba417304 100644 --- a/src/plugins/vcprojectmanager/widgets/configurationwidgets.cpp +++ b/src/plugins/vcprojectmanager/widgets/configurationwidgets.cpp @@ -67,7 +67,7 @@ ConfigurationBaseWidget::ConfigurationBaseWidget(Configuration *config) // add tool items for (int i = 0; i < m_config->tools()->toolCount(); ++i) { - ITool *configTool = m_config->tools()->tool(i); + IConfigurationTool *configTool = m_config->tools()->tool(i); if (configTool) { VcNodeWidget *toolWidget = configTool->createSettingsWidget(); -- cgit v1.2.3