• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kresources

managerimpl.h

00001 /*
00002     This file is part of libkresources.
00003 
00004     Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
00005     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
00006     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022 */
00023 #ifndef KRESOURCES_MANAGERIMPL_H
00024 #define KRESOURCES_MANAGERIMPL_H
00025 
00026 #include <QtCore/QString>
00027 
00028 #include "resource.h"
00029 
00030 class KConfig;
00031 
00032 namespace KRES {
00033 
00034 class Resource;
00035 class ManagerNotifier;
00036 
00042 class KRESOURCES_EXPORT ManagerImpl : public QObject
00043 {
00044     Q_OBJECT
00045   public:
00046     ManagerImpl( ManagerNotifier *, const QString &family );
00047     ~ManagerImpl();
00048 
00049     void readConfig( KConfig * );
00050     void writeConfig( KConfig * );
00051 
00052     void add( Resource *resource );
00053     void remove( Resource *resource );
00054     void change( Resource *resource );
00055 
00056     Resource *standardResource();
00057     void setStandardResource( Resource *resource );
00058 
00059     void setActive( Resource *resource, bool active );
00060 
00061     Resource::List *resourceList();
00062 
00063     QList<Resource *> resources();
00064 
00065     // Get only active or passive resources
00066     QList<Resource *> resources( bool active );
00067 
00068     QStringList resourceNames();
00069 
00070     static QString defaultConfigFile( const QString &family );
00071 
00072   Q_SIGNALS:
00073     void signalKResourceAdded( QString managerId, QString resourceId );
00074     void signalKResourceModified( QString managerId, QString resourceId );
00075     void signalKResourceDeleted( QString managerId, QString resourceId );
00076 
00077   private Q_SLOTS:
00078     // dbus calls
00079     void dbusKResourceAdded( const QString& managerId,
00080                              const QString& resourceId );
00081     void dbusKResourceModified( const QString& managerId,
00082                                 const QString& resourceId );
00083     void dbusKResourceDeleted( const QString& managerId,
00084                                const QString& resourceId );
00085 
00086   private:
00087     void createStandardConfig();
00088 
00089     Resource *readResourceConfig( const QString& identifier, bool checkActive );
00090     void writeResourceConfig( Resource *resource, bool checkActive );
00091 
00092     void removeResource( Resource *resource );
00093     Resource *getResource( Resource *resource );
00094     Resource *getResource( const QString& identifier );
00095 
00096     class ManagerImplPrivate;
00097     ManagerImplPrivate *const d;
00098 };
00099 
00100 }
00101 
00102 #endif

kresources

Skip menu "kresources"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal