~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to core/libs/database/albuminfo.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Rohan Garg, Philip Muškovac, Felix Geyer
  • Date: 2011-09-23 18:18:55 UTC
  • mfrom: (1.2.36 upstream)
  • Revision ID: package-import@ubuntu.com-20110923181855-ifs67wxkugshev9k
Tags: 2:2.1.1-0ubuntu1
[ Rohan Garg ]
* New upstream release (LP: #834190)
  - debian/control
    + Build with libqtwebkit-dev
 - debian/kipi-plugins-common
    + Install libkvkontakte required by kipi-plugins
 - debian/digikam
    + Install panoramagui

[ Philip Muškovac ]
* New upstream release
  - debian/control:
    + Add libcv-dev, libcvaux-dev, libhighgui-dev, libboost-graph1.46-dev,
      libksane-dev, libxml2-dev, libxslt-dev, libqt4-opengl-dev, libqjson-dev,
      libgpod-dev and libqca2-dev to build-deps
    + Add packages for kipi-plugins, libmediawiki, libkface, libkgeomap and
      libkvkontakte
  - debian/rules:
    + Don't build with gphoto2 since it doesn't build with it.
  - Add kubuntu_fix_test_linking.diff to fix linking of the dngconverter test
  - update install files
  - update kubuntu_01_mysqld_executable_name.diff for new cmake layout
    and rename to kubuntu_mysqld_executable_name.diff
* Fix typo in digikam-data description (LP: #804894)
* Fix Vcs links

[ Felix Geyer ]
* Move library data files to the new packages libkface-data, libkgeomap-data
  and libkvkontakte-data.
* Override version of the embedded library packages to 1.0~digikam<version>.
* Exclude the library packages from digikam-dbg to prevent file conflicts in
  the future.
* Call dh_install with --list-missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2007-04-21
 
7
 * Description : Structures to use in AlbumDB
 
8
 *
 
9
 * Copyright (C) 2007-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 
10
 * Copyright (C) 2005 by Renchi Raju <renchi@pooh.tam.uiuc.edu>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#ifndef ALBUMINFO_H
 
26
#define ALBUMINFO_H
 
27
 
 
28
/** @file albuminfo.h */
 
29
 
 
30
// Qt includes
 
31
 
 
32
#include <QString>
 
33
#include <QList>
 
34
#include <QDateTime>
 
35
 
 
36
// KDE includes
 
37
 
 
38
#include <kurl.h>
 
39
 
 
40
// Local includes
 
41
 
 
42
#include "databaseconstants.h"
 
43
 
 
44
namespace Digikam
 
45
{
 
46
 
 
47
typedef QPair<int, int> YearMonth;
 
48
 
 
49
/**
 
50
 * \class AlbumRootInfo
 
51
 */
 
52
class AlbumRootInfo
 
53
{
 
54
public:
 
55
 
 
56
    AlbumRootInfo() : id(0), type(AlbumRoot::UndefinedType), status(0) {};
 
57
 
 
58
    int             id;
 
59
    QString         label;
 
60
    AlbumRoot::Type type;
 
61
    int             status;
 
62
    QString         identifier;
 
63
    QString         specificPath;
 
64
};
 
65
 
 
66
// --------------------------------------------------------------------------
 
67
 
 
68
/**
 
69
 * \class AlbumInfo
 
70
 * A container class for transporting album information
 
71
 * from the database to AlbumManager
 
72
 */
 
73
class AlbumInfo
 
74
{
 
75
public:
 
76
 
 
77
    AlbumInfo() : id(0), albumRootId(0), iconAlbumRootId(0) {};
 
78
 
 
79
    typedef QList<AlbumInfo> List;
 
80
 
 
81
    bool isNull() const
 
82
    {
 
83
        return id == 0;
 
84
    }
 
85
 
 
86
    int     id;
 
87
    int     albumRootId;
 
88
    QString relativePath;
 
89
    QString caption;
 
90
    QString category;
 
91
    QDate   date;
 
92
    int     iconAlbumRootId;
 
93
    QString iconRelativePath;
 
94
 
 
95
    /**
 
96
     * needed for sorting
 
97
     */
 
98
    bool operator<(const AlbumInfo& info) const
 
99
    {
 
100
        // include album root id?
 
101
        return relativePath < info.relativePath;
 
102
    }
 
103
};
 
104
 
 
105
// --------------------------------------------------------------------------
 
106
 
 
107
/**
 
108
 * \class TagInfo
 
109
 * A container class for transporting tag information
 
110
 * from the database to AlbumManager
 
111
 */
 
112
class TagInfo
 
113
{
 
114
public:
 
115
 
 
116
    TagInfo() : id(0), pid(0), iconAlbumRootId(0) {};
 
117
 
 
118
    typedef QList<TagInfo> List;
 
119
 
 
120
    bool isNull() const
 
121
    {
 
122
        return id == 0;
 
123
    }
 
124
 
 
125
    int     id;
 
126
    int     pid;
 
127
    QString name;
 
128
    QString icon;
 
129
    int     iconAlbumRootId;
 
130
    QString iconRelativePath;
 
131
 
 
132
    bool operator<(const TagInfo& info) const
 
133
    {
 
134
        return name < info.name;
 
135
    }
 
136
};
 
137
 
 
138
// --------------------------------------------------------------------------
 
139
 
 
140
/**
 
141
 * \class SearchInfo
 
142
 * A container class for transporting search information
 
143
 * from the database to AlbumManager
 
144
 */
 
145
class SearchInfo
 
146
{
 
147
public:
 
148
 
 
149
    SearchInfo() : id(0), type(DatabaseSearch::UndefinedType) {};
 
150
 
 
151
    typedef QList<SearchInfo> List;
 
152
 
 
153
    bool isNull() const
 
154
    {
 
155
        return id == 0;
 
156
    }
 
157
 
 
158
    int                  id;
 
159
    QString              name;
 
160
    DatabaseSearch::Type type;
 
161
    QString              query;
 
162
 
 
163
    /**
 
164
     * needed for sorting
 
165
     */
 
166
    bool operator<(const SearchInfo& info) const
 
167
    {
 
168
        return id < info.id;
 
169
    }
 
170
};
 
171
 
 
172
// --------------------------------------------------------------------------
 
173
 
 
174
class AlbumShortInfo
 
175
{
 
176
public:
 
177
 
 
178
    AlbumShortInfo() : id(0), albumRootId(0) {};
 
179
 
 
180
    bool isNull() const
 
181
    {
 
182
        return id == 0;
 
183
    }
 
184
 
 
185
    int     id;
 
186
    QString relativePath;
 
187
    int     albumRootId;
 
188
};
 
189
 
 
190
// --------------------------------------------------------------------------
 
191
 
 
192
class TagShortInfo
 
193
{
 
194
public:
 
195
 
 
196
    TagShortInfo() : id(0), pid(0) {};
 
197
 
 
198
    bool isNull() const
 
199
    {
 
200
        return id == 0;
 
201
    }
 
202
 
 
203
    int     id;
 
204
    int     pid;
 
205
    QString name;
 
206
};
 
207
 
 
208
// --------------------------------------------------------------------------
 
209
 
 
210
class ItemShortInfo
 
211
{
 
212
public:
 
213
 
 
214
    ItemShortInfo() : id(0), albumID(0), albumRootID(0) {};
 
215
 
 
216
    bool isNull() const
 
217
    {
 
218
        return id == 0;
 
219
    }
 
220
 
 
221
    qlonglong id;
 
222
    QString   itemName;
 
223
    int       albumID;
 
224
    int       albumRootID;
 
225
    QString   album;
 
226
};
 
227
 
 
228
// --------------------------------------------------------------------------
 
229
 
 
230
class ItemScanInfo
 
231
{
 
232
public:
 
233
 
 
234
    ItemScanInfo()
 
235
        : id(0), albumID(0), status(DatabaseItem::UndefinedStatus),
 
236
          category(DatabaseItem::UndefinedCategory), fileSize(0)
 
237
    {};
 
238
 
 
239
    bool isNull() const
 
240
    {
 
241
        return id == 0;
 
242
    }
 
243
 
 
244
    qlonglong              id;
 
245
    int                    albumID;
 
246
    QString                itemName;
 
247
    DatabaseItem::Status   status;
 
248
    DatabaseItem::Category category;
 
249
    QDateTime              modificationDate;
 
250
    qlonglong              fileSize;
 
251
    QString                uniqueHash;
 
252
};
 
253
 
 
254
// --------------------------------------------------------------------------
 
255
 
 
256
class CommentInfo
 
257
{
 
258
public:
 
259
 
 
260
    CommentInfo() : id(-1), imageId(-1), type(DatabaseComment::UndefinedType) {};
 
261
 
 
262
    bool isNull() const
 
263
    {
 
264
        return id == -1;
 
265
    }
 
266
 
 
267
    int                   id;
 
268
    qlonglong             imageId;
 
269
    DatabaseComment::Type type;
 
270
    QString               author;
 
271
    QString               language;
 
272
    QDateTime             date;
 
273
    QString               comment;
 
274
};
 
275
 
 
276
// --------------------------------------------------------------------------
 
277
 
 
278
class CopyrightInfo
 
279
{
 
280
public:
 
281
 
 
282
    CopyrightInfo() : id(-1) {};
 
283
 
 
284
    bool isNull() const
 
285
    {
 
286
        return id == -1;
 
287
    }
 
288
 
 
289
    qlonglong id;
 
290
    QString   property;
 
291
    QString   value;
 
292
    QString   extraValue;
 
293
};
 
294
 
 
295
// --------------------------------------------------------------------------
 
296
 
 
297
class ImageHistoryEntry
 
298
{
 
299
public:
 
300
 
 
301
    ImageHistoryEntry() : imageId(0) {};
 
302
 
 
303
    bool isNull() const
 
304
    {
 
305
        return imageId == 0;
 
306
    }
 
307
 
 
308
    qlonglong imageId;
 
309
    QString   uuid;
 
310
    QString   history;
 
311
};
 
312
 
 
313
// --------------------------------------------------------------------------
 
314
 
 
315
class ImageRelation
 
316
{
 
317
public:
 
318
 
 
319
    ImageRelation() : subjectId(0), objectId(0), type(DatabaseRelation::UndefinedType) {}
 
320
 
 
321
    qlonglong              subjectId;
 
322
    qlonglong              objectId;
 
323
    DatabaseRelation::Type type;
 
324
};
 
325
 
 
326
// --------------------------------------------------------------------------
 
327
 
 
328
class TagProperty
 
329
{
 
330
public:
 
331
 
 
332
    TagProperty() : tagId(-1) {};
 
333
 
 
334
    bool isNull() const
 
335
    {
 
336
        return tagId == -1;
 
337
    }
 
338
 
 
339
    int tagId;
 
340
    QString property;
 
341
    QString value;
 
342
};
 
343
 
 
344
// --------------------------------------------------------------------------
 
345
 
 
346
class ImageTagProperty
 
347
{
 
348
public:
 
349
 
 
350
    ImageTagProperty() : imageId(-1), tagId(-1) {};
 
351
 
 
352
    bool isNull() const
 
353
    {
 
354
        return imageId == -1;
 
355
    }
 
356
 
 
357
    qlonglong imageId;
 
358
    int tagId;
 
359
    QString property;
 
360
    QString value;
 
361
};
 
362
 
 
363
}  // namespace Digikam
 
364
 
 
365
#endif /* ALBUMINFO_H */