summaryrefslogtreecommitdiffabout
path: root/libkcal/freebusy.h
Unidiff
Diffstat (limited to 'libkcal/freebusy.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/freebusy.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/libkcal/freebusy.h b/libkcal/freebusy.h
new file mode 100644
index 0000000..054feda
--- a/dev/null
+++ b/libkcal/freebusy.h
@@ -0,0 +1,72 @@
1/*
2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@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#ifndef KCAL_FREEBUSY_H
21#define KCAL_FREEBUSY_H
22//
23// FreeBusy - information about free/busy times
24//
25
26#include <qdatetime.h>
27#include <qvaluelist.h>
28#include <qptrlist.h>
29
30#include "period.h"
31#include "calendar.h"
32
33#include "incidencebase.h"
34
35namespace KCal {
36
37/**
38 This class provides information about free/busy time of a calendar user.
39*/
40class FreeBusy : public IncidenceBase
41{
42 public:
43 FreeBusy();
44 FreeBusy(const QDateTime &start, const QDateTime &end);
45 FreeBusy(Calendar *calendar, const QDateTime &start, const QDateTime &end);
46 FreeBusy(QValueList<Period> busyPeriods);
47
48 ~FreeBusy();
49
50 QCString type() const { return "FreeBusy"; }
51
52 virtual QDateTime dtEnd() const;
53 bool setDtEnd( const QDateTime &end );
54
55 QValueList<Period> busyPeriods() const;
56
57 void addPeriod(const QDateTime &start, const QDateTime &end);
58 void sortList();
59
60 private:
61
62 //This is used for creating a freebusy object for the current user
63 bool addLocalPeriod(const QDateTime &start, const QDateTime &end);
64
65 QDateTime mDtEnd;
66 QValueList<Period> mBusyPeriods;
67 Calendar *mCalendar;
68};
69
70}
71
72#endif