1
/** ===========================================================
4
* This file is a part of digiKam project
5
* <a href="http://www.digikam.org">http://www.digikam.org</a>
8
* @brief image collection
10
* @author Copyright (C) 2004-2010 by Gilles Caulier
11
* <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
12
* @author Copyright (C) 2004-2005 by Renchi Raju
13
* <a href="mailto:renchi dot raju at gmail dot com">renchi dot raju at gmail dot com</a>
14
* @author Copyright (C) 2004-2005 by Jesper K. Pedersen
15
* <a href="mailto:blackie at kde dot org">blackie at kde dot org</a>
16
* @author Copyright (C) 2004-2005 by Aurelien Gateau
17
* <a href="mailto:aurelien dot gateau at free dot fr">aurelien dot gateau at free dot fr</a>
19
* This program is free software; you can redistribute it
20
* and/or modify it under the terms of the GNU General
21
* Public License as published by the Free Software Foundation;
22
* either version 2, or (at your option)
25
* This program is distributed in the hope that it will be useful,
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
* GNU General Public License for more details.
30
* ============================================================ */
32
#include "imagecollection.h"
40
#include "imagecollectionshared.h"
46
@file imagecollection.cpp
47
returns the comment for the collection of images or QString::null if that doesn't make any sense.
48
A comment makes sense for an album, but not for a KIPI::Interface::currentSelection().
50
QString ImageCollection::comment() const
64
PENDING(blackie) document
66
QString ImageCollection::name() const
80
Return the category of the image collection. For example in Digikam,
81
a category is a sorting class like 'travels', 'friends', 'monuments', etc.
83
QString ImageCollection::category() const
97
Return the Creation date of the image collection. The default implementation
100
QDate ImageCollection::date() const
114
PENDING(blackie) document
116
KUrl::List ImageCollection::images() const
129
ImageCollection::ImageCollection( ImageCollectionShared* const data )
134
ImageCollection::ImageCollection( const ImageCollection& rhs )
147
ImageCollection::ImageCollection()
152
ImageCollection::~ImageCollection()
158
ImageCollection& ImageCollection::operator=( const ImageCollection& rhs )
180
Returns the directory for the image collection.
181
The host application may, however, return anything in case this
182
imagecollection is not a directory (check isDirectory()), or may
183
return the directory of the first image in the collection, the root
184
of the image collection (in case all images has a common root), or
187
KUrl ImageCollection::path() const
201
Returns the directory to place images into.
202
This function should only be called if KIPI::Features AcceptNewImages
205
The function may choose to return the directory for the image collection
206
or if images from the collection are not available in a common directory,
207
then instead a common upload directory.
208
In contrast to \ref path, this function must return a valid url.
210
<b>IMPORTANT:</b> uploadRoot() must be a subpath of uploadPath()
212
KUrl ImageCollection::uploadPath() const
216
return d->uploadPath();
226
When a plugin wants to upload images, it may choose to display an upload widget,
227
which gives the user the possible to show a directory from a tree view.
229
This tree view widget needs to starts at some URL. This function specifies that location.
230
Here are a couble of possible return value different host applications may choose.
232
<li> If all images are stored rooted at some tree (which is the case for
233
KimDaBa), then this function may return this directory unconditionally.
234
<li> The root directory returned by uploadPath() (which is the default implementation for this method)
235
<li> The directory returned by uploadPath().
238
<b>IMPORTANT:</b> uploadRoot() must be a subpath of uploadPath()
240
KUrl ImageCollection::uploadRoot() const
244
return d->uploadRoot();
254
This fonction return the name of the upload root path used by the
255
the KIPI::UploadWidget. This name can be different for each host
256
app (like "Images" for Kimdaba or "My Albums" for Digikam).
258
QString ImageCollection::uploadRootName() const
262
return d->uploadRootName();
272
Returns whether an imagecollection is a physical folder on the filesystem
273
or not. It is important to check this, if your plugin needs to do folder
274
based operations for an image collection.
276
bool ImageCollection::isDirectory() const
280
return d->isDirectory();
289
bool ImageCollection::isValid() const
294
void ImageCollection::printNullError() const
296
kWarning() << "Image collection is invalid - this might be the case if you asked for an album, " << endl
297
<< "and not album existed. You should check using .isValid() first." << endl
298
<< "Notice: Plugins should never create an instance of ImageCollection, only the host application "
299
<< "should do that.";
302
bool ImageCollection::operator==(const KIPI::ImageCollection& ic) const
309
return *d == *(ic.d);