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

kabc

  • sources
  • kde-4.12
  • kdepimlibs
  • 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_net_export.h"
25 
26 #include "kabc/resource.h"
27 #include <sys/types.h>
28 
29 class QFile;
30 class KTemporaryFile;
31 
32 class KJob;
33 
34 namespace KABC {
35 
36 class Format;
37 
41 class KABC_NET_EXPORT ResourceNet : public Resource
42 {
43  Q_OBJECT
44 
45  public:
46  ResourceNet();
47  explicit ResourceNet( const KConfigGroup &group );
48  ResourceNet( const KUrl &url, const QString &format );
49  ~ResourceNet();
50 
51  virtual void writeConfig( KConfigGroup &group );
52 
53  virtual bool doOpen();
54  virtual void doClose();
55 
56  virtual Ticket *requestSaveTicket();
57  virtual void releaseSaveTicket( Ticket *ticket );
58 
59  virtual bool load();
60  virtual bool asyncLoad();
61  virtual bool save( Ticket *ticket );
62  virtual bool asyncSave( Ticket *ticket );
63 
67  void setUrl( const KUrl &url );
68 
72  KUrl url() const;
73 
77  void setFormat( const QString &name );
78 
82  QString format() const;
83 
84  protected:
85  void init( const KUrl &url, const QString &format );
86 
87  private Q_SLOTS:
88  void downloadFinished( KJob *job );
89  void uploadFinished( KJob *job );
90 
91  private:
92  bool clearAndLoad( QFile *file );
93  void saveToFile( QFile *file );
94  bool hasTempFile() const { return mTempFile != 0; }
95  void abortAsyncLoading();
96  void abortAsyncSaving();
97  bool createLocalTempFile();
98  void deleteLocalTempFile();
99  void deleteStaleTempFile();
100 
101  Format *mFormat;
102  QString mFormatName;
103 
104  KUrl mUrl;
105  KTemporaryFile *mTempFile;
106 
107  class ResourceNetPrivate;
108  ResourceNetPrivate *d;
109 };
110 
111 }
112 
113 #endif
KABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:37
KABC::Resource
Definition: resource.h:64
KABC::ResourceNet
Definition: resourcenet.h:41
KABC::Format
Base class for address book formats.
Definition: format.h:42
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:05 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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