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

KHTML

  • khtml
  • editing
htmlediting_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef __htmleditingimpl_h__
27 #define __htmleditingimpl_h__
28 
29 #include "misc/shared.h"
30 
31 #include "xml/dom_position.h"
32 #include "xml/dom_selection.h"
33 #include "dom/dom_string.h"
34 
35 #include "xml/dom_nodeimpl.h"
36 
37 #include <QList>
38 
39 namespace DOM {
40  class CSSProperty;
41  class CSSStyleDeclarationImpl;
42  class DocumentFragmentImpl;
43  class DocumentImpl;
44  class DOMString;
45  class ElementImpl;
46  class HTMLElementImpl;
47  class NodeImpl;
48  class NodeListImpl;
49  class Position;
50  class Range;
51  class Selection;
52  class TextImpl;
53  class TreeWalkerImpl;
54 }
55 
56 using DOM::DocumentImpl;
57 using DOM::NodeImpl;
58 
59 namespace khtml
60 {
61 
62 class EditCommandImpl;
63 
64 class SharedCommandImpl : public Shared<SharedCommandImpl>
65 {
66 public:
67  SharedCommandImpl() {}
68  virtual ~SharedCommandImpl() {}
69 
70  virtual bool isCompositeStep() const = 0;
71 
72  virtual void apply() = 0;
73  virtual void unapply() = 0;
74  virtual void reapply() = 0;
75 
76  virtual DOM::DocumentImpl* document() const = 0;
77 
78  virtual DOM::Selection startingSelection() const = 0;
79  virtual DOM::Selection endingSelection() const = 0;
80 
81  virtual void setStartingSelection(const DOM::Selection &s) = 0;
82  virtual void setEndingSelection(const DOM::Selection &s) = 0;
83 
84  virtual EditCommandImpl* parent() const = 0;
85  virtual void setParent(EditCommandImpl *) = 0;
86 };
87 
88 //------------------------------------------------------------------------------------------
89 // EditCommandImpl
90 
91 class EditCommandImpl : public SharedCommandImpl
92 {
93 public:
94  EditCommandImpl(DOM::DocumentImpl *);
95  virtual ~EditCommandImpl();
96 
97  bool isCompositeStep() const { return parent(); }
98  EditCommandImpl* parent() const;
99  void setParent(EditCommandImpl *);
100 
101  enum ECommandState { NotApplied, Applied };
102 
103  void apply();
104  void unapply();
105  void reapply();
106 
107  virtual void doApply() = 0;
108  virtual void doUnapply() = 0;
109  virtual void doReapply(); // calls doApply()
110 
111  virtual DOM::DocumentImpl* document() const { return m_document.get(); }
112 
113  DOM::Selection startingSelection() const { return m_startingSelection; }
114  DOM::Selection endingSelection() const { return m_endingSelection; }
115 
116  ECommandState state() const { return m_state; }
117  void setState(ECommandState state) { m_state = state; }
118 
119  void setStartingSelection(const DOM::Selection &s);
120  void setEndingSelection(const DOM::Selection &s);
121 
122 public:
123  virtual bool isTypingCommand() const { return false; }
124  virtual bool isInputTextCommand() const { return false; }
125 
126 private:
127  DocPtr<DOM::DocumentImpl> m_document;
128  ECommandState m_state;
129  DOM::Selection m_startingSelection;
130  DOM::Selection m_endingSelection;
131  RefPtr<EditCommandImpl> m_parent;
132 };
133 
134 //------------------------------------------------------------------------------------------
135 // CompositeEditCommandImpl
136 
137 class CompositeEditCommandImpl : public EditCommandImpl
138 {
139 public:
140  CompositeEditCommandImpl(DOM::DocumentImpl *);
141  virtual ~CompositeEditCommandImpl();
142 
143  virtual void doApply() = 0;
144  virtual void doUnapply();
145  virtual void doReapply();
146 
147 protected:
148  //
149  // sugary-sweet convenience functions to help create and apply edit commands in composite commands
150  //
151  void appendNode(DOM::NodeImpl *parent, DOM::NodeImpl *appendChild);
152  void applyCommandToComposite(PassRefPtr<EditCommandImpl>);
153  void deleteCollapsibleWhitespace();
154  void deleteCollapsibleWhitespace(const DOM::Selection &selection);
155  void deleteKeyPressed();
156  void deleteSelection();
157  void deleteSelection(const DOM::Selection &selection);
158  void deleteText(DOM::TextImpl *node, long offset, long count);
159  void inputText(const DOM::DOMString &text);
160  void insertNodeAfter(DOM::NodeImpl *insertChild, DOM::NodeImpl *refChild);
161  void insertNodeAt(DOM::NodeImpl *insertChild, DOM::NodeImpl *refChild, long offset);
162  void insertNodeBefore(DOM::NodeImpl *insertChild, DOM::NodeImpl *refChild);
163  void insertText(DOM::TextImpl *node, long offset, const DOM::DOMString &text);
164  void joinTextNodes(DOM::TextImpl *text1, DOM::TextImpl *text2);
165  void removeCSSProperty(DOM::CSSStyleDeclarationImpl *, int property);
166  void removeNodeAttribute(DOM::ElementImpl *, int attribute);
167  void removeNode(DOM::NodeImpl *removeChild);
168  void removeNodeAndPrune(DOM::NodeImpl *pruneNode, DOM::NodeImpl *stopNode=0);
169  void removeNodePreservingChildren(DOM::NodeImpl *node);
170  void replaceText(DOM::TextImpl *node, long offset, long count, const DOM::DOMString &replacementText);
171  void setNodeAttribute(DOM::ElementImpl *, int attribute, const DOM::DOMString &);
172  void splitTextNode(DOM::TextImpl *text, long offset);
173 
174  DOM::ElementImpl *createTypingStyleElement() const;
175 
176  QList<RefPtr<EditCommandImpl> > m_cmds;
177 };
178 
179 //==========================================================================================
180 // Concrete commands
181 //------------------------------------------------------------------------------------------
182 // AppendNodeCommandImpl
183 
184 class AppendNodeCommandImpl : public EditCommandImpl
185 {
186 public:
187  AppendNodeCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *parentNode, DOM::NodeImpl *appendChild);
188  virtual ~AppendNodeCommandImpl();
189 
190  virtual void doApply();
191  virtual void doUnapply();
192 
193  DOM::NodeImpl *parentNode() const { return m_parentNode; }
194  DOM::NodeImpl *appendChild() const { return m_appendChild; }
195 
196 private:
197  DOM::NodeImpl *m_parentNode;
198  DOM::NodeImpl *m_appendChild;
199 };
200 
201 //------------------------------------------------------------------------------------------
202 // ApplyStyleCommandImpl
203 
204 class ApplyStyleCommandImpl : public CompositeEditCommandImpl
205 {
206 public:
207  ApplyStyleCommandImpl(DOM::DocumentImpl *, DOM::CSSStyleDeclarationImpl *style);
208  virtual ~ApplyStyleCommandImpl();
209 
210  virtual void doApply();
211 
212  DOM::CSSStyleDeclarationImpl *style() const { return m_style; }
213 
214  struct StyleChange {
215  StyleChange() : applyBold(false), applyItalic(false) {}
216  DOM::DOMString cssStyle;
217  bool applyBold:1;
218  bool applyItalic:1;
219  };
220 
221 private:
222  // style-removal helpers
223  bool isHTMLStyleNode(DOM::HTMLElementImpl *);
224  void removeHTMLStyleNode(DOM::HTMLElementImpl *);
225  void removeCSSStyle(DOM::HTMLElementImpl *);
226  void removeStyle(const DOM::Position &start, const DOM::Position &end);
227  bool nodeFullySelected(const DOM::NodeImpl *node) const;
228 
229  // style-application helpers
230  bool currentlyHasStyle(const DOM::Position &, const DOM::CSSProperty *) const;
231  StyleChange computeStyleChange(const DOM::Position &, DOM::CSSStyleDeclarationImpl *);
232  bool splitTextAtStartIfNeeded(const DOM::Position &start, const DOM::Position &end);
233  DOM::NodeImpl *splitTextAtEndIfNeeded(const DOM::Position &start, const DOM::Position &end);
234  void surroundNodeRangeWithElement(DOM::NodeImpl *start, DOM::NodeImpl *end, DOM::ElementImpl *element);
235  DOM::Position positionInsertionPoint(DOM::Position);
236  void applyStyleIfNeeded(DOM::NodeImpl *start, DOM::NodeImpl *end);
237 
238  DOM::CSSStyleDeclarationImpl *m_style;
239 };
240 
241 //------------------------------------------------------------------------------------------
242 // DeleteCollapsibleWhitespaceCommandImpl
243 
244 class DeleteCollapsibleWhitespaceCommandImpl : public CompositeEditCommandImpl
245 {
246 public:
247  DeleteCollapsibleWhitespaceCommandImpl(DOM::DocumentImpl *document);
248  DeleteCollapsibleWhitespaceCommandImpl(DOM::DocumentImpl *document, const DOM::Selection &selection);
249 
250  virtual ~DeleteCollapsibleWhitespaceCommandImpl();
251 
252  virtual void doApply();
253 
254 private:
255  DOM::Position deleteWhitespace(const DOM::Position &pos);
256 
257  unsigned long m_charactersDeleted;
258  DOM::Selection m_selectionToCollapse;
259  bool m_hasSelectionToCollapse;
260 };
261 
262 //------------------------------------------------------------------------------------------
263 // DeleteSelectionCommandImpl
264 
265 class DeleteSelectionCommandImpl : public CompositeEditCommandImpl
266 {
267 public:
268  DeleteSelectionCommandImpl(DOM::DocumentImpl *document);
269  DeleteSelectionCommandImpl(DOM::DocumentImpl *document, const DOM::Selection &selection);
270 
271  virtual ~DeleteSelectionCommandImpl();
272 
273  virtual void doApply();
274 
275 private:
276  void deleteContentBeforeOffset(NodeImpl *node, int offset);
277  void deleteContentAfterOffset(NodeImpl *node, int offset);
278  void deleteContentInsideNode(NodeImpl *node, int startOffset, int endOffset);
279  void deleteDownstreamWS(const DOM::Position &start);
280  bool containsOnlyWhitespace(const DOM::Position &start, const DOM::Position &end);
281  void joinTextNodesWithSameStyle();
282 
283  DOM::Selection m_selectionToDelete;
284  bool m_hasSelectionToDelete;
285 };
286 
287 //------------------------------------------------------------------------------------------
288 // DeleteTextCommandImpl
289 
290 class DeleteTextCommandImpl : public EditCommandImpl
291 {
292 public:
293  DeleteTextCommandImpl(DOM::DocumentImpl *document, DOM::TextImpl *node, long offset, long count);
294  virtual ~DeleteTextCommandImpl();
295 
296  virtual void doApply();
297  virtual void doUnapply();
298 
299  DOM::TextImpl *node() const { return m_node; }
300  long offset() const { return m_offset; }
301  long count() const { return m_count; }
302 
303 private:
304  DOM::TextImpl *m_node;
305  long m_offset;
306  long m_count;
307  DOM::DOMString m_text;
308 };
309 
310 //------------------------------------------------------------------------------------------
311 // InputNewlineCommandImpl
312 
313 class InputNewlineCommandImpl : public CompositeEditCommandImpl
314 {
315 public:
316  InputNewlineCommandImpl(DOM::DocumentImpl *document);
317  virtual ~InputNewlineCommandImpl();
318 
319  virtual void doApply();
320 
321 private:
322  void insertNodeAfterPosition(DOM::NodeImpl *node, const DOM::Position &pos);
323  void insertNodeBeforePosition(DOM::NodeImpl *node, const DOM::Position &pos);
324 };
325 
326 //------------------------------------------------------------------------------------------
327 // InputTextCommandImpl
328 
329 class InputTextCommandImpl : public CompositeEditCommandImpl
330 {
331 public:
332  InputTextCommandImpl(DOM::DocumentImpl *document);
333  virtual ~InputTextCommandImpl();
334 
335  virtual void doApply();
336 
337  void deleteCharacter();
338  void input(const DOM::DOMString &text);
339 
340  unsigned long charactersAdded() const { return m_charactersAdded; }
341 
342  virtual bool isInputTextCommand() const { return true; }
343 private:
344  DOM::Position prepareForTextInsertion(bool adjustDownstream);
345  void execute(const DOM::DOMString &text);
346  void insertSpace(DOM::TextImpl *textNode, unsigned long offset);
347 
348  unsigned long m_charactersAdded;
349 };
350 
351 //------------------------------------------------------------------------------------------
352 // InsertNodeBeforeCommandImpl
353 
354 class InsertNodeBeforeCommandImpl : public EditCommandImpl
355 {
356 public:
357  InsertNodeBeforeCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *insertChild, DOM::NodeImpl *refChild);
358  virtual ~InsertNodeBeforeCommandImpl();
359 
360  virtual void doApply();
361  virtual void doUnapply();
362 
363  DOM::NodeImpl *insertChild() const { return m_insertChild; }
364  DOM::NodeImpl *refChild() const { return m_refChild; }
365 
366 private:
367  DOM::NodeImpl *m_insertChild;
368  DOM::NodeImpl *m_refChild;
369 };
370 
371 //------------------------------------------------------------------------------------------
372 // InsertTextCommandImpl
373 
374 class InsertTextCommandImpl : public EditCommandImpl
375 {
376 public:
377  InsertTextCommandImpl(DOM::DocumentImpl *document, DOM::TextImpl *, long, const DOM::DOMString &);
378  virtual ~InsertTextCommandImpl();
379 
380  virtual void doApply();
381  virtual void doUnapply();
382 
383  DOM::TextImpl *node() const { return m_node; }
384  long offset() const { return m_offset; }
385  DOM::DOMString text() const { return m_text; }
386 
387 private:
388  DOM::TextImpl *m_node;
389  long m_offset;
390  DOM::DOMString m_text;
391 };
392 
393 //------------------------------------------------------------------------------------------
394 // JoinTextNodesCommandImpl
395 
396 class JoinTextNodesCommandImpl : public EditCommandImpl
397 {
398 public:
399  JoinTextNodesCommandImpl(DOM::DocumentImpl *, DOM::TextImpl *, DOM::TextImpl *);
400  virtual ~JoinTextNodesCommandImpl();
401 
402  virtual void doApply();
403  virtual void doUnapply();
404 
405  DOM::TextImpl *firstNode() const { return m_text1; }
406  DOM::TextImpl *secondNode() const { return m_text2; }
407 
408 private:
409  DOM::TextImpl *m_text1;
410  DOM::TextImpl *m_text2;
411  unsigned long m_offset;
412 };
413 
414 //------------------------------------------------------------------------------------------
415 // ReplaceSelectionCommandImpl
416 
417 class ReplaceSelectionCommandImpl : public CompositeEditCommandImpl
418 {
419 public:
420  ReplaceSelectionCommandImpl(DOM::DocumentImpl *document, DOM::DocumentFragmentImpl *fragment, bool selectReplacement=true);
421  virtual ~ReplaceSelectionCommandImpl();
422 
423  virtual void doApply();
424 
425 private:
426  DOM::DocumentFragmentImpl *m_fragment;
427  bool m_selectReplacement;
428 };
429 
430 //------------------------------------------------------------------------------------------
431 // MoveSelectionCommandImpl
432 
433 class MoveSelectionCommandImpl : public CompositeEditCommandImpl
434 {
435 public:
436  MoveSelectionCommandImpl(DOM::DocumentImpl *document, DOM::DocumentFragmentImpl *fragment, DOM::Position &position);
437  virtual ~MoveSelectionCommandImpl();
438 
439  virtual void doApply();
440 
441 private:
442  DOM::DocumentFragmentImpl *m_fragment;
443  DOM::Position m_position;
444 };
445 
446 //------------------------------------------------------------------------------------------
447 // RemoveCSSPropertyCommand
448 
449 class RemoveCSSPropertyCommandImpl : public EditCommandImpl
450 {
451 public:
452  RemoveCSSPropertyCommandImpl(DOM::DocumentImpl *, DOM::CSSStyleDeclarationImpl *, int property);
453  virtual ~RemoveCSSPropertyCommandImpl();
454 
455  virtual void doApply();
456  virtual void doUnapply();
457 
458  DOM::CSSStyleDeclarationImpl *styleDeclaration() const { return m_decl; }
459  int property() const { return m_property; }
460 
461 private:
462  DOM::CSSStyleDeclarationImpl *m_decl;
463  int m_property;
464  DOM::DOMString m_oldValue;
465  bool m_important;
466 };
467 
468 //------------------------------------------------------------------------------------------
469 // RemoveNodeAttributeCommandImpl
470 
471 class RemoveNodeAttributeCommandImpl : public EditCommandImpl
472 {
473 public:
474  RemoveNodeAttributeCommandImpl(DOM::DocumentImpl *, DOM::ElementImpl *, DOM::NodeImpl::Id attribute);
475  virtual ~RemoveNodeAttributeCommandImpl();
476 
477  virtual void doApply();
478  virtual void doUnapply();
479 
480  DOM::ElementImpl *element() const { return m_element; }
481  DOM::NodeImpl::Id attribute() const { return m_attribute; }
482 
483 private:
484  DOM::ElementImpl *m_element;
485  DOM::NodeImpl::Id m_attribute;
486  DOM::DOMString m_oldValue;
487 };
488 
489 //------------------------------------------------------------------------------------------
490 // RemoveNodeCommandImpl
491 
492 class RemoveNodeCommandImpl : public EditCommandImpl
493 {
494 public:
495  RemoveNodeCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *);
496  virtual ~RemoveNodeCommandImpl();
497 
498  virtual void doApply();
499  virtual void doUnapply();
500 
501  DOM::NodeImpl *node() const { return m_removeChild; }
502 
503 private:
504  DOM::NodeImpl *m_parent;
505  DOM::NodeImpl *m_removeChild;
506  DOM::NodeImpl *m_refChild;
507 };
508 
509 //------------------------------------------------------------------------------------------
510 // RemoveNodeAndPruneCommandImpl
511 
512 class RemoveNodeAndPruneCommandImpl : public CompositeEditCommandImpl
513 {
514 public:
515  RemoveNodeAndPruneCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *pruneNode, DOM::NodeImpl *stopNode=0);
516  virtual ~RemoveNodeAndPruneCommandImpl();
517 
518  virtual void doApply();
519 
520  DOM::NodeImpl *pruneNode() const { return m_pruneNode; }
521  DOM::NodeImpl *stopNode() const { return m_stopNode; }
522 
523 private:
524  DOM::NodeImpl *m_pruneNode;
525  DOM::NodeImpl *m_stopNode;
526 };
527 
528 //------------------------------------------------------------------------------------------
529 // RemoveNodePreservingChildrenCommandImpl
530 
531 class RemoveNodePreservingChildrenCommandImpl : public CompositeEditCommandImpl
532 {
533 public:
534  RemoveNodePreservingChildrenCommandImpl(DOM::DocumentImpl *, DOM::NodeImpl *);
535  virtual ~RemoveNodePreservingChildrenCommandImpl();
536 
537  virtual void doApply();
538 
539  DOM::NodeImpl *node() const { return m_node; }
540 
541 private:
542  DOM::NodeImpl *m_node;
543 };
544 
545 //------------------------------------------------------------------------------------------
546 // SetNodeAttributeCommandImpl
547 
548 class SetNodeAttributeCommandImpl : public EditCommandImpl
549 {
550 public:
551  SetNodeAttributeCommandImpl(DOM::DocumentImpl *, DOM::ElementImpl *, DOM::NodeImpl::Id attribute, const DOM::DOMString &value);
552  virtual ~SetNodeAttributeCommandImpl();
553 
554  virtual void doApply();
555  virtual void doUnapply();
556 
557  DOM::ElementImpl *element() const { return m_element; }
558  DOM::NodeImpl::Id attribute() const { return m_attribute; }
559  DOM::DOMString value() const { return m_value; }
560 
561 private:
562  DOM::ElementImpl *m_element;
563  DOM::NodeImpl::Id m_attribute;
564  DOM::DOMString m_value;
565  DOM::DOMString m_oldValue;
566 };
567 
568 //------------------------------------------------------------------------------------------
569 // SplitTextNodeCommandImpl
570 
571 class SplitTextNodeCommandImpl : public EditCommandImpl
572 {
573 public:
574  SplitTextNodeCommandImpl(DOM::DocumentImpl *, DOM::TextImpl *, long);
575  virtual ~SplitTextNodeCommandImpl();
576 
577  virtual void doApply();
578  virtual void doUnapply();
579 
580  DOM::TextImpl *node() const { return m_text2; }
581  long offset() const { return m_offset; }
582 
583 private:
584  DOM::TextImpl *m_text1;
585  DOM::TextImpl *m_text2;
586  unsigned long m_offset;
587 };
588 
589 //------------------------------------------------------------------------------------------
590 // TypingCommandImpl
591 
592 class TypingCommandImpl : public CompositeEditCommandImpl
593 {
594 public:
595  TypingCommandImpl(DOM::DocumentImpl *document);
596  virtual ~TypingCommandImpl();
597 
598  virtual void doApply();
599 
600  bool openForMoreTyping() const { return m_openForMoreTyping; }
601  void closeTyping() { m_openForMoreTyping = false; }
602 
603  void insertText(const DOM::DOMString &text);
604  void insertNewline();
605  void deleteKeyPressed();
606 
607  virtual bool isTypingCommand() const { return true; }
608 
609  static void deleteKeyPressed0(DocumentImpl *document);
610  static void insertNewline0(DocumentImpl *document);
611  static void insertText0(DocumentImpl *document, const DOMString &text);
612 
613 private:
614  void issueCommandForDeleteKey();
615  void removeCommand(const PassRefPtr<EditCommandImpl>);
616  void typingAddedToOpenCommand();
617 
618  bool m_openForMoreTyping;
619 };
620 
621 //------------------------------------------------------------------------------------------
622 // InsertListCommandImpl
623 
624 class InsertListCommandImpl : public CompositeEditCommandImpl
625 {
626 public:
627  enum Type { OrderedList, UnorderedList };
628 
629  InsertListCommandImpl(DOM::DocumentImpl *document, Type type);
630  virtual ~InsertListCommandImpl();
631 
632  virtual void doApply();
633 
634  static void insertList(DocumentImpl *document, Type type);
635 
636 private:
637  Type m_listType;
638 };
639 
640 //------------------------------------------------------------------------------------------
641 
642 //------------------------------------------------------------------------------------------
643 // IndentOutdentCommandImpl
644 
645 class IndentOutdentCommandImpl : public CompositeEditCommandImpl
646 {
647 public:
648  enum Type { Indent, Outdent };
649 
650  IndentOutdentCommandImpl(DocumentImpl *document, Type type);
651  virtual ~IndentOutdentCommandImpl();
652 
653  virtual void doApply();
654 
655 private:
656  void indent();
657  void outdent();
658 
659  Type m_commandType;
660 };
661 
662 //------------------------------------------------------------------------------------------
663 
664 } // end namespace khtml
665 
666 #endif
667 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 20:22:26 by doxygen 1.8.3.1 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.10.4 API Reference

Skip menu "kdelibs-4.10.4 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