QRODS
filelistingentry.h
1 #ifndef FILELISTINGENTRY_H
2 #define FILELISTINGENTRY_H
3 
4 #include <QString>
5 #include <QObject>
6 #include <QVariant>
7 #include "qrods_global.h"
8 
9 class QRODSSHARED_EXPORT FileListingEntry: public QObject
10 {
11  Q_OBJECT
12 public:
13 
14  enum ObjectType { UNKNOWN, DATA_OBJECT, COLLECTION, UNKNOWN_FILE, LOCAL_FILE, LOCAL_DIR, NO_INPUT };
15 
16  enum EntryColumn {
17  PARENT_PATH = 0,
18  PATH_OR_NAME = 1,
19  SPECIAL_OBJECT_PATH = 2,
20  OBJECT_TYPE = 3,
21  CREATED_AT = 4,
22  MODIFIED_AT = 5,
23  DATA_SIZE = 6,
24  OWNER_NAME = 7,
25  OWNER_ZONE = 8,
26  ID = 9,
27  IS_COLLECTION = 10
28  };
29 
30  explicit FileListingEntry(QObject *parent = 0);
31 
32  QVariant getField(FileListingEntry::EntryColumn col);
33 
34  const QString& parentPath() const;
35  const QString& pathOrName() const;
36  const QString& specialObjectPath() const;
37  ObjectType objectType() const;
38  long long int createdAt() const;
39  long long int modifiedAt() const;
40  long long int dataSize() const;
41  const QString& ownerName() const;
42  const QString& ownerZone() const;
43  int id() const;
44  bool isCollection() ;
45  int row() const;
46 
47  int offset();
48  bool hasMorePages();
49 
50  int collectionsOffset();
51  int dataObjectsOffset();
52 
53  bool hasMoreCollections();
54  bool hasMoreDataObjects();
55 
56  void setCollectionsOffset(int);
57  void setDataObjectsOffset(int);
58 
59  void setHasMoreCollections( bool );
60  void setHasMoreDataObjects( bool );
61 
62  const QString getFullPath() const;
63 
64  void setParentPath(QString& );
65  void setPathOrName(QString& );
66  void setSpecialObjectPath(QString& );
67  void setObjectType(ObjectType);
68  void setCreatedAt(long long int );
69  void setModifiedAt(long long int);
70  void setDataSize(long long int);
71  void setOwnerName(QString& );
72  void setOwnerZone(QString& );
73  void setId(int );
74  void setRow( int );
75 
76  void setOffset(int);
77  void setHasMorePages(bool);
78 
79  void deleteChildren();
80 
81  void setParentNode( FileListingEntry * );
82  FileListingEntry* parentNode();
83  QList<FileListingEntry*> * children();
84  void addChild(FileListingEntry*);
85 
86  bool flag();
87  void setFlag(bool);
88 
89 
90 private:
91  QString _parentPath;
92  QString _pathOrName;
93  QString _specialObjectPath;
94  ObjectType _objectType;
95  long long int _createdAt;
96  long long int _modifiedAt;
97  long long int _dataSize;
98  QString _ownerName;
99  QString _ownerZone;
100  int _id;
101  int _row;
102 
103  int _offset = -1;
104  bool _hasmorepages;
105 
106  int _collectionsOffset = -1;
107  int _dataObjectsOffset = -1;
108 
109  bool _hasmorecollections = true;
110  bool _hasmoredataobjects = true;
111 
112  bool _flag = false;
113 
114  FileListingEntry *_parentNode = 0;
115  QList<FileListingEntry*> *_children;
116 };
117 
118 #endif // FILELISTINGENTRY_H
Definition: filelistingentry.h:9