You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
169 lines
2.0 KiB
C++
169 lines
2.0 KiB
C++
/*!
|
|
\file cobject.h
|
|
|
|
*/
|
|
|
|
#ifndef COBJECT_H
|
|
#define COBJECT_H
|
|
|
|
|
|
#include "ctextdocument.h"
|
|
#include "cimage.h"
|
|
|
|
#include <QMetaType>
|
|
#include <QList>
|
|
#include <QString>
|
|
#include <QObject>
|
|
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\class cObject cobject.h "cobject.h"
|
|
*/
|
|
class cObject : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/*!
|
|
\brief
|
|
|
|
\fn cObject
|
|
\param iID
|
|
\param parent
|
|
*/
|
|
explicit cObject(qint32 iID = -1, QObject *parent = nullptr);
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn setID
|
|
\param iID
|
|
*/
|
|
void setID(const qint32& iID);
|
|
/*!
|
|
\brief
|
|
|
|
\fn id
|
|
\return qint32
|
|
*/
|
|
qint32 id();
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn setName
|
|
\param szName
|
|
*/
|
|
void setName(const QString& szName);
|
|
/*!
|
|
\brief
|
|
|
|
\fn name
|
|
\return QString
|
|
*/
|
|
QString name();
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn setType
|
|
\param szType
|
|
*/
|
|
void setType(const QString& szType);
|
|
/*!
|
|
\brief
|
|
|
|
\fn type
|
|
\return QString
|
|
*/
|
|
QString type();
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn setDescription
|
|
\param lpDescription
|
|
*/
|
|
void setDescription(cTextDocument* lpDescription);
|
|
/*!
|
|
\brief
|
|
|
|
\fn description
|
|
\return cTextDocument
|
|
*/
|
|
cTextDocument* description();
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn addImage
|
|
\param lpImage
|
|
*/
|
|
void addImage(cImage* lpImage);
|
|
/*!
|
|
\brief
|
|
|
|
\fn images
|
|
\return QList<cImage *>
|
|
*/
|
|
QList<cImage*> images();
|
|
|
|
private:
|
|
qint32 m_iID; /*!< TODO: describe */
|
|
QString m_szName; /*!< TODO: describe */
|
|
QString m_szType; /*!< TODO: describe */
|
|
cTextDocument* m_lpDescription; /*!< TODO: describe */
|
|
QList<cImage*> m_imageList; /*!< TODO: describe */
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(cObject*)
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\class cObjectList cobject.h "cobject.h"
|
|
*/
|
|
class cObjectList : public QList<cObject*>
|
|
{
|
|
public:
|
|
/*!
|
|
\brief
|
|
|
|
\fn load
|
|
\param lpImageList
|
|
\return bool
|
|
*/
|
|
bool load(cImageList* lpImageList);
|
|
/*!
|
|
\brief
|
|
|
|
\fn save
|
|
\return bool
|
|
*/
|
|
bool save();
|
|
|
|
/*!
|
|
\brief
|
|
|
|
\fn add
|
|
\param iID
|
|
\return cObject
|
|
*/
|
|
cObject* add(const qint32& iID);
|
|
/*!
|
|
\brief
|
|
|
|
\fn find
|
|
\param iID
|
|
\return cObject
|
|
*/
|
|
cObject* find(const qint32& iID);
|
|
};
|
|
|
|
#endif // COBJECT_H
|