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

KHTML

edit_command.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 EDIT_COMMAND_H
00022 #define EDIT_COMMAND_H
00023 
00024 #include "misc/shared.h"
00025 
00026 namespace DOM {
00027     class DocumentImpl;
00028     class Selection;
00029 }
00030 
00031 namespace khtml {
00032 
00033 //------------------------------------------------------------------------------------------
00034 // Constants
00035 
00040 enum ECommandID { 
00041     EditCommandID, // leave the base class first, others in alpha order
00042     AppendNodeCommandID,
00043     ApplyStyleCommandID,
00044     CompositeEditCommandID,
00045     DeleteCollapsibleWhitespaceCommandID,
00046     DeleteSelectionCommandID,
00047     DeleteTextCommandID,
00048     InputNewlineCommandID,
00049     InputTextCommandID,
00050     InsertNodeBeforeCommandID,
00051     InsertTextCommandID,
00052     JoinTextNodesCommandID,
00053     MoveSelectionCommandID,
00054     ReplaceSelectionCommandID,
00055     RemoveCSSPropertyCommandID,
00056     RemoveNodeAttributeCommandID,
00057     RemoveNodeCommandID,
00058     RemoveNodeAndPruneCommandID,
00059     RemoveNodePreservingChildrenCommandID,
00060     SetNodeAttributeCommandID,
00061     SplitTextNodeCommandID,
00062     TypingCommandID
00063 };
00064 
00065 //------------------------------------------------------------------------------------------
00066 // SharedCommandImpl
00067 
00068 class EditCommand;
00069 class EditCommandImpl;
00070 
00071 class SharedCommandImpl : public Shared<SharedCommandImpl>
00072 {
00073 public:
00074     SharedCommandImpl() {}
00075     virtual ~SharedCommandImpl() {}
00076 
00077     virtual int commandID() const = 0;
00078     virtual bool isCompositeStep() const = 0;
00079 
00080     virtual void apply() = 0;
00081     virtual void unapply() = 0;
00082     virtual void reapply() = 0;
00083 
00084     virtual DOM::DocumentImpl * const document() const = 0;
00085 
00086     virtual DOM::Selection startingSelection() const = 0;
00087     virtual DOM::Selection endingSelection() const = 0;
00088 
00089     virtual void setStartingSelection(const DOM::Selection &s) = 0;
00090     virtual void setEndingSelection(const DOM::Selection &s) = 0;
00091 
00092     virtual EditCommandImpl* parent() const = 0;
00093     virtual void setParent(EditCommandImpl *) = 0;
00094 };
00095 
00096 //------------------------------------------------------------------------------------------
00097 // EditCommand
00098 
00099 class EditCommand : public SharedPtr<SharedCommandImpl>
00100 {
00101 public:
00102     EditCommand();
00103     EditCommand(EditCommandImpl *);
00104     EditCommand(const EditCommand &);
00105     ~EditCommand();
00106 
00107     int commandID() const;
00108     bool isCompositeStep() const;
00109     bool isNull() const;
00110     bool notNull() const;
00111 
00112     void apply();
00113     void unapply();
00114     void reapply();
00115 
00116     DOM::DocumentImpl * const document() const;
00117 
00118     DOM::Selection startingSelection() const;
00119     DOM::Selection endingSelection() const;
00120 
00121     void setStartingSelection(const DOM::Selection &s);
00122     void setEndingSelection(const DOM::Selection &s);
00123 
00124     EditCommand parent() const;
00125 
00126     EditCommandImpl *handle() const;
00127     
00128     static EditCommand &emptyCommand();
00129 };
00130 
00131 }/*namespace khtml*/
00132 
00133 
00134 #endif

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