• 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
  • gui
  • view
bytearrayview.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 2006-2012 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 BYTEARRAYVIEW_H
24 #define BYTEARRAYVIEW_H
25 
26 // lib
27 #include "oktetakastengui_export.h"
28 // lib
29 #include <bytearrayselection.h>
30 // Kasten gui
31 #include <abstractview.h>
32 #include <zoomable.h> // TODO: able instead of interface? or else?
33 #include <dataselectable.h>
34 #include <selecteddatawriteable.h>
35 // Okteta core
36 #include <addressrange.h>
37 
38 namespace Okteta {
39 class ByteArrayJanusView;
40 }
41 class QRect;
42 
43 
44 namespace Kasten2
45 {
46 class ByteArrayViewProfileSynchronizer;
47 class ByteArrayDocument;
48 class KCursorProxy;
49 
50 
51 class OKTETAKASTENGUI_EXPORT ByteArrayView : public AbstractView,
52  public If::Zoomable,
53  public If::DataSelectable,
54  public If::SelectedDataWriteable
55 {
56  Q_OBJECT
57  Q_INTERFACES(
58  Kasten2::If::Zoomable
59  Kasten2::If::DataSelectable
60  Kasten2::If::SelectedDataWriteable
61  )
62 
63  public:
64  enum { ColumnViewId = 0, RowViewId };
65 
66  public:
67  ByteArrayView( ByteArrayDocument* document, ByteArrayViewProfileSynchronizer* synchronizer );
68  ByteArrayView( ByteArrayView* other, ByteArrayViewProfileSynchronizer* synchronizer,
69  Qt::Alignment alignment = 0 );
70 
71  virtual ~ByteArrayView();
72 
73  public:
74 // KCursorObject *cursor() const;
75 
76  public: // AbstractModel API
77  virtual QString title() const;
78  virtual bool isModifiable() const;
79  virtual bool isReadOnly() const;
80  virtual void setReadOnly( bool isReadOnly );
81 
82  public: // AbstractView API
83  virtual void setFocus();
84  virtual QWidget* widget() const;
85  virtual bool hasFocus() const;
86 
87  public: // If::Zoomable API TODO: make all such methods slots?
88  virtual void setZoomLevel( double Level );
89  virtual double zoomLevel() const;
90  Q_SIGNALS:
91  /*virtual*/ void zoomLevelChanged( double Level );
92 
93  public: // If::DataSelectable API
94  virtual void selectAllData( bool selectAll );
95  virtual bool hasSelectedData() const;
96  virtual QMimeData* copySelectedData() const;
97  virtual const AbstractModelSelection* modelSelection() const;
98 // virtual void setSelection();
99  Q_SIGNALS:
100  /*virtual*/ void hasSelectedDataChanged( bool hasSelectedData );
101  /*virtual*/ void selectedDataChanged( const Kasten2::AbstractModelSelection* modelSelection );
102 
103  public: // If::SelectedDataWriteable API
104  virtual void insertData( const QMimeData* data );
105  virtual QMimeData* cutSelectedData();
106  virtual void deleteSelectedData();
107  virtual bool canReadData( const QMimeData* data ) const;
108 
109  public: // cursor API
110  void setCursorPosition( Okteta::Address cursorPosition );
111  void setSelectionCursorPosition( Okteta::Address index );
112  Okteta::Address cursorPosition() const;
113  Q_SIGNALS:
114  void cursorPositionChanged( Okteta::Address cursorPosition );
115 
116  public: // codings
117  void setValueCoding( int valueCoding );
118  void setCharCoding( const QString& charCodingName );
119  QString charCodingName() const;
120  int valueCoding() const;
121  Q_SIGNALS:
122  void charCodecChanged( const QString& charCodingName );
123  void valueCodingChanged( int valueCoding );
124 
125  public:
126  // TODO: see how this can be solved by modelSelection
127  Okteta::AddressRange selection() const;
128  void setSelection( Okteta::Address start, Okteta::Address end );
129  void insert( const QByteArray& byteArray );
130  QRect cursorRect() const;
131 
132  public: // overwrite
133  void setOverwriteMode( bool overwriteMode );
134  bool isOverwriteMode() const;
135  bool isOverwriteOnly() const;
136  Q_SIGNALS:
137  void overwriteModeChanged( bool overwriteMode );
138 
139  public: // elements
140  void toggleOffsetColumn( bool visible );
141  void setOffsetCoding( int offsetCoding );
142  void setVisibleByteArrayCodings( int columns );
143  void setMarking( const Okteta::AddressRange& range, bool ensureVisible = false );
144  bool offsetColumnVisible() const;
145  int offsetCoding() const;
146  int visibleByteArrayCodings() const;
147  Q_SIGNALS:
148  void offsetColumnVisibleChanged( bool visible );
149  void visibleByteArrayCodingsChanged( int columns );
150  void offsetCodingChanged( int offsetCoding );
151 
152  public: // table layout
153  void setLayoutStyle( int layoutStyle );
154  void setNoOfBytesPerLine( int noOfBytesPerLine );
155  Okteta::Address startOffset() const;
156  Okteta::Address firstLineOffset() const;
157  int noOfBytesPerLine() const;
158  int layoutStyle() const;
159  Q_SIGNALS:
160  void layoutStyleChanged( int layoutStyle );
161  void noOfBytesPerLineChanged( int noOfBytesPerLine );
162 
163  public: // layout settings
164  void setShowsNonprinting( bool showsNonprinting = true );
165  void setNoOfGroupedBytes( int noOfGroupedBytes );
166  void setSubstituteChar( QChar substituteChar );
167  void setUndefinedChar( QChar undefinedChar );
168  QChar substituteChar() const;
169  QChar undefinedChar() const;
170  bool showsNonprinting() const;
171 
172  int byteSpacingWidth() const;
173  int noOfGroupedBytes() const;
174  int groupSpacingWidth() const;
175  int binaryGapWidth() const;
176  Q_SIGNALS:
177  void showsNonprintingChanged( bool showsNonprinting );
178  void substituteCharChanged( QChar substituteChar );
179  void undefinedCharChanged( QChar undefinedChar );
180  void noOfGroupedBytesChanged( int noOfGroupedBytes );
181 
182  public:
183  void setViewModus( int viewModus );
184  int viewModus() const;
185  Q_SIGNALS:
186  void viewModusChanged( int viewModus );
187 
188  public:
189  ByteArrayViewProfileSynchronizer* synchronizer() const;
190 
191  private:
192  void init();
193 
194  private Q_SLOTS:
195  void setFontByGlobalSettings();
196 
197  void onSelectionChanged( const Okteta::AddressRange& selection );
198 
199  private:
200  Okteta::ByteArrayJanusView* mWidget;
201  ByteArrayDocument* mDocument;
202  ByteArraySelection mSelection;
203 // KCursorProxy *mCursorProxy;
204 
205  ByteArrayViewProfileSynchronizer* const mByteArrayViewProfileSynchronizer;
206 };
207 
208 }
209 
210 #endif
Kasten2::AbstractView
Definition: abstractview.h:38
Okteta::Address
qint32 Address
Definition: address.h:34
zoomable.h
abstractview.h
QWidget
KDE::NumberRange< Address, Size >
Okteta::ByteArrayJanusView
Definition: bytearrayjanusview.h:41
OKTETAKASTENGUI_EXPORT
#define OKTETAKASTENGUI_EXPORT
Definition: oktetakastengui_export.h:36
selecteddatawriteable.h
addressrange.h
Kasten2::If::Zoomable
Definition: zoomable.h:37
Kasten2::ByteArraySelection
Definition: bytearrayselection.h:37
Kasten2::If::SelectedDataWriteable
Definition: selecteddatawriteable.h:43
Kasten2::AbstractModelSelection
Definition: abstractmodelselection.h:35
bytearrayselection.h
Kasten2::If::DataSelectable
Definition: dataselectable.h:42
Kasten2::ByteArrayViewProfileSynchronizer
Definition: bytearrayviewprofilesynchronizer.h:41
Kasten2::ByteArrayDocument
Definition: bytearraydocument.h:54
dataselectable.h
oktetakastengui_export.h
Kasten2::ByteArrayView
Definition: bytearrayview.h:51
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