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

tdeabc

  • tdeabc
  • plugins
  • file
resourcefile.h
1 /*
2  This file is part of libtdeabc.
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 <tdeconfig.h>
25 #include <kdirwatch.h>
26 
27 #include <sys/types.h>
28 
29 #include <tdeabc/resource.h>
30 
31 namespace TDEABC {
32 
33 class FormatPlugin;
34 class ResourceConfigWidget;
35 class Lock;
36 
40 class KABC_EXPORT ResourceFile : public Resource
41 {
42  TQ_OBJECT
43 
44  public:
50  ResourceFile( const TDEConfig *cfg );
51 
55  ResourceFile( const TQString &fileName, const TQString &formatName = "vcard" );
56 
60  ~ResourceFile();
61 
65  virtual void writeConfig( TDEConfig *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
TDEABC::Addressee
address book entry
Definition: addressee.src.h:75
TDEABC::FormatPlugin
Base class for address book formats.
Definition: formatplugin.h:43
TDEABC::Lock
This class provides locking functionality for a file, directory or an arbitrary string-represented re...
Definition: lock.h:36
TDEABC::ResourceFile
This resource allows access to a local file.
Definition: resourcefile.h:41
TDEABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:38
TDEConfig
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48

tdeabc

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

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.1
This website is maintained by Timothy Pearson.