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

KHTML

  • 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
32class QKeyEvent;
33
34class KHTMLPart;
35class KHTMLView;
36class KHTMLEditorPart;
37
38namespace khtml {
39 class EditCommandImpl;
40 struct EditorContext;
41}
42
43namespace DOM {
44
45class Range;
46class NodeImpl;
47class ElementImpl;
48class DOMString;
49class CSSStyleDeclarationImpl;
50class EditorPrivate;
51
61class KHTML_EXPORT Editor : public QObject {
62 Q_OBJECT
63
64 Editor(KHTMLPart *);
65 virtual ~Editor();
66public:
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
188private:
190 bool handleKeyEvent(QKeyEvent *);
191
192private:
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
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::Editor
This class resembles the editing API when the associated khtml document is editable (in design mode),...
Definition: editor.h:61
DOM::Editor::TriState
TriState
Tri-state boolean.
Definition: editor.h:71
DOM::Editor::FalseTriState
@ FalseTriState
Definition: editor.h:71
KHTMLPart
This class is khtml's main class.
Definition: khtml_part.h:207
KHTMLView
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:93
QObject
khtml::EditCommandImpl
Definition: htmlediting_impl.h:92
editor_command.h
indent
QString indent(QString text, int spaces)
khtml_export.h
d
#define d
Definition: khtmlfind.cpp:42
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
DOM::EditorCommand
EditorCommand
List of all supported built-in editor commands.
Definition: editor_command.h:29
cut
KAction * cut(const QObject *recvr, const char *slot, QObject *parent)
copy
KAction * copy(const QObject *recvr, const char *slot, QObject *parent)
undo
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
print
KAction * print(const QObject *recvr, const char *slot, QObject *parent)
paste
KAction * paste(const QObject *recvr, const char *slot, QObject *parent)
redo
KAction * redo(const QObject *recvr, const char *slot, QObject *parent)
khtml
khtml::EditorContext
Contextual information about the caret and the built-in editor.
Definition: editing_p.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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