• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KHTML

editor.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2004 Leo Savernik <l.savernik@aon.at>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef __EDITOR_H
00022 #define __EDITOR_H
00023 
00024 #include "editor_command.h"
00025 
00026 #include <khtml_export.h>
00027 
00028 #include <QObject>
00029 
00030 class QKeyEvent;
00031 
00032 class KHTMLPart;
00033 class KHTMLView;
00034 class KHTMLEditorPart;
00035 
00036 namespace khtml {
00037   class EditCommand;
00038   struct EditorContext;
00039 }
00040 
00041 namespace DOM {
00042 
00043 class Range;
00044 class NodeImpl;
00045 class ElementImpl;
00046 class DOMString;
00047 class CSSStyleDeclarationImpl;
00048 class EditorPrivate;
00049 
00059 class KHTML_EXPORT Editor : public QObject {
00060   Q_OBJECT
00061 
00062   Editor(KHTMLPart *);
00063   virtual ~Editor();
00064 public:
00065 
00069   enum TriState { FalseTriState, TrueTriState, MixedTriState };
00070 
00071   // == interface to editor commands
00072 
00079   bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
00081   bool queryCommandEnabled(const DOMString &command);
00083   bool queryCommandIndeterm(const DOMString &command);
00085   bool queryCommandState(const DOMString &command);
00087   bool queryCommandSupported(const DOMString &command);
00089   DOMString queryCommandValue(const DOMString &command);
00090 
00097   bool execCommand(EditorCommand, bool userInterface, const DOMString &value);
00099   bool queryCommandEnabled(EditorCommand);
00101   bool queryCommandIndeterm(EditorCommand);
00103   bool queryCommandState(EditorCommand);
00105   bool queryCommandSupported(EditorCommand);
00107   DOMString queryCommandValue(EditorCommand);
00108 
00109   // == direct interface to some built-in commands
00110 
00112   void copy();
00114   void cut();
00116   void paste();
00118   bool canPaste() const;
00120   void redo();
00122   void undo();
00124   bool canRedo() const;
00126   bool canUndo() const;
00128   void applyStyle(DOM::CSSStyleDeclarationImpl *);
00130   TriState selectionHasStyle(DOM::CSSStyleDeclarationImpl *) const;
00132   bool selectionStartHasStyle(DOM::CSSStyleDeclarationImpl *) const;
00134   DOM::DOMString selectionStartStylePropertyValue(int stylePropertyID) const;
00136   void print();
00138   DOM::CSSStyleDeclarationImpl *selectionComputedStyle(DOM::NodeImpl *&nodeToRemove) const;
00139 
00140 
00141   // == ### more stuff I'm not sure about whether it should be public
00142 
00146   khtml::EditCommand lastEditCommand() const;
00147 
00151   void appliedEditing(khtml::EditCommand &);
00152 
00156   void unappliedEditing(khtml::EditCommand &);
00157 
00161   void reappliedEditing(khtml::EditCommand &);
00162 
00166   DOM::CSSStyleDeclarationImpl *typingStyle() const;
00167 
00171   void setTypingStyle(DOM::CSSStyleDeclarationImpl *);
00172 
00176   void clearTypingStyle();
00177 
00178 private:
00180   bool handleKeyEvent(QKeyEvent *);
00181 
00182 private:
00183   EditorPrivate *const d;
00184 
00185   DOM::CSSStyleDeclarationImpl *m_typingStyle;
00186 
00187   KHTMLPart *m_part;
00188 
00189   friend class ::KHTMLPart;
00190   friend class ::KHTMLView;
00191   friend class ::KHTMLEditorPart;
00192   friend struct khtml::EditorContext;
00193   friend class DOM::ElementImpl;
00194 };
00195 
00196 }/*namespace DOM*/
00197 
00198 #endif // __EDITOR_H

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal