1/*
2 This file is part of libkabc.
3 Copyright (c) 2002 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_FORMAT_H
22#define KABC_FORMAT_H
23
24#include <QtCore/QFile>
25
26#include "plugin.h"
27#include "resource.h"
28
29namespace KABC {
30
31class AddressBook;
32class Addressee;
33
34/**
35 * @short Base class for address book formats.
36 *
37 * This class provides an abstract interface for ResourceFile and
38 * ResourceDir formats.
39 *
40 * @internal
41 */
42class KABC_DEPRECATED_EXPORT Format : public Plugin
43{
44 public:
45
46 /**
47 * Load single addressee from file.
48 */
49 virtual bool load( Addressee &, QFile *file ) = 0;
50
51 /**
52 * Load whole addressbook from file.
53 */
54 virtual bool loadAll( AddressBook *, Resource *, QFile *file ) = 0;
55
56 /**
57 * Save a single Addressee to file.
58 */
59 virtual void save( const Addressee &, QFile *file ) = 0;
60
61 /**
62 * Save whole addressbook to file.
63 */
64 virtual void saveAll( AddressBook *, Resource *, QFile *file ) = 0;
65
66 /**
67 * Checks if given file contains the right format
68 */
69 virtual bool checkFormat( QFile *file ) const = 0;
70};
71
72}
73#endif
74