Okular

view.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Pino Toscano <pino@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "view.h"
8#include "view_p.h"
9
10// local includes
11#include "document_p.h"
12
13using namespace Okular;
14
15ViewPrivate::ViewPrivate()
16 : document(nullptr)
17{
18}
19
20ViewPrivate::~ViewPrivate()
21{
22}
23
24View::View(const QString &name)
25 : d_ptr(new ViewPrivate())
26{
27 d_ptr->name = name;
28}
29
30View::~View()
31{
32 if (d_ptr->document) {
33 d_ptr->document->m_views.remove(this);
34 }
35
36 delete d_ptr;
37}
38
40{
41 return d_ptr->document ? d_ptr->document->m_parent : nullptr;
42}
43
45{
46 return d_ptr->name;
47}
48
50{
51 Q_UNUSED(capability)
52 return false;
53}
54
56{
57 Q_UNUSED(capability)
58 return NoFlag;
59}
60
62{
63 Q_UNUSED(capability)
64 return QVariant();
65}
66
67void View::setCapability(View::ViewCapability capability, const QVariant &option)
68{
69 Q_UNUSED(capability)
70 Q_UNUSED(option)
71}
The Document.
Definition document.h:192
virtual bool supportsCapability(ViewCapability capability) const
Query whether the view support the specified capability.
Definition view.cpp:49
virtual CapabilityFlags capabilityFlags(ViewCapability capability) const
Query the flags for the specified capability.
Definition view.cpp:55
virtual QVariant capability(ViewCapability capability) const
Query the value of the specified capability.
Definition view.cpp:61
virtual void setCapability(ViewCapability capability, const QVariant &option)
Sets a new value for the specified capability.
Definition view.cpp:67
ViewCapability
The capabilities of a view.
Definition view.h:40
Document * viewDocument() const
Return the document which this view is associated to, or null if it is not associated with any docume...
Definition view.cpp:39
QString name() const
Return the name of this view.
Definition view.cpp:44
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.