1/* This file is part of the KDE project
2 * Copyright (C) 2009 Dag Andersen <danders@get2net.dk>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef KPTSCHEDULESDOCKER_H
21#define KPTSCHEDULESDOCKER_H
22
23#include <QDockWidget>
24#include <KoDockFactoryBase.h>
25
26#include "kptschedulemodel.h"
27
28#include <QSortFilterProxyModel>
29
30class QItemSelection;
31class QTreeView;
32
33namespace KPlato
34{
35
36class Project;
37class ScheduleManager;
38
39class SchedulesDocker : public QDockWidget
40{
41 Q_OBJECT
42public:
43 explicit SchedulesDocker();
44 ~SchedulesDocker();
45
46 ScheduleManager *selectedSchedule() const;
47
48signals:
49 void selectionChanged( ScheduleManager *sm );
50
51public slots:
52 void setProject( Project *project );
53 void setSelectedSchedule( ScheduleManager *sm );
54
55protected slots:
56 void slotSelectionChanged();
57
58private:
59 QTreeView *m_view;
60 QSortFilterProxyModel m_sfModel;
61 ScheduleItemModel m_model;
62};
63
64class SchedulesDockerFactory : public KoDockFactoryBase
65{
66public:
67 SchedulesDockerFactory();
68
69 virtual QString id() const;
70 virtual QDockWidget* createDockWidget();
71 /// @return the dock widget area the widget should appear in by default
72 virtual KoDockFactoryBase::DockPosition defaultDockPosition() const { return DockLeft; }
73
74};
75
76} //namespace KPlato
77
78#endif
79