• 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
bytearraytableranges.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_BYTEARRAYTABLERANGES_H
24 #define OKTETA_BYTEARRAYTABLERANGES_H
25 
26 // lib
27 #include "selection.h"
28 #include "coordrangelist.h"
29 #include "oktetagui_export.h"
30 // Okteta core
31 #include "addressrange.h"
32 
33 
34 namespace Okteta
35 {
36 class ArrayChangeMetricsList;
37 class ByteArrayTableLayout;
38 
44 // TODO: split info about ranges from info about dirty ranges into a second class
45 class OKTETAGUI_EXPORT ByteArrayTableRanges
46 {
47  public:
48  explicit ByteArrayTableRanges( ByteArrayTableLayout* layout );
49  ~ByteArrayTableRanges();
50 
51  public: // modifcation access
52  void setMarking( const AddressRange& marking );
53  void setSelectionStart( Address startIndex );
54  void setSelectionEnd( Address startIndex );
55  void setSelection( const AddressRange& selection );
57  void setFirstWordSelection( const AddressRange& selection );
59  void ensureWordSelectionForward( bool Forward );
60 
62  AddressRange removeSelection( int id = 0 );
64  void removeFurtherSelections();
65 
67  void addChangedOffsetLines( const LineRange& changesLines );
68 
69  void addChangedRange( const AddressRange& range );
70  void addChangedRange( Address start, Address end );
71  void addChangedRange( const CoordRange& range );
72  void adaptToChanges( const ArrayChangeMetricsList& changeList, Size oldLength );
73  void resetChangedRanges();
74 
75  void setModified( bool M = true );
77  void reset();
78 
79  public: // value access
80  int noOfSelections() const;
81  Address selectionStart() const;
82  Address selectionEnd() const;
83  AddressRange selection() const;
84  AddressRange firstWordSelection() const;
85  Size selectionLength() const;
86  AddressRange marking() const;
87  bool isModified() const;
88  LineRange changedOffsetLines() const;
89 
90  public: // calculated logic access
91  bool hasSelection() const;
92  bool hasMarking() const;
93  bool selectionStarted() const;
94  bool selectionJustStarted() const;
95  bool hasFirstWordSelection() const;
96  bool selectionIncludes( Address index ) const;
97  bool markingIncludes( Address index ) const;
98  // TODO: next three are deprecated
99  bool overlapsSelection( Address FirstIndex, Address LastIndex, Address* SI, Address* EI ) const;
100  bool overlapsMarking( Address FirstIndex, Address LastIndex, Address* SI, Address* EI ) const;
101 // bool overlapsChanges( int FirstIndex, int LastIndex, int *SI, int *EI ) const;
102 // bool overlapsChanges( AddressRange Indizes, AddressRange *ChangedRange ) const;
103  bool overlapsChanges( const CoordRange& range, CoordRange* ChangedRange ) const;
104  const AddressRange* firstOverlappingSelection( const AddressRange& range ) const;
105  const AddressRange* overlappingMarking( const AddressRange& range ) const;
106 
107  protected:
109  bool mModified;
110 
111  AddressRange mMarking;
112  Selection mSelection;
114  AddressRange FirstWordSelection;
115 
117  LineRange mChangedOffsetLines;
118 
119  CoordRangeList ChangedRanges;
120 
121  ByteArrayTableLayout* mLayout;
122 };
123 
124 
125 inline int ByteArrayTableRanges::noOfSelections() const { return 1; }
126 
127 inline Address ByteArrayTableRanges::selectionStart() const { return mSelection.start(); }
128 inline Address ByteArrayTableRanges::selectionEnd() const { return mSelection.end(); }
129 inline AddressRange ByteArrayTableRanges::selection() const { return mSelection.range(); }
130 inline AddressRange ByteArrayTableRanges::firstWordSelection() const { return FirstWordSelection; }
131 inline Size ByteArrayTableRanges::selectionLength() const { return mSelection.range().width(); }
132 inline AddressRange ByteArrayTableRanges::marking() const { return mMarking; }
133 inline bool ByteArrayTableRanges::isModified() const { return mModified; }
134 inline LineRange ByteArrayTableRanges::changedOffsetLines() const { return mChangedOffsetLines; }
135 
136 inline bool ByteArrayTableRanges::hasSelection() const { return mSelection.isValid(); }
137 inline bool ByteArrayTableRanges::selectionStarted() const { return mSelection.started(); }
138 inline bool ByteArrayTableRanges::selectionJustStarted() const { return mSelection.justStarted(); }
139 inline bool ByteArrayTableRanges::hasFirstWordSelection() const { return FirstWordSelection.isValid(); }
140 inline bool ByteArrayTableRanges::hasMarking() const { return mMarking.isValid(); }
141 inline bool ByteArrayTableRanges::selectionIncludes( Address index ) const { return mSelection.range().includes( index ); }
142 inline bool ByteArrayTableRanges::markingIncludes( Address index ) const { return mMarking.includes( index ); }
143 
144 inline void ByteArrayTableRanges::setModified( bool M ) { mModified = M; }
145 
146 }
147 
148 #endif
Okteta::CoordRange
describes a range in the buffercoord
Definition: coordrange.h:51
OKTETAGUI_EXPORT
#define OKTETAGUI_EXPORT
Definition: oktetagui_export.h:36
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::ByteArrayTableRanges
a class to control all the ranges like marking and selections holds also all modified ranges and merg...
Definition: bytearraytableranges.h:45
oktetagui_export.h
Okteta::ByteArrayTableRanges::firstWordSelection
AddressRange firstWordSelection() const
Definition: bytearraytableranges.h:130
Okteta::Selection::range
const AddressRange & range() const
Definition: selection.h:181
KDE::NumberRange< Address, Size >
Okteta::ByteArrayTableRanges::setModified
void setModified(bool M=true)
Definition: bytearraytableranges.h:144
Okteta::ByteArrayTableRanges::selectionIncludes
bool selectionIncludes(Address index) const
Definition: bytearraytableranges.h:141
Okteta::ByteArrayTableRanges::FirstWordSelection
AddressRange FirstWordSelection
memories first selected word on wordwise selection
Definition: bytearraytableranges.h:114
Okteta::ByteArrayTableRanges::noOfSelections
int noOfSelections() const
Definition: bytearraytableranges.h:125
Okteta::CoordRangeList
Definition: coordrangelist.h:38
Okteta::Selection::justStarted
bool justStarted() const
Definition: selection.h:192
KDE::NumberRange::width
S width() const
Definition: numberrange.h:141
KPieceTable::ArrayChangeMetricsList
Okteta::ArrayChangeMetricsList ArrayChangeMetricsList
Definition: grouppiecetablechange.h:42
selection.h
Okteta::ByteArrayTableLayout
the logical layout of a byte array table for a view
Definition: bytearraytablelayout.h:61
Okteta::ByteArrayTableRanges::selectionJustStarted
bool selectionJustStarted() const
Definition: bytearraytableranges.h:138
Okteta::ByteArrayTableRanges::marking
AddressRange marking() const
Definition: bytearraytableranges.h:132
addressrange.h
Okteta::ByteArrayTableRanges::hasSelection
bool hasSelection() const
Definition: bytearraytableranges.h:136
coordrangelist.h
Okteta::Selection::end
Address end() const
Definition: selection.h:184
Okteta::ArrayChangeMetricsList
Definition: arraychangemetricslist.h:36
Okteta::ByteArrayTableRanges::mChangedOffsetLines
LineRange mChangedOffsetLines
lines that were added or removed
Definition: bytearraytableranges.h:117
Okteta::Selection
This class describes a selected range of the buffer.
Definition: selection.h:44
Okteta::ByteArrayTableRanges::changedOffsetLines
LineRange changedOffsetLines() const
Definition: bytearraytableranges.h:134
Okteta::ByteArrayTableRanges::markingIncludes
bool markingIncludes(Address index) const
Definition: bytearraytableranges.h:142
Okteta::ByteArrayTableRanges::hasMarking
bool hasMarking() const
Definition: bytearraytableranges.h:140
KDE::Range::includes
bool includes(T Value) const
returns true if Value is covered
Definition: range.h:93
Okteta::ByteArrayTableRanges::selection
AddressRange selection() const
Definition: bytearraytableranges.h:129
Okteta::ByteArrayTableRanges::selectionStart
Address selectionStart() const
Definition: bytearraytableranges.h:127
Okteta::Selection::started
bool started() const
Definition: selection.h:191
Okteta::ByteArrayTableRanges::mModified
bool mModified
true if something changed
Definition: bytearraytableranges.h:109
Okteta::Selection::start
Address start() const
Definition: selection.h:183
Okteta::Selection::isValid
bool isValid() const
Definition: selection.h:190
Okteta::Size
qint32 Size
Definition: size.h:33
Okteta::ByteArrayTableRanges::selectionStarted
bool selectionStarted() const
Definition: bytearraytableranges.h:137
Okteta::ByteArrayTableRanges::mLayout
ByteArrayTableLayout * mLayout
Definition: bytearraytableranges.h:121
Okteta::ByteArrayTableRanges::selectionEnd
Address selectionEnd() const
Definition: bytearraytableranges.h:128
Okteta::ByteArrayTableRanges::mMarking
AddressRange mMarking
Definition: bytearraytableranges.h:111
Okteta::ByteArrayTableRanges::hasFirstWordSelection
bool hasFirstWordSelection() const
Definition: bytearraytableranges.h:139
Okteta::ByteArrayTableRanges::selectionLength
Size selectionLength() const
Definition: bytearraytableranges.h:131
Okteta::ByteArrayTableRanges::mSelection
Selection mSelection
Definition: bytearraytableranges.h:112
KDE::Range::isValid
bool isValid() const
returns true if the range covers at least one index
Definition: range.h:122
Okteta::ByteArrayTableRanges::isModified
bool isModified() const
Definition: bytearraytableranges.h:133
Okteta::ByteArrayTableRanges::ChangedRanges
CoordRangeList ChangedRanges
Definition: bytearraytableranges.h:119
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