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/parts/kafka/htmlenhancer.h | |
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/parts/kafka/htmlenhancer.h')
-rw-r--r-- | quanta/parts/kafka/htmlenhancer.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/quanta/parts/kafka/htmlenhancer.h b/quanta/parts/kafka/htmlenhancer.h new file mode 100644 index 00000000..29ebe82f --- /dev/null +++ b/quanta/parts/kafka/htmlenhancer.h @@ -0,0 +1,105 @@ +/*************************************************************************** + htmlenhancer.h + ------------------- + + copyright : (C) 2003, 2004 - Nicolas Deschildre + email : ndeschildre@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. * + * * + ***************************************************************************/ + +#ifndef HTMLENHANCER_H +#define HTMLENHANCER_H + +#include <kurl.h> + +#include "nodeenhancer.h" + +class KConfig; +class Node; +class KafkaDocument; +class KStandardDirs; + +/** + * This class takes care of the following tasks for [X]HTML DTDs : + * - Add a TBODY DOM::Node to TABLE DOM::Node if necessary. + * - Update the src attr of the DOM::Node. + * - Display an little icon for scripts. + * - Load the CSS informations into the DOM tree. + * - Add a colourfull border to FORM, OL, DL, UL + */ + +class HTMLEnhancer : public NodeEnhancer +{ +public: + HTMLEnhancer(KafkaDocument *_wkafkapart); + virtual ~HTMLEnhancer(); + + /** + * This function modify the DOM::Node of the node. + * The DOM::Node must be built before calling this + * function. + * @param node The Node we want to enhance. + * @param parentDNode the parent DOM::Node of the root DOM::Node of node. + * @param nextDNode the DOM::Node next to the root DOM::Node of node. + */ + virtual bool enhanceNode(Node *node, DOM::Node parentDNode, DOM::Node nextDNode); + + /** + * This functions is called once the whole DOM::Node tree is built. It will add empty + * TEXT DOM::Node around block element or inside element when necessary + * so that the user can access every single part of kafka with the cursor. + * @param domNode The node we want to add these empty text around. + */ + virtual void postEnhanceNode(DOM::Node domNode); + + /** + * This function do the opposite of postEnhanceNode. Usefull to remove the + * extra Text DOM::Nodes when deleting a DOM::Node. + */ + virtual void postUnenhanceNode(DOM::Node domNode); + + /** + * Read the config. + * @m_config The config to read. + */ + void readConfig(KConfig *m_config); + + /** + * Set the base URL of the current document to update src attrs. + * @param baseURL The base URL of the current Document. + */ + void setBaseURL(KURL baseURL) {m_baseURL = baseURL;} + + /** + * Get the current base URL. + * @return Returns the current base URL. + */ + KURL baseURL() {return m_baseURL;} + + /** + * @return Specifies if we should show icons for scripts. + */ + bool showIconsForScripts() {return m_showIconForScripts;} + + /** + * Set if we should these little icons. + * @param showIcons Should we show these icons? + */ + void showIconsForScripts(bool showIcons) {m_showIconForScripts = showIcons;} + +private: + KURL m_baseURL; + bool m_showIconForScripts; + KafkaDocument *m_wkafkapart; + KStandardDirs *m_stddirs; +}; + +#endif |