• 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
  • datatypes
  • array
abstractarraydata.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 2011 Alex Richardson <alex.richardson@gmx.de>
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 
24 #ifndef ABSTRACTARRAYDATA_H
25 #define ABSTRACTARRAYDATA_H
26 
27 #include <address.h>
28 #include "../datainformationbase.h"
29 #include "../primitivedatatype.h"
30 
31 #include <qnamespace.h>
32 #include <QScopedPointer>
33 
34 class QWidget;
35 class QScriptEngine;
36 class QScriptValue;
37 class DataInformation;
38 class ScriptHandlerInfo;
39 
40 namespace Okteta {
41  class AbstractByteArrayModel;
42 }
43 
44 class QVariant;
45 
46 class AbstractArrayData
47 {
48  Q_DISABLE_COPY(AbstractArrayData)
49 public:
50  explicit AbstractArrayData(DataInformation* childType, ArrayDataInformation* parent);
51  virtual ~AbstractArrayData();
52 
53  void setParent(ArrayDataInformation* parent);
55  DataInformation* childType() const;
56 
57  virtual QVariant dataAt(uint index, int column, int role) = 0;
58  virtual unsigned int length() const = 0;
59  virtual void setLength(uint newLength) = 0;
60 
61  virtual QString typeName() const = 0;
62 
63  virtual BitCount32 size() const = 0;
64 
65  virtual DataInformation* childAt(unsigned int idx) = 0;
66 
67  virtual QScriptValue toScriptValue(uint index, QScriptEngine* engine,
68  ScriptHandlerInfo* handlerInfo) = 0;
70  virtual PrimitiveDataType primitiveType() const = 0;
71 
72  virtual int indexOf(const DataInformation* data) const = 0;
73  virtual BitCount64 offset(const DataInformation* child) const = 0;
74  virtual qint64 readData(Okteta::AbstractByteArrayModel* input, Okteta::Address address, BitCount64 bitsRemaining) = 0;
75  virtual bool setChildData(uint row, QVariant value, Okteta::AbstractByteArrayModel* out,
76  Okteta::Address address, BitCount64 bitsRemaining) = 0;
77  virtual BitCount32 sizeAt(uint index) = 0;
78  virtual Qt::ItemFlags childFlags(int row, int column, bool fileLoaded) = 0;
79  virtual bool isComplex() const = 0;
80 
81  virtual QWidget* createChildEditWidget(uint index, QWidget* parent) const = 0;
82  virtual QVariant dataFromChildWidget(uint index, const QWidget* w) const = 0;
83  virtual void setChildWidgetData(uint index, QWidget* w) const = 0;
84 
86  static AbstractArrayData* newArrayData(uint length, DataInformation* type, ArrayDataInformation* parent);
87 protected:
88  virtual void setNewParentForChildren() = 0;
89 protected:
90  ArrayDataInformation* mParent;
91  QScopedPointer<DataInformation> mChildType;
92 };
93 
94 inline DataInformation* AbstractArrayData::childType() const
95 {
96  return mChildType.data();
97 }
98 
99 #endif // ABSTRACTARRAYDATA_H
AbstractArrayData::dataAt
virtual QVariant dataAt(uint index, int column, int role)=0
DataInformation
Interface that must be implemented by all datatypes.
Definition: datainformation.h:67
AbstractArrayData::typeName
virtual QString typeName() const =0
Okteta::Address
qint32 Address
Definition: address.h:34
AbstractArrayData::childAt
virtual DataInformation * childAt(unsigned int idx)=0
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
AbstractArrayData::length
virtual unsigned int length() const =0
AbstractArrayData::size
virtual BitCount32 size() const =0
AbstractArrayData::readData
virtual qint64 readData(Okteta::AbstractByteArrayModel *input, Okteta::Address address, BitCount64 bitsRemaining)=0
AbstractArrayData::childFlags
virtual Qt::ItemFlags childFlags(int row, int column, bool fileLoaded)=0
BitCount64
quint64 BitCount64
Definition: datainformationbase.h:42
QWidget
AbstractArrayData::setChildData
virtual bool setChildData(uint row, QVariant value, Okteta::AbstractByteArrayModel *out, Okteta::Address address, BitCount64 bitsRemaining)=0
AbstractArrayData::setLength
virtual void setLength(uint newLength)=0
AbstractArrayData::setChildWidgetData
virtual void setChildWidgetData(uint index, QWidget *w) const =0
BitCount32
quint32 BitCount32
Definition: datainformationbase.h:37
AbstractArrayData::childType
DataInformation * childType() const
Definition: abstractarraydata.h:94
AbstractArrayData
Definition: abstractarraydata.h:46
ArrayDataInformation
Definition: arraydatainformation.h:36
PrimitiveDataType
Definition: primitivedatatype.h:54
AbstractArrayData::isComplex
virtual bool isComplex() const =0
AbstractArrayData::offset
virtual BitCount64 offset(const DataInformation *child) const =0
AbstractArrayData::setParent
void setParent(ArrayDataInformation *parent)
Definition: abstractarraydata.cpp:41
AbstractArrayData::setNewParentForChildren
virtual void setNewParentForChildren()=0
address.h
AbstractArrayData::AbstractArrayData
AbstractArrayData(DataInformation *childType, ArrayDataInformation *parent)
Definition: abstractarraydata.cpp:30
AbstractArrayData::mChildType
QScopedPointer< DataInformation > mChildType
Definition: abstractarraydata.h:91
AbstractArrayData::newArrayData
static AbstractArrayData * newArrayData(uint length, DataInformation *type, ArrayDataInformation *parent)
Takes ownership over type !
Definition: abstractarraydata.cpp:48
AbstractArrayData::mParent
ArrayDataInformation * mParent
Definition: abstractarraydata.h:90
ScriptHandlerInfo
Definition: scripthandlerinfo.h:39
AbstractArrayData::createChildEditWidget
virtual QWidget * createChildEditWidget(uint index, QWidget *parent) const =0
AbstractArrayData::sizeAt
virtual BitCount32 sizeAt(uint index)=0
AbstractArrayData::toScriptValue
virtual QScriptValue toScriptValue(uint index, QScriptEngine *engine, ScriptHandlerInfo *handlerInfo)=0
AbstractArrayData::indexOf
virtual int indexOf(const DataInformation *data) const =0
AbstractArrayData::primitiveType
virtual PrimitiveDataType primitiveType() const =0
the primitive type or Type_Invalid for structs etc
AbstractArrayData::~AbstractArrayData
virtual ~AbstractArrayData()
Definition: abstractarraydata.cpp:37
AbstractArrayData::dataFromChildWidget
virtual QVariant dataFromChildWidget(uint index, const QWidget *w) const =0
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:06 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