Changeset View
Changeset View
Standalone View
Standalone View
karbon/ui/ProxyView.h
- This file was moved from karbon/ui/dockers/KarbonLayerSortingModel.h.
1 | /* This file is part of the KDE project | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2008-2009 Jan Hambrecht <jaham@gmx.net> | 2 | * Copyright (C) 2019 Dag Andersen <danders@get2net.dk> | ||
3 | * | 3 | * | ||
4 | * This library is free software; you can redistribute it and/or | 4 | * This library is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Library General Public | 5 | * modify it under the terms of the GNU Library General Public | ||
6 | * License as published by the Free Software Foundation; either | 6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2 of the License, or (at your option) any later version. | 7 | * version 2 of the License, or (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This library is distributed in the hope that it will be useful, | 9 | * This library is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Library General Public License for more details. | 12 | * Library General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public License | 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 | 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, | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KARBON_LAYER_SORTING_MODEL_H | 20 | #ifndef __PROXYVIEW_H__ | ||
21 | #define KARBON_LAYER_SORTING_MODEL_H | 21 | #define __PROXYVIEW_H__ | ||
22 | 22 | | |||
23 | #include <QSortFilterProxyModel> | 23 | #include <KoView.h> | ||
24 | #include <KoPageLayout.h> | ||||
24 | 25 | | |||
25 | class KarbonDocument; | 26 | class ProxyView : public KoView | ||
26 | | ||||
27 | class KarbonLayerSortingModel : public QSortFilterProxyModel | | |||
28 | { | 27 | { | ||
29 | Q_OBJECT | 28 | Q_OBJECT | ||
30 | public: | 29 | public: | ||
31 | explicit KarbonLayerSortingModel(QObject *parent); | 30 | ProxyView(KoPart *part, KoDocument* doc, QWidget* parent = 0); | ||
32 | /// Sets a new document to use for sorting | 31 | ~ProxyView() Q_DECL_OVERRIDE; | ||
33 | void setDocument(KarbonDocument * newDocument); | 32 | | ||
34 | protected: | 33 | virtual void updateReadWrite(bool readwrite) Q_DECL_OVERRIDE; | ||
35 | virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; | 34 | virtual KoZoomController *zoomController() const Q_DECL_OVERRIDE; | ||
35 | virtual KoPageLayout pageLayout() const Q_DECL_OVERRIDE; | ||||
36 | virtual void guiActivateEvent(bool activated) Q_DECL_OVERRIDE; | ||||
37 | | ||||
38 | virtual QPrintDialog *createPrintDialog(KoPrintJob *printJob, QWidget *parent) Q_DECL_OVERRIDE; | ||||
39 | virtual KoPrintJob *createPrintJob() Q_DECL_OVERRIDE; | ||||
40 | virtual KoPrintJob *createPdfPrintJob() Q_DECL_OVERRIDE; | ||||
41 | | ||||
36 | private: | 42 | private: | ||
37 | KarbonDocument *m_document; ///< the underlying data structure | 43 | friend class KarbonPart; | ||
44 | KoView *view; | ||||
38 | }; | 45 | }; | ||
39 | 46 | | |||
40 | #endif // KARBON_LAYER_SORTING_MODEL_H | 47 | #endif | ||
48 | |