• 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
  • kasten
  • controllers
  • view
  • selectrange
selectrangetool.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 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 SELECTRANGETOOL_H
24 #define SELECTRANGETOOL_H
25 
26 // Okteta core
27 #include <address.h>
28 // Kasten core
29 #include <abstracttool.h>
30 
31 namespace Okteta {
32 class AbstractByteArrayModel;
33 }
34 
35 
36 namespace Kasten2
37 {
38 
39 class ByteArrayView;
40 
41 
44 class SelectRangeTool : public AbstractTool
45 {
46  Q_OBJECT
47 
48  public:
49  SelectRangeTool();
50  virtual ~SelectRangeTool();
51 
52  public: // AbstractTool API
53 // virtual AbstractModel* targetModel() const;
54  virtual QString title() const;
55 
56  virtual void setTargetModel( AbstractModel* model );
57 
58  public: // status
59  int currentSelectionStart() const;
60  int currentSelectionEnd() const;
61  int targetSelectionStart() const;
62  int targetSelectionEnd() const;
63  bool isEndRelative() const;
64  bool isEndBackwards() const;
65 
66  bool isUsable() const;
67  bool isApplyable() const; // candidate for AbstractTool API
68 
69  public Q_SLOTS: // settings
70  void setTargetStart( Okteta::Address start );
71  void setTargetEnd( Okteta::Address end );
72  void setIsEndRelative( bool isEndRelative );
73  void setIsEndBackwards( bool isEndBackwards );
74 
75  public Q_SLOTS: // actions
76  void select();
77 
78  Q_SIGNALS:
79  void isUsableChanged( bool isUsable );
80  void isApplyableChanged( bool isApplyable ); // candidate for AbstractTool API
81  // TODO: isAtLine useful, to prevent noop actions, or should they be allowed, too?
82 
83  private:
84  int finalTargetSelectionStart() const;
85  int finalTargetSelectionEnd() const;
86 
87  private Q_SLOTS:
88  void onContentsChanged();
89 
90  private: // settings
91  int mTargetStart;
92  int mTargetEnd;
93  bool mIsEndRelative :1;
94  bool mIsEndBackwards :1;
95 
96  private: // target
97  ByteArrayView* mByteArrayView;
98  Okteta::AbstractByteArrayModel* mByteArrayModel;
99 };
100 
101 
102 inline int SelectRangeTool::targetSelectionStart() const { return mTargetStart; }
103 inline int SelectRangeTool::targetSelectionEnd() const { return mTargetEnd; }
104 inline bool SelectRangeTool::isEndRelative() const { return mIsEndRelative; }
105 inline bool SelectRangeTool::isEndBackwards() const { return mIsEndBackwards; }
106 
107 }
108 
109 #endif
Kasten2::SelectRangeTool::currentSelectionStart
int currentSelectionStart() const
Definition: selectrangetool.cpp:48
Kasten2::SelectRangeTool
Definition: selectrangetool.h:44
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
Kasten2::SelectRangeTool::setIsEndRelative
void setIsEndRelative(bool isEndRelative)
Definition: selectrangetool.cpp:130
Kasten2::SelectRangeTool::title
virtual QString title() const
Definition: selectrangetool.cpp:77
Kasten2::SelectRangeTool::SelectRangeTool
SelectRangeTool()
Definition: selectrangetool.cpp:37
Kasten2::SelectRangeTool::isEndRelative
bool isEndRelative() const
Definition: selectrangetool.h:104
Kasten2::SelectRangeTool::isApplyable
bool isApplyable() const
Definition: selectrangetool.cpp:66
address.h
Kasten2::SelectRangeTool::isUsableChanged
void isUsableChanged(bool isUsable)
Kasten2::SelectRangeTool::currentSelectionEnd
int currentSelectionEnd() const
Definition: selectrangetool.cpp:54
Kasten2::SelectRangeTool::isUsable
bool isUsable() const
Definition: selectrangetool.cpp:61
Kasten2::SelectRangeTool::setTargetStart
void setTargetStart(Okteta::Address start)
Definition: selectrangetool.cpp:108
Kasten2::SelectRangeTool::~SelectRangeTool
virtual ~SelectRangeTool()
Definition: selectrangetool.cpp:191
Kasten2::SelectRangeTool::targetSelectionStart
int targetSelectionStart() const
Definition: selectrangetool.h:102
Kasten2::SelectRangeTool::targetSelectionEnd
int targetSelectionEnd() const
Definition: selectrangetool.h:103
Kasten2::AbstractTool
Definition: abstracttool.h:40
Kasten2::AbstractModel
Definition: abstractmodel.h:40
Kasten2::SelectRangeTool::setTargetEnd
void setTargetEnd(Okteta::Address end)
Definition: selectrangetool.cpp:119
Kasten2::SelectRangeTool::setTargetModel
virtual void setTargetModel(AbstractModel *model)
Definition: selectrangetool.cpp:79
Kasten2::SelectRangeTool::setIsEndBackwards
void setIsEndBackwards(bool isEndBackwards)
Definition: selectrangetool.cpp:141
Kasten2::SelectRangeTool::select
void select()
Definition: selectrangetool.cpp:153
Kasten2::ByteArrayView
Definition: bytearrayview.h:51
Kasten2::SelectRangeTool::isApplyableChanged
void isApplyableChanged(bool isApplyable)
Kasten2::SelectRangeTool::isEndBackwards
bool isEndBackwards() const
Definition: selectrangetool.h:105
abstracttool.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:09 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