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

KTextEditor

smartinterface.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Hamish Rodda <rodda@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef KDELIBS_KTEXTEDITOR_SMARTINTERFACE_H
00020 #define KDELIBS_KTEXTEDITOR_SMARTINTERFACE_H
00021 
00022 #include <ktexteditor/ktexteditor_export.h>
00023 #include <ktexteditor/smartrange.h>
00024 
00025 class QMutex;
00026 
00027 namespace KTextEditor
00028 {
00029 class Document;
00030 class View;
00031 class SmartCursor;
00032 
00114 class KTEXTEDITOR_EXPORT SmartInterface
00115 {
00116   friend class Attribute;
00117 
00118   public:
00119     SmartInterface();
00120     virtual ~SmartInterface();
00121 
00128     QMutex* smartMutex() const;
00129 
00139     virtual void clearSmartInterface() = 0;
00140 
00146     bool clearOnDocumentReload() const;
00147 
00153     void setClearOnDocumentReload(bool clearOnReload);
00154 
00155     //BEGIN New cursor methods
00162     virtual int currentRevision() const = 0;
00163 
00168     virtual void releaseRevision(int revision) const = 0;
00169 
00177     virtual void useRevision(int revision) = 0;
00178 
00182     void clearRevision();
00183 
00190     virtual KTextEditor::Cursor translateFromRevision(const KTextEditor::Cursor& cursor, KTextEditor::SmartCursor::InsertBehavior insertBehavior = KTextEditor::SmartCursor::StayOnInsert) const;
00191 
00198     virtual KTextEditor::Range translateFromRevision(const KTextEditor::Range& range, KTextEditor::SmartRange::InsertBehaviors insertBehavior = KTextEditor::SmartRange::ExpandLeft | KTextEditor::SmartRange::ExpandRight) const;
00199 
00217     virtual SmartCursor* newSmartCursor(const Cursor& position = Cursor::start(), SmartCursor::InsertBehavior insertBehavior = SmartCursor::MoveOnInsert) = 0;
00218 
00232     SmartCursor* newSmartCursor(int line, int column, SmartCursor::InsertBehavior insertBehavior = SmartCursor::MoveOnInsert);
00233 
00238     virtual void deleteCursors() = 0;
00239     //END
00240 
00241     //BEGIN New range methods
00256     virtual SmartRange* newSmartRange(const Range& range = Range(),
00257                                       SmartRange* parent = 0L,
00258                                       SmartRange::InsertBehaviors insertBehavior = SmartRange::DoNotExpand) = 0;
00259 
00269     SmartRange* newSmartRange(const Cursor& startPosition,
00270                                      const Cursor& endPosition,
00271                                      SmartRange* parent = 0L,
00272                                      SmartRange::InsertBehaviors insertBehavior = SmartRange::DoNotExpand);
00273 
00285     SmartRange* newSmartRange(int startLine, int startColumn, int endLine, int endColumn, SmartRange* parent = 0L, SmartRange::InsertBehaviors insertBehavior = SmartRange::DoNotExpand);
00286 
00295     virtual SmartRange* newSmartRange(SmartCursor* start, SmartCursor* end, SmartRange* parent = 0L, SmartRange::InsertBehaviors insertBehavior = SmartRange::DoNotExpand) = 0;
00296 
00310     virtual void unbindSmartRange(SmartRange* range) = 0;
00311 
00318     virtual void deleteRanges() = 0;
00319     //END
00320 
00321     //BEGIN Syntax highlighting extension
00338     virtual void addHighlightToDocument(SmartRange* topRange, bool supportDynamic = false) = 0;
00339 
00346     virtual void removeHighlightFromDocument(SmartRange* topRange) = 0;
00347 
00353     virtual const QList<SmartRange*> documentHighlights() const = 0;
00354 
00358     virtual void clearDocumentHighlights() = 0;
00359 
00368     virtual void addHighlightToView(View* view, SmartRange* topRange, bool supportDynamic = false) = 0;
00369 
00381     virtual void removeHighlightFromView(View* view, SmartRange* topRange) = 0;
00382 
00394     virtual const QList<SmartRange*> viewHighlights(View* view) const = 0;
00395 
00401     virtual void clearViewHighlights(View* view) = 0;
00402     //END
00403 
00404     //BEGIN Action binding extension
00419     virtual void addActionsToDocument(SmartRange* topRange) = 0;
00420 
00427     virtual void removeActionsFromDocument(SmartRange* topRange) = 0;
00428 
00433     virtual const QList<SmartRange*> documentActions() const = 0;
00434 
00438     virtual void clearDocumentActions() = 0;
00439 
00447     virtual void addActionsToView(View* view, SmartRange* topRange) = 0;
00448 
00460     virtual void removeActionsFromView(View* view, SmartRange* topRange) = 0;
00461 
00472     virtual const QList<SmartRange*> viewActions(View* view) const = 0;
00473 
00479     virtual void clearViewActions(View* view) = 0;
00481     //END
00482 
00483   protected:
00490     virtual void attributeDynamic(Attribute::Ptr a) = 0;
00497     virtual void attributeNotDynamic(Attribute::Ptr a) = 0;
00498 
00499   private:
00500     class SmartInterfacePrivate* const d;
00501 };
00502 
00503 }
00504 
00505 Q_DECLARE_INTERFACE(KTextEditor::SmartInterface, "org.kde.KTextEditor.SmartInterface")
00506 
00507 #endif
00508 
00509 // kate: space-indent on; indent-width 2; replace-tabs on;

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Modules
  • 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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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