• 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
interface.h
Go to the documentation of this file.
1 
34 #ifndef KIPI_INTERFACE_H
35 #define KIPI_INTERFACE_H
36 
37 // Qt includes
38 
39 #include <QtCore/QFlags>
40 #include <QtCore/QObject>
41 #include <QtCore/QVariant>
42 #include <QtCore/QList>
43 
44 // KDE includes
45 
46 #include <kurl.h>
47 
48 // Local includes
49 
50 #include "libkipi_export.h"
51 
52 class QPixmap;
53 class QWidget;
54 class QAbstractItemModel;
55 
56 class KFileItem;
57 
60 namespace KIPI
61 {
62 
63 class ImageCollection;
64 class ImageCollectionSelector;
65 class ImageInfo;
66 class ImageInfoShared;
67 class UploadWidget;
68 
77 enum Features
78 {
79  CollectionsHaveComments = 1 << 0,
80  ImagesHasComments = 1 << 1,
81  ImagesHasTime = 1 << 2,
82  HostSupportsDateRanges = 1 << 3,
83  HostAcceptNewImages = 1 << 4,
85  ImagesHasTitlesWritable = 1 << 5,
86  CollectionsHaveCategory = 1 << 6,
87  CollectionsHaveCreationDate = 1 << 7,
88  HostSupportsProgressBar = 1 << 8,
89  HostSupportsTags = 1 << 9,
90  HostSupportsRating = 1 << 10,
91  HostSupportsThumbnails = 1 << 11,
92  HostSupportsReadWriteLock = 1 << 12,
93  HostSupportsPickLabel = 1 << 13,
94  HostSupportsColorLabel = 1 << 14,
95  HostSupportsItemReservation = 1 << 15
96 };
97 
98 // NOTE: When a new item is add to Features, please don't forget to patch Interface::hasFeature().
99 
100 enum EditHint
101 {
102  UndefinedEditHint = 0,
104  HintPixelContentChanged = 1 << 0,
106  HintMetadataChanged = 1 << 1,
110  HintChangeReflectedByAttributes
111  = 1 << 2,
113  HintEditAborted = 1 << 3,
114 
116  HintMetadataOnlyChange = HintMetadataChanged | HintChangeReflectedByAttributes
117 };
118 Q_DECLARE_FLAGS(EditHints, EditHint)
119 
120 // ---------------------------------------------------------------------------------------------------------------
121 
122 class LIBKIPI_EXPORT FileReadWriteLock
123 {
124 public:
125 
146  virtual ~FileReadWriteLock() {}
147  virtual void lockForRead() = 0;
148  virtual void lockForWrite() = 0;
149  virtual bool tryLockForRead() = 0;
150  virtual bool tryLockForRead(int timeout) = 0;
151  virtual bool tryLockForWrite() = 0;
152  virtual bool tryLockForWrite(int timeout) = 0;
153  virtual void unlock() = 0;
154 };
155 
156 // ---------------------------------------------------------------------------------------------------------------
157 
158 class LIBKIPI_EXPORT Interface : public QObject
159 {
160  Q_OBJECT
161 
162 public:
163 
164  explicit Interface(QObject* const parent, const char* name=0);
165  virtual ~Interface();
166 
171  bool hasFeature(Features feature) const;
172 
178  virtual ImageCollection currentAlbum() = 0;
179 
185  virtual ImageCollection currentSelection() = 0;
186 
190  virtual QList<ImageCollection> allAlbums() = 0;
191 
195  virtual ImageInfo info(const KUrl&) = 0;
196 
202  virtual bool addImage(const KUrl&, QString& err);
203 
207  virtual void delImage(const KUrl&);
208 
212  virtual void refreshImages(const KUrl::List&);
213 
219  virtual void thumbnail(const KUrl& url, int size);
220 
226  virtual void thumbnails(const KUrl::List& list, int size);
227 
241  virtual QString progressScheduled(const QString& title, bool canBeCanceled, bool hasThumb) const;
242 
246  virtual void progressValueChanged(const QString& id, float percent);
247  virtual void progressStatusChanged(const QString& id, const QString& status);
248  virtual void progressThumbnailChanged(const QString& id, const QPixmap& thumb);
249  virtual void progressCompleted(const QString& id);
250 
302  virtual QVariant hostSetting(const QString& settingName);
303 
304  virtual ImageCollectionSelector* imageCollectionSelector(QWidget* parent)=0;
305  virtual UploadWidget* uploadWidget(QWidget* parent)=0;
306  virtual QAbstractItemModel* getTagTree() const;
307 
322  virtual bool reserveForAction(const KUrl& url, QObject* const reservingObject,
323  const QString& descriptionOfAction) const;
330  virtual void clearReservation(const KUrl& url, QObject* const reservingObject);
331 
338  virtual bool itemIsReserved(const KUrl& url, QString* const descriptionOfAction = 0) const;
339 
348  virtual FileReadWriteLock* createReadWriteLock(const KUrl& url) const;
349 
359  virtual void aboutToEdit(const KUrl& url, EditHints hints);
360  virtual void editingFinished(const KUrl& url, EditHints hints);
361 
365  static QString version();
366 
367 Q_SIGNALS:
368 
373  void selectionChanged(bool hasSelection);
374 
379  void currentAlbumChanged(bool hasSelection);
380 
384  void gotThumbnail(const KUrl&, const QPixmap&);
385 
389  void progressCanceled(const QString& id);
390 
396  void reservedForAction(const KUrl& url, const QString& descriptionOfAction);
397  void reservationCleared(const KUrl& url);
398 
399 protected:
400 
404  virtual int features() const = 0;
405 
406 private Q_SLOTS:
407 
408  void gotKDEPreview(const KFileItem& item, const QPixmap& pix);
409  void failedKDEPreview(const KFileItem&);
410 
411 private:
412 
413  bool hasFeature(const QString& feature) const;
414 
415 private:
416 
417  friend class PluginLoader;
418 };
419 
420 // ---------------------------------------------------------------------------------------------------------------
421 
431 class LIBKIPI_EXPORT FileReadLocker
432 {
433 public:
434 
435  FileReadLocker(Interface* const iface, const KUrl& url);
436  FileReadLocker(ImageInfoShared* const info);
437  ~FileReadLocker();
438 
439  FileReadWriteLock* fileReadWriteLock() const;
440  void unlock();
441  void relock();
442 
443 private:
444 
445  FileReadWriteLock* const d;
446 };
447 
448 // ---------------------------------------------------------------------------------------------------------------
449 
450 class LIBKIPI_EXPORT FileWriteLocker
451 {
452 public:
453 
454  FileWriteLocker(Interface* const iface, const KUrl& url);
455  FileWriteLocker(ImageInfoShared* const info);
456  ~FileWriteLocker();
457 
458  FileReadWriteLock* fileReadWriteLock() const;
459  void unlock();
460  void relock();
461 
462 private:
463 
464  FileReadWriteLock* const d;
465 };
466 
467 // ---------------------------------------------------------------------------------------------------------------
468 
469 class LIBKIPI_EXPORT EditHintScope
470 {
471 public:
472 
473  EditHintScope(Interface* const iface, const KUrl& url, EditHints hints);
474  ~EditHintScope();
475 
476  void changeAborted();
477 
478 private:
479 
480  Interface* const iface;
481  KUrl const url;
482  EditHints hints;
483 };
484 
485 } // namespace KIPI
486 
487 Q_DECLARE_OPERATORS_FOR_FLAGS(KIPI::EditHints)
488 
489 #endif /* KIPI_INTERFACE_H */
KIPI::HostSupportsProgressBar
This feature specifies that collections are a creation date associated to them.
Definition: interface.h:88
KIPI::HostSupportsColorLabel
This feature specifies whether the host application supports pick label values for images...
Definition: interface.h:94
KIPI::HostSupportsPickLabel
This feature specifies that host application has mechanism to lock/unlock items to prevent concurent ...
Definition: interface.h:93
KIPI::UndefinedEditHint
Definition: interface.h:102
KIPI::HintPixelContentChanged
The image data (pixels) have been edited.
Definition: interface.h:104
KIPI::PluginLoader
Definition: pluginloader.h:189
KIPI::ImageCollection
Holds info about the collection from KIPI host application.
Definition: imagecollection.h:58
KIPI::FileReadWriteLock
Definition: interface.h:122
KIPI::CollectionsHaveCategory
This feature specifies whether the plugin can change the title for images.
Definition: interface.h:86
KIPI::CollectionsHaveComments
Definition: interface.h:79
QWidget
KIPI::ImageCollectionSelector
Re-implement this widget in your KIPI host application to use your dedicated model/view.
Definition: imagecollectionselector.h:45
KIPI::Features
Features
Definition: interface.h:77
KIPI::HostSupportsDateRanges
This feature specifies that images has a date associated with it, which the host application can disp...
Definition: interface.h:82
KIPI::HostSupportsRating
This feature specifies whether the host application supports keywords for images. ...
Definition: interface.h:90
KIPI::CollectionsHaveCreationDate
This feature specifies that collections are category associated to them ('travels', 'friends', 'monuments', etc.).
Definition: interface.h:87
KIPI::Interface
Definition: interface.h:158
KIPI::HostSupportsReadWriteLock
This feature specifies that host application can provide image thumbnails.
Definition: interface.h:92
KIPI::HintMetadataChanged
Metadata have been edited.
Definition: interface.h:106
LIBKIPI_EXPORT
#define LIBKIPI_EXPORT
Definition: libkipi_export.h:39
QObject
KIPI::EditHint
EditHint
Definition: interface.h:100
KIPI::ImageInfo
Holds info about an image from KIPI host application.
Definition: imageinfo.h:63
libkipi_export.h
===========================================================This file is part of the KDE project ...
KIPI::HintChangeReflectedByAttributes
All changes done (typically, to the metadata) are also communicated via image attributes.
Definition: interface.h:110
KIPI::ImagesHasComments
This feature specifies that albums have descriptions associated to them.
Definition: interface.h:80
KIPI::HostSupportsItemReservation
This feature specifies whether the host application supports color label values for images...
Definition: interface.h:95
KIPI::EditHintScope
Definition: interface.h:469
KIPI::HintEditAborted
The operation indicated as "about to be done" has been aborted / did not result in a change...
Definition: interface.h:113
KIPI::ImagesHasTime
This feature specifies that images in the host application has descriptions associated to them...
Definition: interface.h:81
KIPI::FileWriteLocker
Definition: interface.h:450
KIPI::UploadWidget
Re-implement this widget in your KIPI host application to use your dedicated model/view.
Definition: uploadwidget.h:44
KIPI::HintMetadataOnlyChange
Short name, implies that only metadata changed, and all metadata changes are communicated via attribu...
Definition: interface.h:116
KIPI::FileReadWriteLock::~FileReadWriteLock
virtual ~FileReadWriteLock()
A Kipi FileReadWriteLock refers to application-wide reading/writing to a file on disk; it is created ...
Definition: interface.h:146
KIPI::ImageInfoShared
See ImageInfo documentation for details.
Definition: imageinfoshared.h:62
KIPI::FileReadLocker
Convenience classes creating a FileReadWriteLock and locking it for you.
Definition: interface.h:431
KIPI::HostSupportsThumbnails
This feature specifies whether the host application supports rating values for images.
Definition: interface.h:91
KIPI::HostAcceptNewImages
This feature specifies whether the host application supports that the user can specify a date range f...
Definition: interface.h:83
KIPI::HostSupportsTags
This feature specifies whether the host application has a progress manager available to report progre...
Definition: interface.h:89
KIPI::ImagesHasTitlesWritable
This feature specifies that the host application do accept new images.
Definition: interface.h:85
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