summaryrefslogtreecommitdiff
path: root/core/pim/datebook2/bookmanager.h
blob: 44ad8edc11a98c014312a7f0d56df6be9da5a831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef OPIE_DATE_BOOK_MANAGER_H
#define OPIE_DATE_BOOK_MANAGER_H

#include <qlist.h>

#include <opie/opimrecord.h>
#include <opie/odatebookaccess.h>

namespace Datebook {
    /**
     * book manager is responsible for managing the
     * access
     * All access to the underlying API will be done
     * through this class
     */
    class BookManager {
    public:
        BookManager();
        ~BookManager();

        bool isLoaded()const;
        bool load();
        bool save();

        OEvent event( int uid );
        OEffectiveEvent::ValueList list( const QDate& from,
                                         const QDate& to );
        ODateBookAccess::List allRecords()const;

        void add( const OEvent& );
        void update( const OEvent& );
        void remove( int uid );
        void remove( const QArray<int>& );

        QPtrList<OPimRecord> records( const QDate& from,
                                      const QDate& to );
    };
}

#endif