File indexing completed on 2024-04-28 16:24:40

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007 Fredy Yanardi <fyanardi@gmail.com>
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 KPTVIEWLISTDOCKER_H
0021 #define KPTVIEWLISTDOCKER_H
0022 
0023 #include <QDockWidget>
0024 #include <KoDockFactoryBase.h>
0025 
0026 namespace KPlato
0027 {
0028 
0029 class View;
0030 class ViewListWidget;
0031 
0032 class ViewListDocker : public QDockWidget
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     explicit ViewListDocker(View *view);
0038     ~ViewListDocker() override;
0039     View *view();
0040     void setView(View *view);
0041     ViewListWidget *viewList() const { return m_viewlist; }
0042 
0043 public Q_SLOTS:
0044     void slotModified();
0045     void updateWindowTitle(bool modified);
0046 
0047 private:
0048     View *m_view;
0049     ViewListWidget *m_viewlist;
0050 };
0051 
0052 class ViewListDockerFactory : public KoDockFactoryBase
0053 {
0054 public:
0055     explicit ViewListDockerFactory(View *view);
0056 
0057     QString id() const override;
0058     QDockWidget* createDockWidget() override;
0059     /// @return the dock widget area the widget should appear in by default
0060     KoDockFactoryBase::DockPosition defaultDockPosition() const override { return DockLeft; }
0061 
0062 private:
0063     View *m_view;
0064 };
0065 
0066 } //namespace KPlato
0067 
0068 #endif