• 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
  • gotooffset
gotooffsettool.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 GOTOOFFSETTOOL_H
24 #define GOTOOFFSETTOOL_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 GotoOffsetTool : public AbstractTool
45 {
46  Q_OBJECT
47 
48  public:
49  GotoOffsetTool();
50  virtual ~GotoOffsetTool();
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 currentOffset() const;
60  int targetOffset() const;
61  bool isRelative() const;
62  bool isSelectionToExtent() const;
63  bool isBackwards() const;
64 
65  bool isUsable() const;
66  bool isApplyable() const; // candidate for AbstractTool API
67 
68  public Q_SLOTS: // settings
69  void setTargetOffset( Okteta::Address targetOffset );
70  void setIsRelative( bool isRelative );
71  void setIsSelectionToExtent( bool isSelectionToExtent );
72  void setIsBackwards( bool isBackwards );
73 
74  public Q_SLOTS: // actions
75  void gotoOffset();
76 
77  Q_SIGNALS:
78  void isUsableChanged( bool isUsable );
79  void isApplyableChanged( bool isApplyable ); // candidate for AbstractTool API
80  // TODO: isAtLine useful, to prevent noop actions, or should they be allowed, too?
81 
82  private Q_SLOTS:
83  void onContentsChanged();
84 
85  private:
86  int finalTargetOffset() const;
87 
88  private: // settings
89  int mTargetOffset;
90  bool mIsRelative;
91  bool mIsSelectionToExtent;
92  bool mIsBackwards;
93 
94  private: // target
95  ByteArrayView* mByteArrayView;
96  Okteta::AbstractByteArrayModel* mByteArrayModel;
97 };
98 
99 
100 inline int GotoOffsetTool::targetOffset() const { return mTargetOffset; }
101 inline bool GotoOffsetTool::isRelative() const { return mIsRelative; }
102 inline bool GotoOffsetTool::isSelectionToExtent() const { return mIsSelectionToExtent; }
103 inline bool GotoOffsetTool::isBackwards() const { return mIsBackwards; }
104 
105 }
106 
107 #endif
Kasten2::GotoOffsetTool::isApplyable
bool isApplyable() const
Definition: gotooffsettool.cpp:60
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::GotoOffsetTool::isApplyableChanged
void isApplyableChanged(bool isApplyable)
Kasten2::GotoOffsetTool::isSelectionToExtent
bool isSelectionToExtent() const
Definition: gotooffsettool.h:102
Kasten2::GotoOffsetTool::setTargetModel
virtual void setTargetModel(AbstractModel *model)
Definition: gotooffsettool.cpp:70
Kasten2::GotoOffsetTool::gotoOffset
void gotoOffset()
Definition: gotooffsettool.cpp:144
Kasten2::GotoOffsetTool::GotoOffsetTool
GotoOffsetTool()
Definition: gotooffsettool.cpp:37
Kasten2::GotoOffsetTool::targetOffset
int targetOffset() const
Definition: gotooffsettool.h:100
Kasten2::GotoOffsetTool::title
virtual QString title() const
Definition: gotooffsettool.cpp:68
address.h
Kasten2::GotoOffsetTool::currentOffset
int currentOffset() const
Definition: gotooffsettool.cpp:48
Kasten2::GotoOffsetTool::setIsBackwards
void setIsBackwards(bool isBackwards)
Definition: gotooffsettool.cpp:132
Kasten2::GotoOffsetTool
Definition: gotooffsettool.h:44
Kasten2::GotoOffsetTool::isBackwards
bool isBackwards() const
Definition: gotooffsettool.h:103
Kasten2::GotoOffsetTool::setIsSelectionToExtent
void setIsSelectionToExtent(bool isSelectionToExtent)
Definition: gotooffsettool.cpp:121
Kasten2::GotoOffsetTool::setTargetOffset
void setTargetOffset(Okteta::Address targetOffset)
Definition: gotooffsettool.cpp:99
Kasten2::GotoOffsetTool::isUsableChanged
void isUsableChanged(bool isUsable)
Kasten2::AbstractTool
Definition: abstracttool.h:40
Kasten2::AbstractModel
Definition: abstractmodel.h:40
Kasten2::GotoOffsetTool::~GotoOffsetTool
virtual ~GotoOffsetTool()
Definition: gotooffsettool.cpp:175
Kasten2::GotoOffsetTool::setIsRelative
void setIsRelative(bool isRelative)
Definition: gotooffsettool.cpp:110
Kasten2::ByteArrayView
Definition: bytearrayview.h:51
Kasten2::GotoOffsetTool::isRelative
bool isRelative() const
Definition: gotooffsettool.h:101
Kasten2::GotoOffsetTool::isUsable
bool isUsable() const
Definition: gotooffsettool.cpp:55
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:08 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