Add UI for DIDKIT.
This commit is contained in:
37
DIDKit/App/Model/FileItem.h
Normal file
37
DIDKit/App/Model/FileItem.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef FILEITEM_H
|
||||
#define FILEITEM_H
|
||||
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
#include <QSharedPointer>
|
||||
|
||||
class FileItemAction;
|
||||
typedef QSharedPointer<QVariant> FileItemDataPointer;
|
||||
typedef QSharedPointer<FileItemAction> FileItemActionPointer;
|
||||
|
||||
|
||||
class FileItem
|
||||
{
|
||||
public:
|
||||
explicit FileItem(FileItemDataPointer aData, FileItem* aParent = nullptr, FileItemActionPointer aAction = QSharedPointer<FileItemAction>());
|
||||
~FileItem();
|
||||
void setChild(FileItem* aChild);
|
||||
void setChilds(const QList<FileItem*>& aChilds);
|
||||
void removeChild(int aIndex);
|
||||
int childCount();
|
||||
FileItem* getChild(int aIndex);
|
||||
FileItem* getParent();
|
||||
FileItemDataPointer getData();
|
||||
int getIndexRow();
|
||||
void clearChilds();
|
||||
void executeAction();
|
||||
|
||||
private:
|
||||
FileItem* mParent;
|
||||
QList<FileItem*> mChilds;
|
||||
FileItemDataPointer mData;
|
||||
FileItemActionPointer mAction;
|
||||
|
||||
};
|
||||
|
||||
#endif // FILEITEM_H
|
||||
Reference in New Issue
Block a user