interface.cpp

Go to the documentation of this file.
00001 /* ============================================================
00002  * File   : interface.cpp
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 by the 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 
00025 // KDE includes.
00026 
00027 #include <kdebug.h>
00028 #include <kimageio.h>
00029 
00030 // Local includes.
00031  
00032 #include "pluginloader.h"
00033 #include "interface.h"
00034 
00098 KIPI::Interface::Interface(QObject *parent, const char *name )
00099     : QObject(parent, name)
00100 {
00101 }
00102 
00103 KIPI::Interface::~Interface()
00104 {
00105 }
00106 
00110 void KIPI::Interface::refreshImages( const KURL::List& )
00111 {
00112 }
00113 
00118 bool KIPI::Interface::hasFeature( KIPI::Features feature )
00119 {
00120     return ( features() & feature ) != 0;
00121 }
00122 
00123 bool KIPI::Interface::hasFeature( const QString& feature )
00124 {
00125     if ( feature == "AlbumsHaveComments" )
00126         return hasFeature( KIPI::AlbumsHaveComments );
00127     else if ( feature == "ImagesHasComments" )
00128         return hasFeature( KIPI::ImagesHasComments );
00129     else if ( feature == "ImagesHasTime" )
00130         return hasFeature( KIPI::ImagesHasTime );
00131     else if ( feature == "SupportsDateRanges" )
00132         return hasFeature( KIPI::SupportsDateRanges );
00133     else if ( feature == "AcceptNewImages" )
00134         return hasFeature( KIPI::AcceptNewImages );
00135     else if ( feature == "ImageTitlesWritable" )
00136         return hasFeature( KIPI::ImageTitlesWritable );
00137     else if ( feature == "AlbumsHaveCategory" )
00138         return hasFeature( KIPI::AlbumsHaveCategory );
00139     else if ( feature == "AlbumsHaveCreationDate" )
00140         return hasFeature( KIPI::AlbumsHaveCreationDate );
00141     else if ( feature == "AlbumsUseFirstImagePreview" )
00142         return hasFeature( KIPI::AlbumsUseFirstImagePreview );
00143     else if ( feature == "HostSupportsTags" )
00144         return hasFeature( KIPI::HostSupportsTags );
00145     else {
00146         kdWarning( 51000 ) << "Unknown feature asked for in KIPI::Interface::hasFeature: " << feature << endl;
00147         return false;
00148     }
00149 }
00150 
00156 bool KIPI::Interface::addImage( const KURL&, QString& /*err*/ )
00157 {
00158     kdWarning(51000) << "Interface::addImage should only be invoked if the host application supports the KIPI::Features\n"
00159             "AcceptNewImages - if the host application do support that, then this function should\n"
00160             "have been overriden in the host application.\n";
00161     return false;
00162 }
00163 
00164 void KIPI::Interface::delImage( const KURL& )
00165 {
00166 }
00167 
00173 KIPI::ImageCollection KIPI::Interface::currentAlbum()
00174 {
00175     // This implementation is just to be able to write documentation above.
00176     return KIPI::ImageCollection();
00177 }
00178 
00184 KIPI::ImageCollection KIPI::Interface::currentSelection()
00185 {
00186     // This implementation is just to be able to write documentation above.
00187     return KIPI::ImageCollection();
00188 }
00189 
00193 QValueList<KIPI::ImageCollection> KIPI::Interface::allAlbums()
00194 {
00195     // This implementation is just to be able to write documentation above.
00196     return QValueList<KIPI::ImageCollection>();
00197 }
00198 
00199 
00203 int KIPI::Interface::features() const
00204 {
00205     // This implementation is just to be able to write documentation above.
00206     return 0;
00207 }
00208 
00214 QString KIPI::Interface::fileExtensions()
00215 {
00216     QStringList KDEImagetypes = KImageIO::mimeTypes( KImageIO::Reading );
00217     QString imagesFileFilter = KDEImagetypes.join(" ");
00218     return ( imagesFileFilter.lower() + " " + imagesFileFilter.upper() );
00219 }
00220 
00221 #include "interface.moc"

Generated on Tue Sep 25 22:34:22 2007 for libKipi by  doxygen 1.5.3