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

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • gui
bytearraytablecursor.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Gui library, made within the KDE community.
3 
4  Copyright 2003,2008-2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef OKTETA_BYTEARRAYTABLECURSOR_H
24 #define OKTETA_BYTEARRAYTABLECURSOR_H
25 
26 // lib
27 #include "coord.h"
28 
29 
30 namespace Okteta
31 {
32 class ArrayChangeMetricsList;
33 class ByteArrayTableLayout;
34 
35 
60 class ByteArrayTableCursor
61 {
62  public:
63  explicit ByteArrayTableCursor( const ByteArrayTableLayout* layout );
64  ~ByteArrayTableCursor();
65 
66  public: // modificator
67  void setAppendPosEnabled( bool appendPosEnabled = true );
68 
69  public: // state value access
71  Address index() const;
73  LinePosition pos() const;
75  Line line() const;
77  Coord coord() const;
79  bool isBehind() const;
84  Address realIndex() const;
88  Address validIndex() const;
89 
90  //bool isValid() const;
94  bool appendPosEnabled() const;
95 
96  public: // index calculation service
98  Address indexAtLineStart() const;
100  Address indexAtLineEnd() const;
101 
102  public: // navigation commands
103  void gotoIndex( Address index );
104  void gotoCoord( const Coord& coord );
105  void gotoCIndex( Address index );
106  void gotoCCoord( const Coord& coord );
110  void gotoRealIndex();
111 
112  void gotoPreviousByte();
113  void gotoNextByte();
114  void gotoPreviousByte( Size indexSteps );
115  void gotoNextByte( Size indexSteps );
116  void gotoUp();
117  void gotoDown();
118  void gotoLineStart();
119  void gotoLineEnd();
120  void gotoStart();
125  void gotoEnd();
126  void gotoPageUp();
127  void gotoPageDown();
128 
130  // TODO: make protected again
131  void stepBehind();
132  void updateCoord();
133  void adaptToChanges( const ArrayChangeMetricsList& changeList, Size oldLength );
134 
135  public: // logical state access
136  bool atStart() const;
137  bool atEnd() const;
139  bool atAppendPos() const;
140  bool atLineStart() const;
141  bool atLineEnd() const;
142 
143 
144  protected:
149  void stepToEnd();
150 
151  private:
153  const ByteArrayTableLayout* mLayout;
154 
156  Address mIndex;
158  Coord mCoord;
159 
163  bool mBehind :1;
164 
166  bool mAppendPosEnabled :1;
167 };
168 
169 
170 inline Address ByteArrayTableCursor::index() const { return mIndex; }
171 inline LinePosition ByteArrayTableCursor::pos() const { return mCoord.pos(); }
172 inline Line ByteArrayTableCursor::line() const { return mCoord.line(); }
173 inline Coord ByteArrayTableCursor::coord() const { return mCoord; }
174 inline bool ByteArrayTableCursor::isBehind() const { return mBehind; }
175 inline Address ByteArrayTableCursor::realIndex() const { return mBehind ? mIndex + 1 : mIndex; }
176 inline bool ByteArrayTableCursor::appendPosEnabled() const { return mAppendPosEnabled; }
177 
178 inline void ByteArrayTableCursor::stepBehind() { mBehind = true; }
179 
180 //inline bool ByteArrayTableCursor::isValid() const { return mIndex != -1; }
181 
182 }
183 
184 #endif
Okteta::ByteArrayTableCursor::gotoRealIndex
void gotoRealIndex()
sets the index to the real index, i.e.
Definition: bytearraytablecursor.cpp:268
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::ByteArrayTableCursor::index
Address index() const
the index that is drawn at the actual coord
Definition: bytearraytablecursor.h:170
Okteta::ByteArrayTableCursor::gotoLineEnd
void gotoLineEnd()
Definition: bytearraytablecursor.cpp:182
coord.h
Okteta::ByteArrayTableCursor::appendPosEnabled
bool appendPosEnabled() const
Default is false.
Definition: bytearraytablecursor.h:176
Okteta::ByteArrayTableCursor::stepToEnd
void stepToEnd()
if newpos allowed steps at a coord behind the last existing or, if that is at a line end...
Definition: bytearraytablecursor.cpp:247
Okteta::Coord
a class which represents a coord in a 2-dim.
Definition: coord.h:47
Okteta::ByteArrayTableCursor::updateCoord
void updateCoord()
Definition: bytearraytablecursor.cpp:288
Okteta::ByteArrayTableCursor::gotoPreviousByte
void gotoPreviousByte()
Definition: bytearraytablecursor.cpp:70
Okteta::Line
qint32 Line
Definition: line.h:33
KPieceTable::ArrayChangeMetricsList
Okteta::ArrayChangeMetricsList ArrayChangeMetricsList
Definition: grouppiecetablechange.h:42
Okteta::ByteArrayTableLayout
the logical layout of a byte array table for a view
Definition: bytearraytablelayout.h:61
Okteta::ByteArrayTableCursor::gotoIndex
void gotoIndex(Address index)
Definition: bytearraytablecursor.cpp:260
Okteta::ByteArrayTableCursor::gotoNextByte
void gotoNextByte()
Definition: bytearraytablecursor.cpp:102
Okteta::ByteArrayTableCursor::gotoPageDown
void gotoPageDown()
Definition: bytearraytablecursor.cpp:315
Okteta::ByteArrayTableCursor::gotoUp
void gotoUp()
Definition: bytearraytablecursor.cpp:133
Okteta::ByteArrayTableCursor::gotoDown
void gotoDown()
Definition: bytearraytablecursor.cpp:159
Okteta::ByteArrayTableCursor::pos
LinePosition pos() const
the pos of the actual coord
Definition: bytearraytablecursor.h:171
Okteta::ByteArrayTableCursor::setAppendPosEnabled
void setAppendPosEnabled(bool appendPosEnabled=true)
Definition: bytearraytablecursor.cpp:43
Okteta::ByteArrayTableCursor::validIndex
Address validIndex() const
returns the true index if it is valid index that is it is inside the data's range.
Definition: bytearraytablecursor.cpp:329
Okteta::ArrayChangeMetricsList
Definition: arraychangemetricslist.h:36
Okteta::ByteArrayTableCursor::atStart
bool atStart() const
Definition: bytearraytablecursor.cpp:338
Okteta::Coord::pos
LinePosition pos() const
Definition: coord.h:213
Okteta::ByteArrayTableCursor
navigates through the buffer in an abstract way, based on the layout
Definition: bytearraytablecursor.h:60
Okteta::ByteArrayTableCursor::indexAtLineEnd
Address indexAtLineEnd() const
returns the index at the end of the cursor's line
Definition: bytearraytablecursor.cpp:335
Okteta::ByteArrayTableCursor::gotoCIndex
void gotoCIndex(Address index)
Definition: bytearraytablecursor.cpp:218
Okteta::LinePosition
qint32 LinePosition
Definition: lineposition.h:33
Okteta::ByteArrayTableCursor::~ByteArrayTableCursor
~ByteArrayTableCursor()
Definition: bytearraytablecursor.cpp:407
Okteta::ByteArrayTableCursor::gotoLineStart
void gotoLineStart()
Definition: bytearraytablecursor.cpp:173
Okteta::ByteArrayTableCursor::coord
Coord coord() const
the actual coord
Definition: bytearraytablecursor.h:173
Okteta::ByteArrayTableCursor::gotoCCoord
void gotoCCoord(const Coord &coord)
Definition: bytearraytablecursor.cpp:231
Okteta::ByteArrayTableCursor::atEnd
bool atEnd() const
Definition: bytearraytablecursor.cpp:339
Okteta::ByteArrayTableCursor::gotoCoord
void gotoCoord(const Coord &coord)
Definition: bytearraytablecursor.cpp:280
Okteta::Coord::line
Line line() const
Definition: coord.h:214
Okteta::ByteArrayTableCursor::realIndex
Address realIndex() const
returns the real index.
Definition: bytearraytablecursor.h:175
Okteta::ByteArrayTableCursor::ByteArrayTableCursor
ByteArrayTableCursor(const ByteArrayTableLayout *layout)
Definition: bytearraytablecursor.cpp:34
Okteta::ByteArrayTableCursor::gotoStart
void gotoStart()
Definition: bytearraytablecursor.cpp:195
Okteta::Size
qint32 Size
Definition: size.h:33
Okteta::ByteArrayTableCursor::indexAtLineStart
Address indexAtLineStart() const
returns the index at the start of the cursor's line
Definition: bytearraytablecursor.cpp:334
Okteta::ByteArrayTableCursor::atLineStart
bool atLineStart() const
Definition: bytearraytablecursor.cpp:343
Okteta::ByteArrayTableCursor::atLineEnd
bool atLineEnd() const
Definition: bytearraytablecursor.cpp:344
Okteta::ByteArrayTableCursor::isBehind
bool isBehind() const
true if the cursor is located to the right of the actual coord but still shown at the coord ...
Definition: bytearraytablecursor.h:174
Okteta::ByteArrayTableCursor::atAppendPos
bool atAppendPos() const
could only be true in InsertMode: Cursor is behind the last byte
Definition: bytearraytablecursor.cpp:340
Okteta::ByteArrayTableCursor::line
Line line() const
the line of the actual coord
Definition: bytearraytablecursor.h:172
Okteta::ByteArrayTableCursor::gotoEnd
void gotoEnd()
sets the index behind the last index.
Definition: bytearraytablecursor.cpp:203
Okteta::ByteArrayTableCursor::adaptToChanges
void adaptToChanges(const ArrayChangeMetricsList &changeList, Size oldLength)
Definition: bytearraytablecursor.cpp:347
Okteta::ByteArrayTableCursor::gotoPageUp
void gotoPageUp()
Definition: bytearraytablecursor.cpp:295
Okteta::ByteArrayTableCursor::stepBehind
void stepBehind()
puts the cursor behind the actual position if it isn't already
Definition: bytearraytablecursor.h:178
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

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

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

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