• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

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 "kabc/resource.h"
25 #include <sys/types.h>
26 
27 class QFile;
28 class KTemporaryFile;
29 
30 class KJob;
31 
32 namespace KABC {
33 
34 class Format;
35 
39 class KABC_NET_EXPORT ResourceNet : public Resource
40 {
41  Q_OBJECT
42 
43  public:
44  ResourceNet();
45  explicit ResourceNet( const KConfigGroup &group );
46  ResourceNet( const KUrl &url, const QString &format );
47  ~ResourceNet();
48 
49  virtual void writeConfig( KConfigGroup &group );
50 
51  virtual bool doOpen();
52  virtual void doClose();
53 
54  virtual Ticket *requestSaveTicket();
55  virtual void releaseSaveTicket( Ticket *ticket );
56 
57  virtual bool load();
58  virtual bool asyncLoad();
59  virtual bool save( Ticket *ticket );
60  virtual bool asyncSave( Ticket *ticket );
61 
65  void setUrl( const KUrl &url );
66 
70  KUrl url() const;
71 
75  void setFormat( const QString &name );
76 
80  QString format() const;
81 
82  protected:
83  void init( const KUrl &url, const QString &format );
84 
85  private Q_SLOTS:
86  void downloadFinished( KJob *job );
87  void uploadFinished( KJob *job );
88 
89  private:
90  bool clearAndLoad( QFile *file );
91  void saveToFile( QFile *file );
92  bool hasTempFile() const { return mTempFile != 0; }
93  void abortAsyncLoading();
94  void abortAsyncSaving();
95  bool createLocalTempFile();
96  void deleteLocalTempFile();
97  void deleteStaleTempFile();
98 
99  Format *mFormat;
100  QString mFormatName;
101 
102  KUrl mUrl;
103  KTemporaryFile *mTempFile;
104 
105  class ResourceNetPrivate;
106  ResourceNetPrivate *d;
107 };
108 
109 }
110 
111 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:29:42 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

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

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal