• 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
  • structures
structtool.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Okteta Kasten Framework, made within the KDE community.
3  *
4  * Copyright 2009, 2010, 2011 Alex Richardson <alex.richardson@gmx.de>
5  * Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) version 3, or any
11  * later version accepted by the membership of KDE e.V. (or its
12  * successor approved by the membership of KDE e.V.), which shall
13  * act as a proxy defined in Section 6 of version 3 of the license.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22  */
23 #ifndef STRUCTTOOL_H_
24 #define STRUCTTOOL_H_
25 
26 // lib
27 #include "oktetakastencontrollers_export.h"
28 // tool
29 #include "datatypes/topleveldatainformation.h"
30 // Kasten core
31 #include <abstracttool.h>
32 // Okteta core
33 #include <address.h>
34 //Qt
35 class QModelIndex;
36 
37 class DataInformation;
38 namespace Okteta
39 {
40 class ArrayChangeMetricsList;
41 class AbstractByteArrayModel;
42 }
43 
44 namespace Kasten2
45 {
46 class StructuresManager;
47 class StructToolPrivate;
48 
49 class OKTETAKASTENCONTROLLERS_EXPORT StructTool : public AbstractTool
50 {
51 Q_OBJECT
52  Q_DISABLE_COPY(StructTool)
53 
54 public:
55  StructTool();
56  virtual ~StructTool();
57 
58  // AbstractTool API
59  // virtual AbstractModel* targetModel() const;
60  virtual QString title() const;
61  virtual void setTargetModel(AbstractModel* model);
62 
63 public:
64  QSysInfo::Endian byteOrder() const;
65  void setByteOrder(QSysInfo::Endian order);
66  KDE_DEPRECATED int columnCount() const;
67  bool setData(const QVariant& value, int role, DataInformation* item, uint row);
68  Okteta::AbstractByteArrayModel* byteArrayModel() const;
69  StructuresManager* manager() const;
70  void lockStructure(const QModelIndex& idx);
71  void unlockStructure(const QModelIndex& idx);
72  bool isStructureLocked(const QModelIndex& idx) const;
74  bool canStructureBeLocked(const QModelIndex& idx) const;
75  bool isFileLoaded() const;
76 
77  //interface for model
78  QVariant headerData(int column, int role);
79  int childCount() const;
80  DataInformation* childAt(int idx) const;
81  TopLevelDataInformation::List allData() const;
82 
83 Q_SIGNALS:
84  void dataChanged(int row, void* data); //actually a DataInformation*
85  void dataCleared();
86  void byteOrderChanged();
87  void cursorIndexChanged();
88  KDE_DEPRECATED void byteArrayModelChanged(bool modelIsValid); //TODO remove this one once BC is broken
89  void byteArrayModelChanged(Okteta::AbstractByteArrayModel* model);
91  void childrenAboutToBeInserted(DataInformation* sender, uint startIndex, uint endIndex);
93  void childrenInserted(const DataInformation* sender, uint startIndex, uint endIndex);
95  void childrenAboutToBeRemoved(DataInformation* sender, uint startIndex, uint endIndex);
97  void childrenRemoved(const DataInformation* sender, uint startIndex, uint endIndex);
98 
99 public Q_SLOTS:
100  void setByteOrder(int order);
101  void mark(const QModelIndex& idx);
102  void unmark(/*const QModelIndex& idx*/);
103  void updateData(const Okteta::ArrayChangeMetricsList& list);
104  void addChildItem(TopLevelDataInformation* child);
105  void setSelectedStructuresInView();
106  void validateAllStructures();
107 
108 protected Q_SLOTS:
109  void onByteOrderChanged();
110  void onCursorPositionChange(Okteta::Address pos);
111  void onContentsChange(const Okteta::ArrayChangeMetricsList&);
112  void onChildItemDataChanged();
113 
114 private:
115  Okteta::Address startAddress(const TopLevelDataInformation* data);
116 
117 protected:
118  QScopedPointer<StructToolPrivate> d;
119 };
120 
121 }
122 #endif /* STRUCTTOOL_H_ */
DataInformation
Interface that must be implemented by all datatypes.
Definition: datainformation.h:67
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::StructTool::d
QScopedPointer< StructToolPrivate > d
Definition: structtool.h:118
QVector< Ptr >
KPieceTable::ArrayChangeMetricsList
Okteta::ArrayChangeMetricsList ArrayChangeMetricsList
Definition: grouppiecetablechange.h:42
TopLevelDataInformation
Definition: topleveldatainformation.h:46
address.h
Okteta::ArrayChangeMetricsList
Definition: arraychangemetricslist.h:36
topleveldatainformation.h
oktetakastencontrollers_export.h
Kasten2::StructuresManager
Definition: structuresmanager.h:38
Kasten2::AbstractTool
Definition: abstracttool.h:40
Kasten2::AbstractModel
Definition: abstractmodel.h:40
OKTETAKASTENCONTROLLERS_EXPORT
#define OKTETAKASTENCONTROLLERS_EXPORT
Definition: oktetakastencontrollers_export.h:36
Kasten2::StructTool
Definition: structtool.h:49
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