1 | /* |
2 | This file is part of the kcal library. |
3 | |
4 | Copyright (c) 2002,2003 Cornelius Schumacher <schumacher@kde.org> |
5 | |
6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. |
20 | */ |
21 | /** |
22 | @file |
23 | This file is part of the API for handling calendar data and |
24 | defines the CalStorage abstract base class. |
25 | |
26 | @author Cornelius Schumacher \<schumacher@kde.org\> |
27 | */ |
28 | |
29 | #ifndef KCAL_CALSTORAGE_H |
30 | #define KCAL_CALSTORAGE_H |
31 | |
32 | #include "kcal_export.h" |
33 | #include <qglobal.h> |
34 | |
35 | namespace KCal { |
36 | |
37 | class Calendar; |
38 | |
39 | /** |
40 | @brief |
41 | An abstract base class that provides a calendar storage interface. |
42 | |
43 | This is the base class for calendar storage. It provides an interface for the |
44 | loading and saving of calendars. |
45 | */ |
46 | class KCAL_DEPRECATED_EXPORT CalStorage |
47 | { |
48 | public: |
49 | /** |
50 | Construcst a new storage object for a calendar. |
51 | @param calendar is a pointer to a valid Calendar object. |
52 | */ |
53 | explicit CalStorage( Calendar *calendar ); |
54 | |
55 | /** |
56 | Destuctor. |
57 | */ |
58 | virtual ~CalStorage(); |
59 | |
60 | /** |
61 | Returns a pointer to the calendar whose storage is being managed. |
62 | */ |
63 | Calendar *calendar() const; |
64 | |
65 | /** |
66 | Opens the calendar for storage. |
67 | @return true if the open was successful; false otherwise. |
68 | */ |
69 | virtual bool open() = 0; |
70 | |
71 | /** |
72 | Loads the calendar into memory. |
73 | @return true if the load was successful; false otherwise. |
74 | */ |
75 | virtual bool load() = 0; |
76 | |
77 | /** |
78 | Saves the calendar. |
79 | @return true if the save was successful; false otherwise. |
80 | */ |
81 | virtual bool save() = 0; |
82 | |
83 | /** |
84 | Closes the calendar storage. |
85 | @return true if the close was successful; false otherwise. |
86 | */ |
87 | virtual bool close() = 0; |
88 | |
89 | private: |
90 | //@cond PRIVATE |
91 | Q_DISABLE_COPY( CalStorage ) |
92 | class Private; |
93 | Private *const d; |
94 | //@endcond |
95 | }; |
96 | |
97 | } |
98 | |
99 | #endif |
100 | |