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

Kate

katelinelayout.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2002-2005 Hamish Rodda <rodda@kde.org>
00003    Copyright (C) 2003      Anakim Border <aborder@sources.sourceforge.net>
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 _KATE_LINELAYOUT_H_
00021 #define _KATE_LINELAYOUT_H_
00022 
00023 #include "katecursor.h"
00024 #include "katetextline.h"
00025 
00026 class QTextLayout;
00027 class KateDocument;
00028 class KateTextLayout;
00029 
00030 class KateLineLayout : public KShared
00031 {
00032   public:
00033     KateLineLayout(KateDocument* doc = 0L);
00034     ~KateLineLayout();
00035 
00036     KateDocument* doc() const;
00037     void debugOutput() const;
00038 
00039     void clear();
00040     bool isValid() const;
00041     bool isOutsideDocument() const;
00042 
00043     bool includesCursor(const KTextEditor::Cursor& realCursor) const;
00044 
00045     friend bool operator> (const KateLineLayout& r, const KTextEditor::Cursor& c);
00046     friend bool operator>= (const KateLineLayout& r, const KTextEditor::Cursor& c);
00047     friend bool operator< (const KateLineLayout& r, const KTextEditor::Cursor& c);
00048     friend bool operator<= (const KateLineLayout& r, const KTextEditor::Cursor& c);
00049 
00050     const KateTextLine::Ptr& textLine() const;
00051     int length() const;
00052 
00053     int line() const;
00057     void setLine(int line, int virtualLine = -1);
00058     KTextEditor::Cursor start() const;
00059 
00060     int virtualLine() const;
00061     void setVirtualLine(int virtualLine);
00062 
00063     bool isDirty(int viewLine) const;
00064     bool setDirty(int viewLine, bool dirty = true);
00065 
00066     int width() const;
00067     int widthOfLastLine() const;
00068 
00069     int viewLineCount() const;
00070     KateTextLayout viewLine(int viewLine) const;
00071     int viewLineForColumn(int column) const;
00072 
00073     bool startsInvisibleBlock() const;
00074 
00075     // This variable is used as follows:
00076     // non-dynamic-wrapping mode: unused
00077     // dynamic wrapping mode:
00078     //   first viewLine of a line: the X position of the first non-whitespace char
00079     //   subsequent viewLines: the X offset from the left of the display.
00080     //
00081     // this is used to provide a dynamic-wrapping-retains-indent feature.
00082     int shiftX() const;
00083     void setShiftX(int shiftX);
00084 
00085     QTextLayout* layout() const;
00086     void setLayout(QTextLayout* layout);
00087     void invalidateLayout();
00088 
00089     bool isLayoutDirty() const;
00090     void setLayoutDirty(bool dirty = true);
00091 
00092 private:
00093     // Disable copy
00094     KateLineLayout(const KateLineLayout& copy);
00095 
00096     QTextLayout* takeLayout() const;
00097 
00098     KateDocument* m_doc;
00099     mutable KateTextLine::Ptr m_textLine;
00100     int m_line;
00101     int m_virtualLine;
00102     int m_shiftX;
00103 
00104     QTextLayout* m_layout;
00105     QList<bool> m_dirtyList;
00106 
00107     bool m_layoutDirty;
00108 };
00109 
00110 typedef KSharedPtr<KateLineLayout> KateLineLayoutPtr;
00111 
00112 #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
  • 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