• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kabc
 

kabc

  • kabc
  • plugins
  • file
resourcefile.h
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KABC_RESOURCEFILE_H
22 #define KABC_RESOURCEFILE_H
23 
24 #include <kconfig.h>
25 #include <kdirwatch.h>
26 
27 #include <sys/types.h>
28 
29 #include <kabc/resource.h>
30 
31 namespace KABC {
32 
33 class FormatPlugin;
34 class ResourceConfigWidget;
35 class Lock;
36 
40 class KABC_EXPORT ResourceFile : public Resource
41 {
42  Q_OBJECT
43 
44  public:
50  ResourceFile( const KConfig *cfg );
51 
55  ResourceFile( const TQString &fileName, const TQString &formatName = "vcard" );
56 
60  ~ResourceFile();
61 
65  virtual void writeConfig( KConfig *cfg );
66 
71  virtual bool doOpen();
72 
76  virtual void doClose();
77 
81  virtual Ticket *requestSaveTicket();
82 
83  virtual void releaseSaveTicket( Ticket* );
84 
89  virtual bool load();
90 
91  virtual bool asyncLoad();
92 
99  virtual bool save( Ticket *ticket );
100 
101  virtual bool asyncSave( Ticket *ticket );
102 
106  void setFileName( const TQString & );
107 
111  TQString fileName() const;
112 
116  void setFormat( const TQString &name );
117 
121  TQString format() const;
122 
127  virtual void removeAddressee( const Addressee& addr );
128 
129  private slots:
130  void emitLoadingFinished();
131  void emitLoadingError();
132  void emitSavingFinished();
133  void emitSavingError();
134 
135  protected slots:
136  void fileChanged();
137 
138  protected:
139  void init( const TQString &fileName, const TQString &format );
140 
141  bool lock( const TQString &fileName );
142  void unlock( const TQString &fileName );
143 
144  private:
145  TQString mFileName;
146  TQString mFormatName;
147 
148  FormatPlugin *mFormat;
149 
150  Lock *mLock;
151 
152  KDirWatch mDirWatch;
153 
154  bool mAsynchronous;
155 
156  class ResourceFilePrivate;
157  ResourceFilePrivate *d;
158 };
159 
160 }
161 
162 #endif
KABC::Lock
This class provides locking functionality for a file, directory or an arbitrary string-represented re...
Definition: lock.h:35
KABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:37
KABC::Addressee
address book entry
Definition: addressee.src.h:74
KConfig
KABC::FormatPlugin
Base class for address book formats.
Definition: formatplugin.h:42
KABC
static data, shared by ALL addressee objects
Definition: address.h:48
KABC::ResourceFile
This resource allows access to a local file.
Definition: resourcefile.h:40

kabc

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

kabc

Skip menu "kabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kabc by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |