libkdepim

resourceabc.h

00001 /*
00002     This file is part of libkdepim.
00003 
00004     Copyright (c) 2004 Bo Thorsen <bo@sonofthor.dk>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef RESOURCEABC_H
00026 #define RESOURCEABC_H
00027 
00028 #include <kabc/resource.h>
00029 #include <qmap.h>
00030 #include <kdepimmacros.h>
00031 
00032 // This is here because it can't go to kdelibs/kabc yet, but ultimately
00033 // it should probably go there (maybe redesigned to have a real object
00034 // for subresources).
00035 
00036 namespace KPIM {
00037 
00044 class KDE_EXPORT ResourceABC : public KABC::Resource
00045 {
00046   Q_OBJECT
00047 
00048 public:
00049   ResourceABC( const KConfig* );
00050   virtual ~ResourceABC();
00051 
00058   virtual QMap<QString, QString> uidToResourceMap() const = 0;
00059 
00065   virtual QStringList subresources() const { return QStringList(); }
00066 
00070   virtual bool subresourceActive( const QString& ) const { return true; }
00071 
00075   virtual int subresourceCompletionWeight( const QString& ) const = 0;
00076 
00080   virtual QString subresourceLabel( const QString& ) const = 0;
00081 
00082 public slots:
00086   virtual void setSubresourceActive( const QString &, bool active ) = 0;
00087 
00091   virtual void setSubresourceCompletionWeight( const QString&, int weight ) = 0;
00092 
00093 signals:
00097   void signalSubresourceAdded( KPIM::ResourceABC *, const QString &type,
00098                                const QString &subResource );
00099 
00103   void signalSubresourceRemoved( KPIM::ResourceABC *, const QString &type,
00104                                  const QString &subResource );
00105 
00106 };
00107 
00108 }
00109 
00110 #endif // RESOURCEABC_H
KDE Home | KDE Accessibility Home | Description of Access Keys