Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

interface.h

Go to the documentation of this file.
00001 /* ============================================================
00002  * File  : interface.h
00003  * Authors: KIPI team developers (see AUTHORS files for details)
00004  *          
00005  * Date   : 2004-02
00006  * Description :
00007  *
00008  * Copyright 2004 by the KIPI team
00009  *
00010  * This program is free software; you can redistribute it
00011  * and/or modify it under the terms of the GNU Library General
00012  * Public License as published bythe Free Software Foundation;
00013  * either version 2, or (at your option)
00014  * any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Library General Public License for more details.
00020  *
00021  * ============================================================ */
00022 
00023 #ifndef KIPI_INTERFACE_H
00024 #define KIPI_INTERFACE_H
00025 
00026 // Qt includes.
00027 
00028 #include <qstring.h>
00029 #include <qobject.h>
00030 
00031 // KDE includes.
00032 
00033 #include <kurl.h>
00034 
00035 // Local includes.
00036 
00037 #include "libkipi/imagecollection.h"
00038 #include "libkipi/imageinfo.h"
00039 
00040 namespace KIPI
00041 {
00042     enum Features {
00043         AlbumsHaveComments         = 1 << 0,
00044         ImagesHasComments          = 1 << 1,
00045         ImagesHasTime              = 1 << 2,
00046         SupportsDateRanges         = 1 << 3,
00047         AcceptNewImages            = 1 << 4,
00048         ImageTitlesWritable        = 1 << 5,
00049         AlbumsHaveCategory         = 1 << 6,
00050         AlbumsHaveCreationDate     = 1 << 7,
00051         AlbumsUseFirstImagePreview = 1 << 8 
00052         // When adding new items, remember to update "hasFeature( const QString& feature )"
00053         // and the hello world plugin.
00054     };
00055 
00056     class Interface : public QObject
00057     {
00058         Q_OBJECT
00059 
00060     public:
00061         Interface(QObject *parent, const char *name=0);
00062         virtual ~Interface();
00063 
00064         virtual ImageCollection currentAlbum() = 0;
00065         virtual ImageCollection currentSelection() = 0;
00066         virtual QValueList<ImageCollection> allAlbums() = 0;
00067 
00068         virtual ImageInfo info( const KURL& ) = 0;
00069         virtual bool addImage( const KURL&, QString& err );
00070         virtual void delImage( const KURL& );
00071 
00072         virtual void refreshImages( const KURL::List& );
00073 
00074         virtual QString fileExtensions();
00075 
00076         bool hasFeature( KIPI::Features feature );
00077 
00078     protected:
00079         virtual int features() const = 0;
00080 
00081     private:
00082         friend class PluginLoader;
00083         bool hasFeature( const QString& feature );
00084 
00085     signals:
00086         void selectionChanged( bool hasSelection );
00087         void currentAlbumChanged( bool anyAlbum );
00088     };
00089 }
00090 
00091 #endif /* KIPI_INTERFACE_H */

Generated on Tue Sep 13 05:01:58 2005 for libKipi by  doxygen 1.4.4