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

kabc

  • kabc
  • plugins
  • net
resourcenet.h
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2003 Tobias Koenig <tokoe@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_RESOURCENET_H
22 #define KABC_RESOURCENET_H
23 
24 #include <kconfig.h>
25 
26 #include <sys/types.h>
27 
28 #include <kabc/resource.h>
29 
30 class TQFile;
31 class TQTimer;
32 class KTempFile;
33 
34 namespace KIO {
35 class Job;
36 }
37 
38 namespace KABC {
39 
40 class FormatPlugin;
41 
45 class KABC_EXPORT ResourceNet : public Resource
46 {
47  Q_OBJECT
48 
49  public:
50  ResourceNet( const KConfig* );
51  ResourceNet( const KURL &url, const TQString &format );
52  ~ResourceNet();
53 
54  virtual void writeConfig( KConfig* );
55 
56  virtual bool doOpen();
57  virtual void doClose();
58 
59  virtual Ticket *requestSaveTicket();
60  virtual void releaseSaveTicket( Ticket* );
61 
62  virtual bool load();
63  virtual bool asyncLoad();
64  virtual bool save( Ticket* ticket );
65  virtual bool asyncSave( Ticket* ticket );
66 
70  void setUrl( const KURL & );
71 
75  KURL url() const;
76 
80  void setFormat( const TQString &name );
81 
85  TQString format() const;
86 
87  protected:
88  void init( const KURL &url, const TQString &format );
89 
90  private slots:
91  void downloadFinished( KIO::Job* );
92  void uploadFinished( KIO::Job* );
93  void signalError();
94 
95  private:
96  bool clearAndLoad( TQFile *file );
97  void saveToFile( TQFile *file );
98  bool hasTempFile() const { return mTempFile != 0; }
99  void abortAsyncLoading();
100  void abortAsyncSaving();
101  bool createLocalTempFile();
102  void deleteLocalTempFile();
103  void deleteStaleTempFile();
104 
105  FormatPlugin *mFormat;
106  TQString mFormatName;
107 
108  KURL mUrl;
109  KTempFile *mTempFile;
110 
111  class ResourceNetPrivate;
112  ResourceNetPrivate *d;
113 };
114 
115 }
116 
117 #endif
KURL
KStdAccel::save
const KShortcut & save()
KTempFile
KConfig

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.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |