File indexing completed on 2024-04-28 16:24:37
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2009 Dag Andersen <danders@get2net.dk> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Library General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Library General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef KPTSCHEDULESDOCKER_H 0021 #define KPTSCHEDULESDOCKER_H 0022 0023 #include <QDockWidget> 0024 #include <KoDockFactoryBase.h> 0025 0026 #include "kptschedulemodel.h" 0027 0028 #include <QSortFilterProxyModel> 0029 0030 class QTreeView; 0031 0032 namespace KPlato 0033 { 0034 0035 class Project; 0036 class ScheduleManager; 0037 0038 class SchedulesDocker : public QDockWidget 0039 { 0040 Q_OBJECT 0041 public: 0042 explicit SchedulesDocker(); 0043 ~SchedulesDocker() override; 0044 0045 ScheduleManager *selectedSchedule() const; 0046 0047 Q_SIGNALS: 0048 void selectionChanged(KPlato::ScheduleManager *sm); 0049 0050 public Q_SLOTS: 0051 void setProject(KPlato::Project *project); 0052 void setSelectedSchedule(KPlato::ScheduleManager *sm); 0053 0054 protected Q_SLOTS: 0055 void slotSelectionChanged(); 0056 0057 private: 0058 QTreeView *m_view; 0059 QSortFilterProxyModel m_sfModel; 0060 ScheduleItemModel m_model; 0061 }; 0062 0063 class SchedulesDockerFactory : public KoDockFactoryBase 0064 { 0065 public: 0066 SchedulesDockerFactory(); 0067 0068 QString id() const override; 0069 QDockWidget* createDockWidget() override; 0070 /// @return the dock widget area the widget should appear in by default 0071 KoDockFactoryBase::DockPosition defaultDockPosition() const override { return DockLeft; } 0072 0073 }; 0074 0075 } //namespace KPlato 0076 0077 #endif