diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e9ae80694875f869892f13f4fcaf1170a00dea41 (patch) | |
tree | aa2f8d8a217e2d376224c8d46b7397b68d35de2d /quanta/utility/tagactionmanager.cpp | |
download | tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/utility/tagactionmanager.cpp')
-rw-r--r-- | quanta/utility/tagactionmanager.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/quanta/utility/tagactionmanager.cpp b/quanta/utility/tagactionmanager.cpp new file mode 100644 index 00000000..21183073 --- /dev/null +++ b/quanta/utility/tagactionmanager.cpp @@ -0,0 +1,83 @@ +/*************************************************************************** + tagactionmanager.cpp + ------------------- + + copyright : (C) 2004 - Paulo Moura Guedes + email : moura@kdewebdev.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include <kstaticdeleter.h> +#include <kactioncollection.h> +#include <kaction.h> +#include <khtmlview.h> +#include <klocale.h> +#include <dom/dom_node.h> + +#include <qwidget.h> + +#include "tagactionmanager.h" +#include "tagactionset.h" +#include "resource.h" +#include "wkafkapart.h" + + +TagActionManager* TagActionManager::s_mSelf = 0; +static KStaticDeleter<TagActionManager> staticDeleter; + + +TagActionManager::TagActionManager() + : m_actionCollection(0) +{ + s_mSelf = this; + initActions(KafkaDocument::ref()->getKafkaWidget()->view()); +} + +TagActionManager::~TagActionManager() +{} + +TagActionManager* TagActionManager::self() +{ + if (!s_mSelf) + { + staticDeleter.setObject(s_mSelf, new TagActionManager()); + } + + return s_mSelf; +} + +void TagActionManager::initActions(QWidget* parent) +{ + Q_ASSERT(parent); + + m_actionCollection = new KActionCollection(parent); + + TagActionSet* general(new TagActionSet()); + general->initActions(parent); + m_tagActionSets.append(general); + + TableTagActionSet* table(new TableTagActionSet()); + table->initActions(parent); + m_tagActionSets.append(table); +} + +void TagActionManager::fillWithTagActions(QWidget* widget, DOM::Node const& node) +{ + TagActionSetAbstract* tagActionSet = 0; + for(tagActionSet = m_tagActionSets.first(); tagActionSet; tagActionSet = m_tagActionSets.next()) + tagActionSet->fillWithTagActions(widget, node); +} + +bool TagActionManager::canIndentDTD(QString const& dtd) +{ + return (dtd.contains("HTML", false) || + dtd.contains("XML", false)); +} |