• 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
  • controller
kvalueeditor.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 2004,2008 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_KVALUEEDITOR_H
24 #define OKTETA_KVALUEEDITOR_H
25 
26 
27 // lib
28 #include "keditor.h"
29 // Okteta core
30 #include <byte.h>
31 // Qt
32 #include <QtCore/QString>
33 
34 
35 namespace Okteta
36 {
37 class AbstractByteArrayView;
38 
39 
40 class KValueEditor: public KEditor
41 {
42  protected:
43  enum KValueEditAction
44  { EnterValue, IncValue, DecValue, ValueAppend, ValueEdit, LeaveValue, ValueBackspace };
45 
46  public:
47  KValueEditor( ByteArrayTableCursor* cursor, AbstractByteArrayView* view, KController* parent );
48  virtual ~KValueEditor();
49 
50  public: // KController API
51  virtual bool handleKeyPress( QKeyEvent *keyEvent );
52 
53  public:
54  void reset();
55 
56  void adaptToValueCodecChange();
57  void finishEdit();
58  void cancelEdit( bool undoChanges = true );
59 
60  public:
61  bool isInEditMode() const;
62  Byte value() const;
63  QString valueAsString() const;
64 
65  protected:
66  void startEdit( const QString &description );
72  void doValueEditAction( KValueEditAction action, int input = -1 );
73 
74  protected:
76  bool mInEditMode:1;
78  bool mEditModeByInsert:1;
80  Byte mEditValue;
82  Byte mOldValue; // TODO: this or rely on undo?
84  unsigned int mInsertedDigitsCount;
86  QString mValueString;
87 };
88 
89 inline bool KValueEditor::isInEditMode() const { return mInEditMode; }
90 inline void KValueEditor::reset() { mInEditMode = false; }
91 inline Byte KValueEditor::value() const { return mEditValue; }
92 inline QString KValueEditor::valueAsString() const { return mValueString; }
93 
94 }
95 
96 #endif
Okteta::KValueEditor::finishEdit
void finishEdit()
Definition: kvalueeditor.cpp:88
Okteta::KValueEditor
Definition: kvalueeditor.h:40
Okteta::KValueEditor::KValueEditor
KValueEditor(ByteArrayTableCursor *cursor, AbstractByteArrayView *view, KController *parent)
Definition: kvalueeditor.cpp:41
Okteta::KValueEditor::value
Byte value() const
Definition: kvalueeditor.h:91
Okteta::KValueEditor::startEdit
void startEdit(const QString &description)
Definition: kvalueeditor.cpp:54
Okteta::KValueEditor::mValueString
QString mValueString
buffer with the
Definition: kvalueeditor.h:86
Okteta::KValueEditor::handleKeyPress
virtual bool handleKeyPress(QKeyEvent *keyEvent)
Definition: kvalueeditor.cpp:104
Okteta::KValueEditor::~KValueEditor
virtual ~KValueEditor()
Definition: kvalueeditor.cpp:304
Okteta::KValueEditor::ValueAppend
Definition: kvalueeditor.h:44
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
Okteta::AbstractByteArrayView
Definition: abstractbytearrayview.h:55
Okteta::KValueEditor::ValueBackspace
Definition: kvalueeditor.h:44
Okteta::KValueEditor::mInsertedDigitsCount
unsigned int mInsertedDigitsCount
Definition: kvalueeditor.h:84
Okteta::KValueEditor::isInEditMode
bool isInEditMode() const
Definition: kvalueeditor.h:89
Okteta::KValueEditor::DecValue
Definition: kvalueeditor.h:44
Okteta::KValueEditor::mInEditMode
bool mInEditMode
flag whether we are in editing mode
Definition: kvalueeditor.h:76
Okteta::KValueEditor::LeaveValue
Definition: kvalueeditor.h:44
Okteta::KEditor
Definition: keditor.h:36
Okteta::KValueEditor::doValueEditAction
void doValueEditAction(KValueEditAction action, int input=-1)
executes keyboard Action Action.
Definition: kvalueeditor.cpp:203
Okteta::KValueEditor::mEditModeByInsert
bool mEditModeByInsert
flag whether byte edit mode was reached by inserting
Definition: kvalueeditor.h:78
byte.h
keditor.h
Okteta::KValueEditor::mOldValue
Byte mOldValue
stores the old byte value
Definition: kvalueeditor.h:82
Okteta::ByteArrayTableCursor
navigates through the buffer in an abstract way, based on the layout
Definition: bytearraytablecursor.h:60
Okteta::KValueEditor::IncValue
Definition: kvalueeditor.h:44
Okteta::KValueEditor::cancelEdit
void cancelEdit(bool undoChanges=true)
Definition: kvalueeditor.cpp:68
Okteta::KValueEditor::valueAsString
QString valueAsString() const
Definition: kvalueeditor.h:92
Okteta::KValueEditor::EnterValue
Definition: kvalueeditor.h:44
Okteta::KValueEditor::KValueEditAction
KValueEditAction
Definition: kvalueeditor.h:43
Okteta::KValueEditor::mEditValue
Byte mEditValue
Definition: kvalueeditor.h:80
Okteta::KValueEditor::adaptToValueCodecChange
void adaptToValueCodecChange()
Definition: kvalueeditor.cpp:48
Okteta::KValueEditor::reset
void reset()
Definition: kvalueeditor.h:90
Okteta::KValueEditor::ValueEdit
Definition: kvalueeditor.h:44
Okteta::KController
Definition: kcontroller.h:32
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