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 {
00144         kdWarning( 51000 ) << "Unknown feature asked for in KIPI::Interface::hasFeature: " << feature << endl;
00145         return false;
00146     }
00147 }
00148 
00154 bool KIPI::Interface::addImage( const KURL&, QString& /*err*/ )
00155 {
00156     kdWarning(51000) << "Interface::addImage should only be invoked if the host application supports the KIPI::Features\n"
00157             "AcceptNewImages - if the host application do support that, then this function should\n"
00158             "have been overriden in the host application.\n";
00159     return false;
00160 }
00161 
00162 void KIPI::Interface::delImage( const KURL& )
00163 {
00164 }
00165 
00171 KIPI::ImageCollection KIPI::Interface::currentAlbum()
00172 {
00173     // This implementation is just to be able to write documentation above.
00174     return KIPI::ImageCollection();
00175 }
00176 
00182 KIPI::ImageCollection KIPI::Interface::currentSelection()
00183 {
00184     // This implementation is just to be able to write documentation above.
00185     return KIPI::ImageCollection();
00186 }
00187 
00191 QValueList<KIPI::ImageCollection> KIPI::Interface::allAlbums()
00192 {
00193     // This implementation is just to be able to write documentation above.
00194     return QValueList<KIPI::ImageCollection>();
00195 }
00196 
00197 
00201 int KIPI::Interface::features() const
00202 {
00203     // This implementation is just to be able to write documentation above.
00204     return 0;
00205 }
00206 
00212 QString KIPI::Interface::fileExtensions()
00213 {
00214     QStringList KDEImagetypes = KImageIO::mimeTypes( KImageIO::Reading );
00215     QString imagesFileFilter = KDEImagetypes.join(" ");
00216     return ( imagesFileFilter.lower() + " " + imagesFileFilter.upper() );
00217 }
00218 
00219 #include "interface.moc"

Generated on Mon Nov 27 23:42:22 2006 for libKipi by  doxygen 1.5.0