• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • render
katerenderrange.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2003-2005 Hamish Rodda <rodda@kde.org>
4  * Copyright (C) 2008 David Nolden <david.nolden.kdevelop@art-master.de>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef KATERENDERRANGE_H
23 #define KATERENDERRANGE_H
24 
25 #include <ktexteditor/range.h>
26 #include <ktexteditor/attribute.h>
27 
28 #include <QtCore/QStack>
29 #include <QtCore/QList>
30 #include <QtCore/QPair>
31 
32 class KateView;
33 class RenderRangeList;
34 
35 class KateRenderRange
36 {
37  public:
38  virtual ~KateRenderRange() {}
39  virtual KTextEditor::Cursor nextBoundary() const = 0;
40  virtual bool advanceTo(const KTextEditor::Cursor& pos) = 0;
41  virtual KTextEditor::Attribute::Ptr currentAttribute() const = 0;
42  virtual bool isReady() const;
43 };
44 
45 typedef QPair<KTextEditor::Range*,KTextEditor::Attribute::Ptr> pairRA;
46 
47 class NormalRenderRange : public KateRenderRange
48 {
49  public:
50  NormalRenderRange();
51  virtual ~NormalRenderRange();
52 
53  void addRange(KTextEditor::Range* range, KTextEditor::Attribute::Ptr attribute);
54 
55  virtual KTextEditor::Cursor nextBoundary() const;
56  virtual bool advanceTo(const KTextEditor::Cursor& pos);
57  virtual KTextEditor::Attribute::Ptr currentAttribute() const;
58 
59  private:
60  QList<pairRA> m_ranges;
61  KTextEditor::Cursor m_nextBoundary;
62  KTextEditor::Attribute::Ptr m_currentAttribute;
63  int m_currentRange;
64 };
65 
66 class RenderRangeList : public QList<KateRenderRange*>
67 {
68  public:
69  ~RenderRangeList();
70  KTextEditor::Cursor nextBoundary() const;
71  void advanceTo(const KTextEditor::Cursor& pos);
72  bool hasAttribute() const;
73  KTextEditor::Attribute::Ptr generateAttribute() const;
74 
75  private:
76  KTextEditor::Cursor m_currentPos;
77 };
78 
79 #endif
NormalRenderRange::addRange
void addRange(KTextEditor::Range *range, KTextEditor::Attribute::Ptr attribute)
Definition: katerenderrange.cpp:96
NormalRenderRange::NormalRenderRange
NormalRenderRange()
Definition: katerenderrange.cpp:84
KateRenderRange::isReady
virtual bool isReady() const
Definition: katerenderrange.cpp:80
RenderRangeList::advanceTo
void advanceTo(const KTextEditor::Cursor &pos)
Definition: katerenderrange.cpp:165
NormalRenderRange::currentAttribute
virtual KTextEditor::Attribute::Ptr currentAttribute() const
Definition: katerenderrange.cpp:138
NormalRenderRange::nextBoundary
virtual KTextEditor::Cursor nextBoundary() const
Definition: katerenderrange.cpp:101
RenderRangeList
Definition: katerenderrange.h:66
KateRenderRange::currentAttribute
virtual KTextEditor::Attribute::Ptr currentAttribute() const =0
RenderRangeList::~RenderRangeList
~RenderRangeList()
Definition: katerenderrange.cpp:161
NormalRenderRange::advanceTo
virtual bool advanceTo(const KTextEditor::Cursor &pos)
Definition: katerenderrange.cpp:106
NormalRenderRange
Definition: katerenderrange.h:47
NormalRenderRange::~NormalRenderRange
virtual ~NormalRenderRange()
Definition: katerenderrange.cpp:89
QList
QPair
KateView
Definition: kateview.h:77
KateRenderRange::~KateRenderRange
virtual ~KateRenderRange()
Definition: katerenderrange.h:38
RenderRangeList::hasAttribute
bool hasAttribute() const
Definition: katerenderrange.cpp:180
pairRA
QPair< KTextEditor::Range *, KTextEditor::Attribute::Ptr > pairRA
Definition: katerenderrange.h:45
RenderRangeList::generateAttribute
KTextEditor::Attribute::Ptr generateAttribute() const
Definition: katerenderrange.cpp:189
RenderRangeList::nextBoundary
KTextEditor::Cursor nextBoundary() const
Definition: katerenderrange.cpp:143
KateRenderRange::advanceTo
virtual bool advanceTo(const KTextEditor::Cursor &pos)=0
KateRenderRange
Definition: katerenderrange.h:35
KateRenderRange::nextBoundary
virtual KTextEditor::Cursor nextBoundary() const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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