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

Kate

katerenderrange.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2003-2005 Hamish Rodda <rodda@kde.org>
00003    Copyright (C) 2008 David Nolden <david.nolden.kdevelop@art-master.de>
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 version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KATERENDERRANGE_H
00021 #define KATERENDERRANGE_H
00022 
00023 #include <ktexteditor/cursor.h>
00024 #include <ktexteditor/attribute.h>
00025 
00026 #include <QtCore/QStack>
00027 #include <QtCore/QList>
00028 #include <QtCore/QPair>
00029 
00030 class KateSmartRange;
00031 class KateView;
00032 class RenderRangeList;
00033 
00034 class KateRenderRange
00035 {
00036   public:
00037     virtual ~KateRenderRange() {}
00038     virtual KTextEditor::Cursor nextBoundary() const = 0;
00039     virtual bool advanceTo(const KTextEditor::Cursor& pos) = 0;
00040     virtual KTextEditor::Attribute::Ptr currentAttribute() const = 0;
00041     virtual bool isReady() const;
00042 };
00043 
00044 class SmartRenderRange : public KateRenderRange
00045 {
00046   public:
00047     SmartRenderRange(KateSmartRange* range, bool useDynamic, KateView* view, RenderRangeList* list);
00048 
00049     virtual KTextEditor::Cursor nextBoundary() const;
00050     virtual bool advanceTo(const KTextEditor::Cursor& pos);
00051     virtual KTextEditor::Attribute::Ptr currentAttribute() const;
00052     virtual bool isReady() const;
00053 
00054   private:
00055     SmartRenderRange(KTextEditor::SmartRange* range, const SmartRenderRange& cloneFrom);
00056     void addTo(KTextEditor::SmartRange* range, bool intermediate = false) const;
00057 
00058     mutable KTextEditor::SmartRange* m_currentRange, *m_endAtRange;
00059     mutable KTextEditor::Cursor m_currentPos;
00060     mutable QStack<KTextEditor::Attribute::Ptr> m_attribs;
00061     const KateView* m_view;
00062     const bool m_useDynamic;
00063     RenderRangeList* m_list;
00064     QSet<KTextEditor::SmartRange*> m_ignoreChildRanges;
00065 };
00066 
00067 typedef QPair<KTextEditor::Range*,KTextEditor::Attribute::Ptr> pairRA;
00068 
00069 class NormalRenderRange : public KateRenderRange
00070 {
00071   public:
00072     NormalRenderRange();
00073     virtual ~NormalRenderRange();
00074 
00075     void addRange(KTextEditor::Range* range, KTextEditor::Attribute::Ptr attribute);
00076 
00077     virtual KTextEditor::Cursor nextBoundary() const;
00078     virtual bool advanceTo(const KTextEditor::Cursor& pos);
00079     virtual KTextEditor::Attribute::Ptr currentAttribute() const;
00080 
00081   private:
00082     mutable QList<pairRA> m_ranges;
00083     mutable KTextEditor::Cursor m_currentPos;
00084     mutable int m_currentRange;
00085 };
00086 
00087 class RenderRangeList : public QList<KateRenderRange*>
00088 {
00089   public:
00090     ~RenderRangeList();
00091     void appendRanges(const QList<KTextEditor::SmartRange*>& startingRanges, bool useDynamic, KateView* view);
00092     KTextEditor::Cursor nextBoundary() const;
00093     void advanceTo(const KTextEditor::Cursor& pos);
00094     bool hasAttribute() const;
00095     KTextEditor::Attribute::Ptr generateAttribute() const;
00096 
00097   private:
00098     KTextEditor::Cursor m_currentPos;
00099 };
00100 
00101 #endif

Kate

Skip menu "Kate"
  • 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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