• Skip to content
  • Skip to link menu
KDE 4.1 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 DOMString;
00046 class CSSStyleDeclarationImpl;
00047 class EditorPrivate;
00048 
00058 class KHTML_EXPORT Editor : public QObject {
00059   Q_OBJECT
00060 
00061   Editor(KHTMLPart *);
00062   virtual ~Editor();
00063 public:
00064 
00068   enum TriState { FalseTriState, TrueTriState, MixedTriState };
00069 
00070   // == interface to editor commands
00071 
00078   bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
00080   bool queryCommandEnabled(const DOMString &command);
00082   bool queryCommandIndeterm(const DOMString &command);
00084   bool queryCommandState(const DOMString &command);
00086   bool queryCommandSupported(const DOMString &command);
00088   DOMString queryCommandValue(const DOMString &command);
00089 
00096   bool execCommand(EditorCommand, bool userInterface, const DOMString &value);
00098   bool queryCommandEnabled(EditorCommand);
00100   bool queryCommandIndeterm(EditorCommand);
00102   bool queryCommandState(EditorCommand);
00104   bool queryCommandSupported(EditorCommand);
00106   DOMString queryCommandValue(EditorCommand);
00107 
00108   // == direct interface to some built-in commands
00109 
00111   void copy();
00113   void cut();
00115   void paste();
00117   bool canPaste() const;
00119   void redo();
00121   void undo();
00123   bool canRedo() const;
00125   bool canUndo() const;
00127   void applyStyle(DOM::CSSStyleDeclarationImpl *);
00129   TriState selectionHasStyle(DOM::CSSStyleDeclarationImpl *) const;
00131   bool selectionStartHasStyle(DOM::CSSStyleDeclarationImpl *) const;
00133   DOM::DOMString selectionStartStylePropertyValue(int stylePropertyID) const;
00135   void print();
00137   DOM::CSSStyleDeclarationImpl *selectionComputedStyle(DOM::NodeImpl *&nodeToRemove) const;
00138 
00139 
00140   // == ### more stuff I'm not sure about whether it should be public
00141 
00145   khtml::EditCommand lastEditCommand() const;
00146 
00150   void appliedEditing(khtml::EditCommand &);
00151 
00155   void unappliedEditing(khtml::EditCommand &);
00156 
00160   void reappliedEditing(khtml::EditCommand &);
00161 
00165   DOM::CSSStyleDeclarationImpl *typingStyle() const;
00166 
00170   void setTypingStyle(DOM::CSSStyleDeclarationImpl *);
00171 
00175   void clearTypingStyle();
00176 
00177 private:
00179   bool handleKeyEvent(QKeyEvent *);
00180 
00181 private:
00182   EditorPrivate *const d;
00183 
00184   DOM::CSSStyleDeclarationImpl *m_typingStyle;
00185 
00186   KHTMLPart *m_part;
00187 
00188   friend class ::KHTMLPart;
00189   friend class ::KHTMLView;
00190   friend class ::KHTMLEditorPart;
00191   friend struct khtml::EditorContext;
00192 };
00193 
00194 }/*namespace DOM*/
00195 
00196 #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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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