visualfreebusywidget.h 2.2 KB
Newer Older
Sergio Luis Martins's avatar
Sergio Luis Martins committed
1
/*
Allen Winter's avatar
Allen Winter committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com>
  Copyright (C) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>

  This library is free software; you can redistribute it and/or modify it
  under the terms of the GNU Library General Public License as published by
  the Free Software Foundation; either version 2 of the License, or (at your
  option) any later version.

  This library is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
  License for more details.

  You should have received a copy of the GNU Library General Public License
  along with this library; see the file COPYING.LIB.  If not, write to the
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.
Sergio Luis Martins's avatar
Sergio Luis Martins committed
19 20
*/

Allen Winter's avatar
Allen Winter committed
21 22
#ifndef INCIDENCEEDITOR_VISUALFREEBUSYWIDGET_H
#define INCIDENCEEDITOR_VISUALFREEBUSYWIDGET_H
Sergio Luis Martins's avatar
Sergio Luis Martins committed
23 24 25 26 27

#include <KDateTime>

#include <QWidget>

Laurent Montel's avatar
Laurent Montel committed
28 29 30 31
namespace KDGantt
{
class DateTimeGrid;
class GraphicsView;
Sergio Luis Martins's avatar
Sergio Luis Martins committed
32 33
}

34 35 36 37
namespace KPIM
{
class FreeBusyItemModel;
}
38

39
class KComboBox;
40 41
class QTreeView;

Laurent Montel's avatar
Laurent Montel committed
42 43
namespace IncidenceEditorNG
{
Sergio Luis Martins's avatar
Sergio Luis Martins committed
44

45
class FreeBusyGanttProxyModel;
46
class RowController;
Sergio Luis Martins's avatar
Sergio Luis Martins committed
47

48
class VisualFreeBusyWidget : public QWidget
Sergio Luis Martins's avatar
Sergio Luis Martins committed
49
{
Laurent Montel's avatar
Laurent Montel committed
50 51
    Q_OBJECT
public:
52
    explicit VisualFreeBusyWidget(KPIM::FreeBusyItemModel *model, int spacing = 8, QWidget *parent = Q_NULLPTR);
Sergio Luis Martins's avatar
Sergio Luis Martins committed
53 54
    ~VisualFreeBusyWidget();

Laurent Montel's avatar
Laurent Montel committed
55
public Q_SLOTS:
Laurent Montel's avatar
Laurent Montel committed
56
    void slotUpdateIncidenceStartEnd(const KDateTime &, const KDateTime &);
57

Laurent Montel's avatar
Laurent Montel committed
58
Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
59
    void dateTimesChanged(const KDateTime &, const KDateTime &);
60
    void manualReload();
Casey Link's avatar
Casey Link committed
61

Laurent Montel's avatar
Laurent Montel committed
62
protected Q_SLOTS:
Laurent Montel's avatar
Laurent Montel committed
63
    void slotScaleChanged(int);
Sergio Luis Martins's avatar
Sergio Luis Martins committed
64 65 66 67
    void slotCenterOnStart() ;
    void slotZoomToTime();
    void slotPickDate();
    void showAttendeeStatusMenu();
Laurent Montel's avatar
Laurent Montel committed
68
    void slotIntervalColorRectangleMoved(const KDateTime &start, const KDateTime &end);
Sergio Luis Martins's avatar
Sergio Luis Martins committed
69

Laurent Montel's avatar
Laurent Montel committed
70
private Q_SLOTS:
Sergio Luis Martins's avatar
Sergio Luis Martins committed
71 72
    void splitterMoved();

Laurent Montel's avatar
Laurent Montel committed
73
private:
74 75
    KDGantt::GraphicsView *mGanttGraphicsView;
    QTreeView *mLeftView;
Sergio Luis Martins's avatar
Sergio Luis Martins committed
76 77 78
    RowController *mRowController;
    KDGantt::DateTimeGrid *mGanttGrid;
    KComboBox *mScaleCombo;
79
    FreeBusyGanttProxyModel *mModel;
Sergio Luis Martins's avatar
Sergio Luis Martins committed
80 81 82 83 84

    KDateTime mDtStart, mDtEnd;
};

}
Allen Winter's avatar
Allen Winter committed
85
#endif