~indicator-applet-developers/indicator-datetime/trunk.14.04

« back to all changes in this revision

Viewing changes to include/datetime/planner-upcoming.h

  • Committer: CI bot
  • Author(s): Charles Kerr
  • Date: 2014-03-14 17:37:00 UTC
  • mfrom: (312.5.9 upcoming-calendar-events)
  • Revision ID: ps-jenkins@lists.canonical.com-20140314173700-4bicnok0bp2efaa0
When the user clicks on a date in the calendar, update the "Upcoming Events" section to show events starting at that date. Fixes: 1290169, 1290171, 1291468

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2014 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 *   Charles Kerr <charles.kerr@canonical.com>
 
18
 */
 
19
 
 
20
#ifndef INDICATOR_DATETIME_PLANNER_UPCOMING_H
 
21
#define INDICATOR_DATETIME_PLANNER_UPCOMING_H
 
22
 
 
23
#include <datetime/planner.h>
 
24
 
 
25
#include <datetime/date-time.h>
 
26
#include <datetime/planner-range.h>
 
27
 
 
28
#include <memory> // std::shared_ptr
 
29
 
 
30
namespace unity {
 
31
namespace indicator {
 
32
namespace datetime {
 
33
 
 
34
/**
 
35
 * \brief A collection of upcoming appointments starting from the specified date
 
36
 */
 
37
class UpcomingPlanner: public Planner
 
38
{
 
39
public:
 
40
    UpcomingPlanner(const std::shared_ptr<RangePlanner>& range_planner,
 
41
                    const DateTime& date);
 
42
    ~UpcomingPlanner() =default;
 
43
 
 
44
    core::Property<std::vector<Appointment>>& appointments();
 
45
    core::Property<DateTime>& date();
 
46
 
 
47
private:
 
48
    std::shared_ptr<RangePlanner> m_range_planner;
 
49
    core::Property<DateTime> m_date;
 
50
};
 
51
 
 
52
} // namespace datetime
 
53
} // namespace indicator
 
54
} // namespace unity
 
55
 
 
56
#endif // INDICATOR_DATETIME_PLANNER_UPCOMING_H