• 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
katetextlayout.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2002-2005 Hamish Rodda <rodda@kde.org>
3  Copyright (C) 2003 Anakim Border <aborder@sources.sourceforge.net>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _KATE_TEXTLAYOUT_H_
21 #define _KATE_TEXTLAYOUT_H_
22 
23 #include <QtGui/QTextLine>
24 
25 #include <ksharedptr.h>
26 
27 #include "katelinelayout.h"
28 
29 
30 class KateLineLayout;
31 typedef KSharedPtr<KateLineLayout> KateLineLayoutPtr;
32 
38 class KateTextLayout
39 {
40  friend class KateLineLayout;
41  friend class KateLayoutCache;
42  template <class T> friend class QVector;
43 
44  public:
45  bool isValid() const;
46  static KateTextLayout invalid();
47 
48  int line() const;
49  int virtualLine() const;
52  int viewLine() const;
53 
54  const QTextLine& lineLayout() const;
55  KateLineLayoutPtr kateLineLayout() const;
56 
57  int startCol() const;
58  KTextEditor::Cursor start() const;
59 
66  int endCol(bool indicateEOL = false) const;
67 
74  KTextEditor::Cursor end(bool indicateEOL = false) const;
75 
76  int length() const;
77  bool isEmpty() const;
78 
79  bool wrap() const;
80 
81  bool isDirty() const;
82  bool setDirty(bool dirty = true);
83 
84  int startX() const;
85  int endX() const;
86  int width() const;
87 
88  int xOffset() const;
89 
90  bool isRightToLeft() const;
91 
92  bool includesCursor(const KTextEditor::Cursor& realCursor) const;
93 
94  friend bool operator> (const KateLineLayout& r, const KTextEditor::Cursor& c);
95  friend bool operator>= (const KateLineLayout& r, const KTextEditor::Cursor& c);
96  friend bool operator< (const KateLineLayout& r, const KTextEditor::Cursor& c);
97  friend bool operator<= (const KateLineLayout& r, const KTextEditor::Cursor& c);
98 
99  void debugOutput() const;
100 
101  private:
102  explicit KateTextLayout(KateLineLayoutPtr line = KateLineLayoutPtr(), int viewLine = 0);
103 
104  KateLineLayoutPtr m_lineLayout;
105  QTextLine m_textLayout;
106 
107  int m_viewLine;
108  mutable int m_startX;
109  bool m_invalidDirty;
110 };
111 
112 #endif
KateTextLayout::startCol
int startCol() const
Definition: katetextlayout.cpp:127
KateTextLayout::line
int line() const
Definition: katetextlayout.cpp:93
KateTextLayout::isEmpty
bool isEmpty() const
Definition: katetextlayout.cpp:165
KateTextLayout::isValid
bool isValid() const
Definition: katetextlayout.cpp:88
KateTextLayout::debugOutput
void debugOutput() const
Definition: katetextlayout.cpp:63
KateTextLayout::start
KTextEditor::Cursor start() const
Definition: katetextlayout.cpp:135
KateTextLayout::startX
int startX() const
Definition: katetextlayout.cpp:181
KateTextLayout::setDirty
bool setDirty(bool dirty=true)
Definition: katetextlayout.cpp:42
KateTextLayout::length
int length() const
Definition: katetextlayout.cpp:157
KateLineLayout
Definition: katelinelayout.h:34
KateTextLayout::endCol
int endCol(bool indicateEOL=false) const
Return the end column of this text line.
Definition: katetextlayout.cpp:140
KateTextLayout::operator<=
friend bool operator<=(const KateLineLayout &r, const KTextEditor::Cursor &c)
KateTextLayout::xOffset
int xOffset() const
Definition: katetextlayout.cpp:55
KateTextLayout::isRightToLeft
bool isRightToLeft() const
Definition: katetextlayout.cpp:215
KateTextLayout::viewLine
int viewLine() const
Return the index of this visual line inside the document line (KateLineLayout).
Definition: katetextlayout.cpp:109
KateLineLayoutPtr
KSharedPtr< KateLineLayout > KateLineLayoutPtr
Definition: katetextlayout.h:30
KateTextLayout::kateLineLayout
KateLineLayoutPtr kateLineLayout() const
Definition: katetextlayout.cpp:122
KateLayoutCache
This class handles Kate's caching of layouting information (in KateLineLayout and KateTextLayout)...
Definition: katelayoutcache.h:77
KateTextLayout::operator<
friend bool operator<(const KateLineLayout &r, const KTextEditor::Cursor &c)
KateTextLayout::includesCursor
bool includesCursor(const KTextEditor::Cursor &realCursor) const
Definition: katetextlayout.cpp:50
KateTextLayout
This class represents one visible line of text; with dynamic wrapping, many KateTextLayouts can be ne...
Definition: katetextlayout.h:38
katelinelayout.h
QVector
QTextLine
KateTextLayout::width
int width() const
Definition: katetextlayout.cpp:202
KateTextLayout::virtualLine
int virtualLine() const
Definition: katetextlayout.cpp:101
KateTextLayout::isDirty
bool isDirty() const
Definition: katetextlayout.cpp:34
KateTextLayout::end
KTextEditor::Cursor end(bool indicateEOL=false) const
Return the end position of this text line.
Definition: katetextlayout.cpp:152
KateTextLayout::endX
int endX() const
Definition: katetextlayout.cpp:194
KateTextLayout::lineLayout
const QTextLine & lineLayout() const
Definition: katetextlayout.cpp:117
KateTextLayout::operator>=
friend bool operator>=(const KateLineLayout &r, const KTextEditor::Cursor &c)
KateTextLayout::invalid
static KateTextLayout invalid()
Definition: katetextlayout.cpp:210
KateLineLayoutPtr
KSharedPtr< KateLineLayout > KateLineLayoutPtr
Definition: katelinelayout.h:120
KateTextLayout::operator>
friend bool operator>(const KateLineLayout &r, const KTextEditor::Cursor &c)
KateTextLayout::wrap
bool wrap() const
Definition: katetextlayout.cpp:173
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