Changeset View
Changeset View
Standalone View
Standalone View
karbon/ui/ProxyView.cpp
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 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 | #include "ProxyView.h" | ||||
21 | | ||||
22 | #include <KXMLGUIFactory> | ||||
23 | | ||||
24 | #include <QDebug> | ||||
25 | | ||||
26 | ProxyView::ProxyView(KoPart *karbonPart, KoDocument* doc, QWidget* parent) | ||||
27 | : KoView(karbonPart, doc, parent) | ||||
28 | { | ||||
29 | setObjectName("Karbon view helper"); | ||||
30 | } | ||||
31 | | ||||
32 | ProxyView::~ProxyView() | ||||
33 | { | ||||
34 | if (factory()) { | ||||
35 | factory()->removeClient(this); | ||||
36 | } | ||||
37 | } | ||||
38 | | ||||
39 | void ProxyView::updateReadWrite(bool readwrite) | ||||
40 | { | ||||
41 | view->updateReadWrite(readwrite); | ||||
42 | } | ||||
43 | | ||||
44 | KoZoomController *ProxyView::zoomController() const | ||||
45 | { | ||||
46 | return view->zoomController(); | ||||
47 | } | ||||
48 | | ||||
49 | KoPageLayout ProxyView::pageLayout() const | ||||
50 | { | ||||
51 | return view->pageLayout(); | ||||
52 | } | ||||
53 | | ||||
54 | void ProxyView::guiActivateEvent(bool activated) | ||||
55 | { | ||||
56 | if (activated) { | ||||
57 | factory()->addClient(view); | ||||
58 | } else { | ||||
59 | factory()->removeClient(view); | ||||
60 | } | ||||
61 | } | ||||
62 | | ||||
63 | QPrintDialog *ProxyView::createPrintDialog(KoPrintJob *printJob, QWidget *parent) | ||||
64 | { | ||||
65 | return view->createPrintDialog(printJob, parent); | ||||
66 | } | ||||
67 | | ||||
68 | KoPrintJob *ProxyView::createPrintJob() | ||||
69 | { | ||||
70 | return view->createPrintJob(); | ||||
71 | } | ||||
72 | | ||||
73 | KoPrintJob *ProxyView::createPdfPrintJob() | ||||
74 | { | ||||
75 | return view->createPdfPrintJob(); | ||||
76 | } |