Okular

view.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Pino Toscano <[email protected]>
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 
13 using namespace Okular;
14 
15 ViewPrivate::ViewPrivate()
16  : document(nullptr)
17 {
18 }
19 
20 ViewPrivate::~ViewPrivate()
21 {
22 }
23 
24 View::View(const QString &name)
25  : d_ptr(new ViewPrivate())
26 {
27  d_ptr->name = name;
28 }
29 
30 View::~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 
67 void View::setCapability(View::ViewCapability capability, const QVariant &option)
68 {
69  Q_UNUSED(capability)
70  Q_UNUSED(option)
71 }
The Document.
Definition: document.h:191
The documentation to the global Okular namespace.
Definition: action.h:16
virtual void setCapability(ViewCapability capability, const QVariant &option)
Sets a new value for the specified capability.
Definition: view.cpp:67
virtual QVariant capability(ViewCapability capability) const
Query the value of the specified capability.
Definition: view.cpp:61
virtual bool supportsCapability(ViewCapability capability) const
Query whether the view support the specified capability.
Definition: view.cpp:49
QString name() const
Return the name of this view.
Definition: view.cpp:44
QString & remove(int position, int n)
virtual CapabilityFlags capabilityFlags(ViewCapability capability) const
Query the flags for the specified capability.
Definition: view.cpp:55
View(const QString &name)
Construct a new view with the specified name.
Definition: view.cpp:24
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
ViewCapability
The capabilities of a view.
Definition: view.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:06:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.