digiKam
coredbalbuminfo.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-04-21
7  * Description : Structures to define Albums used in CoreDb
8  *
9  * Copyright (C) 2007-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2005 by Renchi Raju <renchi dot raju at gmail dot com>
11  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_CORE_DB_ALBUM_INFO_H
27 #define DIGIKAM_CORE_DB_ALBUM_INFO_H
28 
29 // Qt includes
30 
31 #include <QString>
32 #include <QList>
33 #include <QDateTime>
34 
35 // Local includes
36 
37 #include "coredbconstants.h"
38 
39 namespace Digikam
40 {
41 
42 typedef QPair<int, int> YearMonth;
43 
48 {
49 public:
50 
51  explicit AlbumRootInfo()
52  : id (0),
53  type (AlbumRoot::UndefinedType),
54  status(0)
55  {
56  };
57 
58 public:
59 
60  int id;
61  QString label;
63  int status;
64  QString identifier;
65  QString specificPath;
66 };
67 
68 // --------------------------------------------------------------------------
69 
75 class AlbumInfo
76 {
77 public:
78 
80 
81 public:
82 
83  explicit AlbumInfo()
84  : id (0),
85  albumRootId(0),
86  iconId (0)
87  {
88  };
89 
90  bool isNull() const
91  {
92  return (id == 0);
93  }
94 
98  bool operator<(const AlbumInfo& info) const
99  {
100  // include album root id?
101 
102  return (relativePath < info.relativePath);
103  }
104 
105 public:
106 
107  int id;
109  QString relativePath;
110  QString caption;
111  QString category;
112  QDate date;
113  qlonglong iconId;
114 };
115 
116 // --------------------------------------------------------------------------
117 
123 class TagInfo
124 {
125 public:
126 
128 
129 public:
130 
131  explicit TagInfo()
132  : id (0),
133  pid (0),
134  iconId(0)
135  {
136  };
137 
138  bool isNull() const
139  {
140  return (id == 0);
141  }
142 
143  bool operator<(const TagInfo& info) const
144  {
145  return (name < info.name);
146  }
147 
148 public:
149 
150  int id;
151  int pid;
152  QString name;
153  QString icon;
154  qlonglong iconId;
155 };
156 
157 // --------------------------------------------------------------------------
158 
165 {
166 public:
167 
169 
170 public:
171 
172  explicit SearchInfo()
173  : id (0),
174  type(DatabaseSearch::UndefinedType)
175  {
176  };
177 
178  bool isNull() const
179  {
180  return (id == 0);
181  }
182 
186  bool operator<(const SearchInfo& info) const
187  {
188  return (id < info.id);
189  }
190 
191 public:
192 
193  int id;
194  QString name;
196  QString query;
197 };
198 
199 // --------------------------------------------------------------------------
200 
202 {
203 public:
204 
205  explicit AlbumShortInfo()
206  : id (0),
207  albumRootId(0)
208  {
209  };
210 
211  bool isNull() const
212  {
213  return (id == 0);
214  }
215 
216 public:
217 
218  int id;
219  QString relativePath;
221 };
222 
223 // --------------------------------------------------------------------------
224 
226 {
227 public:
228 
229  explicit TagShortInfo()
230  : id (0),
231  pid(0)
232  {
233  };
234 
235  bool isNull() const
236  {
237  return (id == 0);
238  }
239 
240 public:
241 
242  int id;
243  int pid;
244  QString name;
245 };
246 
247 // --------------------------------------------------------------------------
248 
250 {
251 public:
252 
253  explicit ItemShortInfo()
254  : id (0),
255  albumID (0),
256  albumRootID(0)
257  {
258  };
259 
260  bool isNull() const
261  {
262  return (id == 0);
263  }
264 
265 public:
266 
267  qlonglong id;
268  QString itemName;
269  int albumID;
271  QString album;
272 };
273 
274 // --------------------------------------------------------------------------
275 
277 {
278 public:
279 
280  explicit ItemScanInfo()
281  : id (0),
282  albumID (0),
283  status (DatabaseItem::UndefinedStatus),
284  category(DatabaseItem::UndefinedCategory),
285  fileSize(0)
286  {
287  };
288 
289  bool isNull() const
290  {
291  return (id == 0);
292  }
293 
294 public:
295 
296  qlonglong id;
297  int albumID;
298  QString itemName;
301  QDateTime modificationDate;
302  qlonglong fileSize;
303  QString uniqueHash;
304 };
305 
306 // --------------------------------------------------------------------------
307 
309 {
310 public:
311 
312  explicit CommentInfo()
313  : id (-1),
314  imageId(-1),
315  type (DatabaseComment::UndefinedType)
316  {
317  };
318 
319  bool isNull() const
320  {
321  return (id == -1);
322  }
323 
324 public:
325 
326  int id;
327  qlonglong imageId;
329  QString author;
330  QString language;
331  QDateTime date;
332  QString comment;
333 };
334 
335 // --------------------------------------------------------------------------
336 
338 {
339 public:
340 
341  explicit CopyrightInfo()
342  : id(-1)
343  {
344  };
345 
346  bool isNull() const
347  {
348  return (id == -1);
349  }
350 
351 public:
352 
353  qlonglong id;
354  QString property;
355  QString value;
356  QString extraValue;
357 };
358 
359 // --------------------------------------------------------------------------
360 
362 {
363 public:
364 
365  explicit ImageHistoryEntry()
366  : imageId(0)
367  {
368  };
369 
370  bool isNull() const
371  {
372  return (imageId == 0);
373  }
374 
375 public:
376 
377  qlonglong imageId;
378  QString uuid;
379  QString history;
380 };
381 
382 // --------------------------------------------------------------------------
383 
385 {
386 public:
387 
388  explicit ImageRelation()
389  : subjectId(0),
390  objectId (0),
391  type (DatabaseRelation::UndefinedType)
392  {
393  }
394 
395 public:
396 
397  qlonglong subjectId;
398  qlonglong objectId;
400 };
401 
402 // --------------------------------------------------------------------------
403 
405 {
406 public:
407 
408  explicit TagProperty()
409  : tagId(-1)
410  {
411  };
412 
413  bool isNull() const
414  {
415  return (tagId == -1);
416  }
417 
418 public:
419 
420  int tagId;
421  QString property;
422  QString value;
423 };
424 
425 // --------------------------------------------------------------------------
426 
428 {
429 public:
430 
431  explicit ImageTagProperty()
432  : imageId(-1),
433  tagId (-1)
434  {
435  };
436 
437  bool isNull() const
438  {
439  return (imageId == -1);
440  }
441 
442 public:
443 
444  qlonglong imageId;
445  int tagId;
446  QString property;
447  QString value;
448 };
449 
450 } // namespace Digikam
451 
452 #endif // DIGIKAM_CORE_DB_ALBUM_INFO_H
Definition: coredbalbuminfo.h:76
QString category
Definition: coredbalbuminfo.h:111
QList< AlbumInfo > List
Definition: coredbalbuminfo.h:79
qlonglong iconId
Definition: coredbalbuminfo.h:113
AlbumInfo()
Definition: coredbalbuminfo.h:83
QString caption
Definition: coredbalbuminfo.h:110
QDate date
Definition: coredbalbuminfo.h:112
int id
Definition: coredbalbuminfo.h:107
QString relativePath
Definition: coredbalbuminfo.h:109
bool isNull() const
Definition: coredbalbuminfo.h:90
bool operator<(const AlbumInfo &info) const
Definition: coredbalbuminfo.h:98
int albumRootId
Definition: coredbalbuminfo.h:108
Definition: coredbalbuminfo.h:48
QString identifier
Definition: coredbalbuminfo.h:64
AlbumRoot::Type type
Definition: coredbalbuminfo.h:62
QString label
Definition: coredbalbuminfo.h:61
int id
Definition: coredbalbuminfo.h:56
QString specificPath
Definition: coredbalbuminfo.h:65
AlbumRootInfo()
Definition: coredbalbuminfo.h:51
int status
Definition: coredbalbuminfo.h:63
Definition: coredbalbuminfo.h:202
bool isNull() const
Definition: coredbalbuminfo.h:211
int id
Definition: coredbalbuminfo.h:218
AlbumShortInfo()
Definition: coredbalbuminfo.h:205
QString relativePath
Definition: coredbalbuminfo.h:219
int albumRootId
Definition: coredbalbuminfo.h:220
Definition: coredbalbuminfo.h:309
QString author
Definition: coredbalbuminfo.h:329
QDateTime date
Definition: coredbalbuminfo.h:331
bool isNull() const
Definition: coredbalbuminfo.h:319
qlonglong imageId
Definition: coredbalbuminfo.h:327
CommentInfo()
Definition: coredbalbuminfo.h:312
QString comment
Definition: coredbalbuminfo.h:332
QString language
Definition: coredbalbuminfo.h:330
DatabaseComment::Type type
Definition: coredbalbuminfo.h:328
int id
Definition: coredbalbuminfo.h:326
Definition: coredbalbuminfo.h:338
CopyrightInfo()
Definition: coredbalbuminfo.h:341
QString property
Definition: coredbalbuminfo.h:354
qlonglong id
Definition: coredbalbuminfo.h:353
QString value
Definition: coredbalbuminfo.h:355
QString extraValue
Definition: coredbalbuminfo.h:356
bool isNull() const
Definition: coredbalbuminfo.h:346
Definition: coredbalbuminfo.h:362
ImageHistoryEntry()
Definition: coredbalbuminfo.h:365
QString uuid
Definition: coredbalbuminfo.h:378
QString history
Definition: coredbalbuminfo.h:379
qlonglong imageId
Definition: coredbalbuminfo.h:377
bool isNull() const
Definition: coredbalbuminfo.h:370
Definition: coredbalbuminfo.h:385
qlonglong subjectId
Definition: coredbalbuminfo.h:397
qlonglong objectId
Definition: coredbalbuminfo.h:398
ImageRelation()
Definition: coredbalbuminfo.h:388
DatabaseRelation::Type type
Definition: coredbalbuminfo.h:399
Definition: coredbalbuminfo.h:428
bool isNull() const
Definition: coredbalbuminfo.h:437
QString value
Definition: coredbalbuminfo.h:447
QString property
Definition: coredbalbuminfo.h:446
qlonglong imageId
Definition: coredbalbuminfo.h:444
ImageTagProperty()
Definition: coredbalbuminfo.h:431
int tagId
Definition: coredbalbuminfo.h:445
Definition: coredbalbuminfo.h:277
qlonglong id
Definition: coredbalbuminfo.h:296
qlonglong fileSize
Definition: coredbalbuminfo.h:302
int albumID
Definition: coredbalbuminfo.h:297
ItemScanInfo()
Definition: coredbalbuminfo.h:280
QDateTime modificationDate
Definition: coredbalbuminfo.h:301
QString uniqueHash
Definition: coredbalbuminfo.h:303
DatabaseItem::Status status
Definition: coredbalbuminfo.h:299
bool isNull() const
Definition: coredbalbuminfo.h:289
DatabaseItem::Category category
Definition: coredbalbuminfo.h:300
QString itemName
Definition: coredbalbuminfo.h:298
Definition: coredbalbuminfo.h:250
qlonglong id
Definition: coredbalbuminfo.h:267
bool isNull() const
Definition: coredbalbuminfo.h:260
ItemShortInfo()
Definition: coredbalbuminfo.h:253
QString itemName
Definition: coredbalbuminfo.h:268
int albumRootID
Definition: coredbalbuminfo.h:270
QString album
Definition: coredbalbuminfo.h:271
int albumID
Definition: coredbalbuminfo.h:269
Definition: coredbalbuminfo.h:165
QList< SearchInfo > List
Definition: coredbalbuminfo.h:168
int id
Definition: coredbalbuminfo.h:193
bool isNull() const
Definition: coredbalbuminfo.h:178
DatabaseSearch::Type type
Definition: coredbalbuminfo.h:195
QString query
Definition: coredbalbuminfo.h:196
bool operator<(const SearchInfo &info) const
Definition: coredbalbuminfo.h:186
QString name
Definition: coredbalbuminfo.h:194
SearchInfo()
Definition: coredbalbuminfo.h:172
Definition: coredbalbuminfo.h:124
bool operator<(const TagInfo &info) const
Definition: coredbalbuminfo.h:143
int pid
Definition: coredbalbuminfo.h:151
TagInfo()
Definition: coredbalbuminfo.h:131
int id
Definition: coredbalbuminfo.h:150
QString name
Definition: coredbalbuminfo.h:152
qlonglong iconId
Definition: coredbalbuminfo.h:154
bool isNull() const
Definition: coredbalbuminfo.h:138
QList< TagInfo > List
Definition: coredbalbuminfo.h:127
QString icon
Definition: coredbalbuminfo.h:153
Definition: coredbalbuminfo.h:405
QString property
Definition: coredbalbuminfo.h:421
int tagId
Definition: coredbalbuminfo.h:420
bool isNull() const
Definition: coredbalbuminfo.h:413
QString value
Definition: coredbalbuminfo.h:422
TagProperty()
Definition: coredbalbuminfo.h:408
Definition: coredbalbuminfo.h:226
int pid
Definition: coredbalbuminfo.h:243
QString name
Definition: coredbalbuminfo.h:244
int id
Definition: coredbalbuminfo.h:242
bool isNull() const
Definition: coredbalbuminfo.h:235
TagShortInfo()
Definition: coredbalbuminfo.h:229
Definition: piwigotalker.h:48
Type
Definition: coredbconstants.h:44
@ UndefinedType
Definition: coredbconstants.h:46
Type
Definition: coredbconstants.h:128
Category
Definition: coredbconstants.h:95
@ UndefinedCategory
Definition: coredbconstants.h:97
Status
Definition: coredbconstants.h:85
@ UndefinedStatus
Definition: coredbconstants.h:87
Type
Definition: coredbconstants.h:112
Type
Definition: coredbconstants.h:60
Definition: datefolderview.cpp:43
QPair< int, int > YearMonth
Definition: coredbalbuminfo.h:42