Diffstat (limited to 'kabc/formats/binary/binaryformat.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/formats/binary/binaryformat.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/kabc/formats/binary/binaryformat.h b/kabc/formats/binary/binaryformat.h new file mode 100644 index 0000000..415fd3b --- a/dev/null +++ b/kabc/formats/binary/binaryformat.h | |||
@@ -0,0 +1,76 @@ | |||
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 | Enhanced Version of the file for platform independent KDE tools. | ||
22 | Copyright (c) 2004 Ulf Schenk | ||
23 | |||
24 | $Id$ | ||
25 | */ | ||
26 | |||
27 | #ifndef KABC_BINARYFORMAT_H | ||
28 | #define KABC_BINARYFORMAT_H | ||
29 | |||
30 | #include "formatplugin.h" | ||
31 | |||
32 | namespace KABC { | ||
33 | |||
34 | class AddressBook; | ||
35 | class Addressee; | ||
36 | |||
37 | /** | ||
38 | @short binary file format for addressbook entries. | ||
39 | */ | ||
40 | class BinaryFormat : public FormatPlugin | ||
41 | { | ||
42 | public: | ||
43 | /** | ||
44 | * Load single addressee from file. | ||
45 | */ | ||
46 | bool load( Addressee &, QFile *file ); | ||
47 | |||
48 | /** | ||
49 | * Load whole addressee from file. | ||
50 | */ | ||
51 | bool loadAll( AddressBook *, Resource *, QFile *file ); | ||
52 | |||
53 | /** | ||
54 | * Save single addressee to file. | ||
55 | */ | ||
56 | void save( const Addressee &, QFile *file ); | ||
57 | |||
58 | /** | ||
59 | * Save all addressees to file. | ||
60 | */ | ||
61 | void saveAll( AddressBook *, Resource *, QFile *file ); | ||
62 | |||
63 | /** | ||
64 | * Check for valid format of a file. | ||
65 | */ | ||
66 | bool checkFormat( QFile *file ) const; | ||
67 | |||
68 | private: | ||
69 | void loadAddressee( Addressee &, QDataStream & ); | ||
70 | void saveAddressee( const Addressee &, QDataStream & ); | ||
71 | bool checkHeader( QDataStream & ) const; | ||
72 | void writeHeader( QDataStream & ); | ||
73 | }; | ||
74 | |||
75 | } | ||
76 | #endif | ||