• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

libs/libkipi/libkipi

  • sources
  • kde-4.12
  • kdegraphics
  • libs
  • libkipi
  • libkipi
imagecollection.cpp
Go to the documentation of this file.
1 
32 #include "imagecollection.h"
33 
34 // KDE includes
35 
36 #include <kdebug.h>
37 
38 // Local includes
39 
40 #include "imagecollectionshared.h"
41 
42 // Macros
43 
44 #define PrintWarningMessage() \
45  kWarning() << "Image collection is invalid - this might be the case if you asked for an album, " \
46  << "and not album existed. You should check using .isValid() first. " \
47  << "Note: Plugins should never create an instance of ImageCollection, only the " \
48  << "host application should do that."
49 
50 namespace KIPI
51 {
52 
53 ImageCollection::ImageCollection(ImageCollectionShared* const data)
54  : d(data)
55 {
56 }
57 
58 ImageCollection::ImageCollection(const ImageCollection& rhs)
59 {
60  if ( rhs.d )
61  {
62  d = rhs.d;
63  d->addRef();
64  }
65  else
66  {
67  d = 0;
68  }
69 }
70 
71 ImageCollection::ImageCollection()
72 {
73  d = 0;
74 }
75 
76 ImageCollection::~ImageCollection()
77 {
78  if ( d )
79  d->removeRef();
80 }
81 
82 ImageCollection& ImageCollection::operator=(const ImageCollection& rhs)
83 {
84  if ( rhs.d == d )
85  return *this;
86 
87  if ( d )
88  d->removeRef();
89 
90  if ( !rhs.d )
91  {
92  PrintWarningMessage();
93  d = 0;
94  }
95  else
96  {
97  d = rhs.d;
98  d->addRef();
99  }
100  return *this;
101 }
102 
103 bool ImageCollection::operator==(const ImageCollection& ic) const
104 {
105  if (!d || !(ic.d))
106  {
107  PrintWarningMessage();
108  return false;
109  }
110  return *d == *(ic.d);
111 }
112 
113 QString ImageCollection::comment() const
114 {
115  if ( d )
116  {
117  return d->comment();
118  }
119  else
120  {
121  PrintWarningMessage();
122  return QString::null;
123  }
124 }
125 
126 QString ImageCollection::name() const
127 {
128  if ( d )
129  {
130  return d->name();
131  }
132  else
133  {
134  PrintWarningMessage();
135  return QString();
136  }
137 }
138 
139 QString ImageCollection::category() const
140 {
141  if ( d )
142  {
143  return d->category();
144  }
145  else
146  {
147  PrintWarningMessage();
148  return QString::null;
149  }
150 }
151 
152 QDate ImageCollection::date() const
153 {
154  if ( d )
155  {
156  return d->date();
157  }
158  else
159  {
160  PrintWarningMessage();
161  return QDate();
162  }
163 }
164 
165 KUrl::List ImageCollection::images() const
166 {
167  if ( d )
168  {
169  return d->images();
170  }
171  else
172  {
173  PrintWarningMessage();
174  return KUrl::List();
175  }
176 }
177 
178 KUrl ImageCollection::path() const
179 {
180  if ( d )
181  {
182  return d->path();
183  }
184  else
185  {
186  PrintWarningMessage();
187  return KUrl();
188  }
189 }
190 
191 KUrl ImageCollection::uploadPath() const
192 {
193  if ( d )
194  {
195  return d->uploadPath();
196  }
197  else
198  {
199  PrintWarningMessage();
200  return KUrl();
201  }
202 }
203 
204 KUrl ImageCollection::uploadRoot() const
205 {
206  if ( d )
207  {
208  return d->uploadRoot();
209  }
210  else
211  {
212  PrintWarningMessage();
213  return KUrl();
214  }
215 }
216 
217 QString ImageCollection::uploadRootName() const
218 {
219  if ( d )
220  {
221  return d->uploadRootName();
222  }
223  else
224  {
225  PrintWarningMessage();
226  return QString();
227  }
228 }
229 
230 bool ImageCollection::isDirectory() const
231 {
232  if ( d )
233  {
234  return d->isDirectory();
235  }
236  else
237  {
238  PrintWarningMessage();
239  return false;
240  }
241 }
242 
243 bool ImageCollection::isValid() const
244 {
245  return (d != 0);
246 }
247 
248 } // namespace KIPI
KIPI::ImageCollectionShared::path
virtual KUrl path()
Definition: imagecollectionshared.cpp:78
KIPI::ImageCollection
Holds info about the collection from KIPI host application.
Definition: imagecollection.h:58
imagecollectionshared.h
===========================================================This file is a part of digiKam project htt...
KIPI::ImageCollectionShared::images
virtual KUrl::List images()=0
These methods must be re-implemented in your KIPI host application to manage collection attributes wi...
KIPI::ImageCollectionShared::name
virtual QString name()=0
KIPI::ImageCollection::images
KUrl::List images() const
Returns a list of image urls hosted by collection.
Definition: imagecollection.cpp:165
KIPI::ImageCollection::date
QDate date() const
Returns the Creation date of the image collection.
Definition: imagecollection.cpp:152
KIPI::ImageCollection::~ImageCollection
~ImageCollection()
Definition: imagecollection.cpp:76
KIPI::ImageCollectionShared::uploadRootName
virtual QString uploadRootName()
Definition: imagecollectionshared.cpp:106
KIPI::ImageCollectionShared::category
virtual QString category()
Definition: imagecollectionshared.cpp:122
KIPI::ImageCollectionShared::uploadPath
virtual KUrl uploadPath()
Definition: imagecollectionshared.cpp:85
KIPI::ImageCollection::name
QString name() const
Collection properties ---------------------------------------------------------------------——.
Definition: imagecollection.cpp:126
KIPI::ImageCollectionShared::comment
virtual QString comment()
Definition: imagecollectionshared.cpp:116
KIPI::ImageCollection::uploadPath
KUrl uploadPath() const
Returns the directory to place images into.
Definition: imagecollection.cpp:191
KIPI::ImageCollection::uploadRootName
QString uploadRootName() const
This fonction return the name of the upload root path used by the the KIPI::UploadWidget.
Definition: imagecollection.cpp:217
KIPI::ImageCollection::path
KUrl path() const
Returns the directory for the image collection.
Definition: imagecollection.cpp:178
PrintWarningMessage
#define PrintWarningMessage()
Definition: imagecollection.cpp:44
KIPI::ImageCollection::comment
QString comment() const
Returns the comment for the collection of images or QString::null if that doesn't make any sense...
Definition: imagecollection.cpp:113
KIPI::ImageCollection::uploadRoot
KUrl uploadRoot() const
When a plugin wants to upload images, it may choose to display an upload widget, which gives the user...
Definition: imagecollection.cpp:204
KIPI::ImageCollectionShared::date
virtual QDate date()
Definition: imagecollectionshared.cpp:128
KIPI::ImageCollection::operator=
ImageCollection & operator=(const ImageCollection &)
Definition: imagecollection.cpp:82
imagecollection.h
===========================================================This file is a part of digiKam project htt...
KIPI::ImageCollectionShared
See ImageCollection documentation for details.
Definition: imagecollectionshared.h:53
KIPI::ImageCollection::category
QString category() const
Return the category of the image collection.
Definition: imagecollection.cpp:139
KIPI::ImageCollection::isDirectory
bool isDirectory() const
Returns whether an imagecollection is a physical folder on the filesystem or not. ...
Definition: imagecollection.cpp:230
KIPI::ImageCollectionShared::uploadRoot
virtual KUrl uploadRoot()
Definition: imagecollectionshared.cpp:91
KIPI::ImageCollection::ImageCollection
ImageCollection()
Definition: imagecollection.cpp:71
KIPI::ImageCollectionShared::isDirectory
virtual bool isDirectory()
Definition: imagecollectionshared.cpp:111
KIPI::ImageCollection::operator==
bool operator==(const ImageCollection &) const
Definition: imagecollection.cpp:103
KIPI::ImageCollection::isValid
bool isValid() const
Returns true if this Collection is valid.
Definition: imagecollection.cpp:243
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libs/libkipi/libkipi

Skip menu "libs/libkipi/libkipi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal