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

KHTML

  • sources
  • kde-4.12
  • kdelibs
  • khtml
  • editing
editor.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2004 Leo Savernik <l.savernik@aon.at>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef __EDITOR_H
22 #define __EDITOR_H
23 
24 #include "editor_command.h"
25 
26 #include <khtml_export.h>
27 
28 #include <QObject>
29 
30 #include "wtf/PassRefPtr.h"
31 
32 class QKeyEvent;
33 
34 class KHTMLPart;
35 class KHTMLView;
36 class KHTMLEditorPart;
37 
38 namespace khtml {
39  class EditCommandImpl;
40  struct EditorContext;
41 }
42 
43 namespace DOM {
44 
45 class Range;
46 class NodeImpl;
47 class ElementImpl;
48 class DOMString;
49 class CSSStyleDeclarationImpl;
50 class EditorPrivate;
51 
61 class KHTML_EXPORT Editor : public QObject {
62  Q_OBJECT
63 
64  Editor(KHTMLPart *);
65  virtual ~Editor();
66 public:
67 
71  enum TriState { FalseTriState, TrueTriState, MixedTriState };
72 
73  // == interface to editor commands
74 
81  bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
83  bool queryCommandEnabled(const DOMString &command);
85  bool queryCommandIndeterm(const DOMString &command);
87  bool queryCommandState(const DOMString &command);
89  bool queryCommandSupported(const DOMString &command);
91  DOMString queryCommandValue(const DOMString &command);
92 
99  bool execCommand(EditorCommand, bool userInterface, const DOMString &value);
101  bool queryCommandEnabled(EditorCommand);
103  bool queryCommandIndeterm(EditorCommand);
105  bool queryCommandState(EditorCommand);
107  bool queryCommandSupported(EditorCommand);
109  DOMString queryCommandValue(EditorCommand);
110 
111  // == direct interface to some built-in commands
112 
114  void copy();
116  void cut();
118  void paste();
120  bool canPaste() const;
122  void redo();
124  void undo();
126  bool canRedo() const;
128  bool canUndo() const;
130  void applyStyle(DOM::CSSStyleDeclarationImpl *);
132  TriState selectionHasStyle(DOM::CSSStyleDeclarationImpl *) const;
134  bool selectionStartHasStyle(DOM::CSSStyleDeclarationImpl *) const;
136  DOM::DOMString selectionStartStylePropertyValue(int stylePropertyID) const;
138  void print();
140  DOM::CSSStyleDeclarationImpl *selectionComputedStyle(DOM::NodeImpl *&nodeToRemove) const;
141 
142 
143  // == ### more stuff I'm not sure about whether it should be public
144 
148  WTF::PassRefPtr<khtml::EditCommandImpl> lastEditCommand() const;
149 
153  void appliedEditing(khtml::EditCommandImpl *);
154 
158  void unappliedEditing(khtml::EditCommandImpl *);
159 
163  void reappliedEditing(khtml::EditCommandImpl *);
164 
168  DOM::CSSStyleDeclarationImpl *typingStyle() const;
169 
173  void setTypingStyle(DOM::CSSStyleDeclarationImpl *);
174 
178  void clearTypingStyle();
179 
180  void closeTyping();
181 
185  void indent();
186  void outdent();
187 
188 private:
190  bool handleKeyEvent(QKeyEvent *);
191 
192 private:
193  EditorPrivate *const d;
194 
195  DOM::CSSStyleDeclarationImpl *m_typingStyle;
196 
197  KHTMLPart *m_part;
198 
199  friend class ::KHTMLPart;
200  friend class ::KHTMLView;
201  friend class ::KHTMLEditorPart;
202  friend struct khtml::EditorContext;
203  friend class DOM::ElementImpl;
204 };
205 
206 }/*namespace DOM*/
207 
208 #endif // __EDITOR_H
khtml::EditorContext
Contextual information about the caret and the built-in editor.
Definition: editing_p.h:38
DOM::Editor::TrueTriState
Definition: editor.h:71
print
KAction * print(const QObject *recvr, const char *slot, QObject *parent)
cut
KAction * cut(const QObject *recvr, const char *slot, QObject *parent)
DOM::EditorCommand
EditorCommand
List of all supported built-in editor commands.
Definition: editor_command.h:29
DOM::Editor
This class resembles the editing API when the associated khtml document is editable (in design mode)...
Definition: editor.h:61
undo
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
copy
KAction * copy(const QObject *recvr, const char *slot, QObject *parent)
d
#define d
Definition: khtmlfind.cpp:42
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:206
KHTMLView
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:92
QObject
indent
QString indent(QString text, int spaces)
paste
KAction * paste(const QObject *recvr, const char *slot, QObject *parent)
DOM::Editor::TriState
TriState
Tri-state boolean.
Definition: editor.h:71
khtml::EditCommandImpl
Definition: htmlediting_impl.h:91
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
redo
KAction * redo(const QObject *recvr, const char *slot, QObject *parent)
DOM::selectionStartHasStyle
static bool selectionStartHasStyle(KHTMLPart *part, int propertyID, const char *desiredValue)
Definition: jsediting.cpp:162
khtml_export.h
editor_command.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal