-rw-r--r-- | kabc/formatplugin.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/kabc/formatplugin.h b/kabc/formatplugin.h new file mode 100644 index 0000000..d784daf --- a/dev/null +++ b/kabc/formatplugin.h | |||
@@ -0,0 +1,81 @@ | |||
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., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | Enhanced Version of the file for platform independent KDE tools. | ||
23 | Copyright (c) 2004 Ulf Schenk | ||
24 | |||
25 | $Id$ | ||
26 | */ | ||
27 | |||
28 | #ifndef KABC_FORMATPLUGIN_H | ||
29 | #define KABC_FORMATPLUGIN_H | ||
30 | |||
31 | #include <qfile.h> | ||
32 | |||
33 | //US #include "plugin.h" | ||
34 | #include "resource.h" | ||
35 | |||
36 | namespace KABC { | ||
37 | |||
38 | class AddressBook; | ||
39 | class Addressee; | ||
40 | |||
41 | /** | ||
42 | * @short Base class for address book formats. | ||
43 | * | ||
44 | * This class provides an abstract interface for ResourceFile and | ||
45 | * ResourceDir formats. | ||
46 | * | ||
47 | * @internal | ||
48 | */ | ||
49 | //US class FormatPlugin : public Plugin | ||
50 | class FormatPlugin | ||
51 | { | ||
52 | public: | ||
53 | |||
54 | /** | ||
55 | * Load single addressee from file. | ||
56 | */ | ||
57 | virtual bool load( Addressee &, QFile *file ) = 0; | ||
58 | |||
59 | /** | ||
60 | * Load whole addressbook from file. | ||
61 | */ | ||
62 | virtual bool loadAll( AddressBook *, Resource *, QFile *file ) = 0; | ||
63 | |||
64 | /** | ||
65 | * Save a single Addressee to file. | ||
66 | */ | ||
67 | virtual void save( const Addressee &, QFile *file ) = 0; | ||
68 | |||
69 | /** | ||
70 | * Save whole addressbook to file. | ||
71 | */ | ||
72 | virtual void saveAll( AddressBook *, Resource *, QFile *file ) = 0; | ||
73 | |||
74 | /** | ||
75 | * Checks if given file contains the right format | ||
76 | */ | ||
77 | virtual bool checkFormat( QFile *file ) const = 0; | ||
78 | }; | ||
79 | |||
80 | } | ||
81 | #endif | ||