# kabc Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# resource.h

    00001 /*
    00002     This file is part of libkabc.
    00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public License
    00016     along with this library; see the file COPYING.LIB.  If not, write to
    00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018     Boston, MA 02111-1307, USA.
    00019 */
    00020
    00021 #ifndef KABC_RESOURCE_H
    00022 #define KABC_RESOURCE_H
    00023
    00024 #include "addressbook.h"
    00025 #include "plugin.h"
    00026
    00027 namespace KABC {
    00028
    00035 class Ticket
    00036 {
    00037     friend class Resource;
    00038   public:
    00039     Resource *resource() { return mResource; }
    00040
    00041   private:
    00042     Ticket( Resource *resource ) : mResource( resource ) {}
    00043
    00044     Resource *mResource;
    00045 };
    00046
    00050 class Resource : public Plugin
    00051 {
    00052 public:
    00056   Resource( AddressBook *ab );
    00057
    00061   virtual ~Resource();
    00062
    00066   virtual bool open();
    00067
    00071   virtual void close();
    00072
    00077   virtual Ticket *requestSaveTicket();
    00078
    00082   virtual bool load();
    00083
    00089   virtual bool save( Ticket *ticket );
    00090
    00094   AddressBook *addressBook() { return mAddressBook; }
    00095
    00099   virtual QString identifier() const;
    00100
    00105   virtual void removeAddressee( const Addressee& addr );
    00106
    00111   virtual void cleanUp();
    00112
    00116   virtual void setReadOnly( bool value );
    00117
    00121   virtual bool readOnly() const;
    00122
    00127   virtual void setFastResource( bool value );
    00128
    00132   virtual bool fastResource() const;
    00133
    00137   virtual void setName( const QString &name );
    00138
    00142   virtual QString name() const;
    00143
    00148   static QString cryptStr( const QString & );
    00149
    00150 protected:
    00151   Ticket *createTicket( Resource * );
    00152
    00153 private:
    00154   AddressBook *mAddressBook;
    00155   bool mReadOnly;
    00156   bool mFastResource;
    00157   QString mName;
    00158 };
    00159
    00160 }
    00161 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:29:21 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001