Okular

viewerinterface.h
1/*
2 SPDX-FileCopyrightText: 2011 Michel Ludwig <michel.ludwig@kdemail.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef _OKULAR_VIEWERINTERFACE_H_
8#define _OKULAR_VIEWERINTERFACE_H_
9
10#include "../core/okularcore_export.h"
11#ifdef Q_OS_WIN
12#define VIEWERINTERFACE_EXPORT __declspec(dllexport)
13#else
14#define VIEWERINTERFACE_EXPORT OKULARCORE_EXPORT
15#endif
16
17#include <QObject>
18#include <QString>
19
20namespace Okular
21{
22/**
23 * @short Abstract interface for controlling advanced features of a document viewer
24 *
25 * This interface can be used to control some more or less advanced features of a document
26 * viewer.
27 */
28class VIEWERINTERFACE_EXPORT ViewerInterface
29{
30public:
32 {
33 }
34 virtual ~ViewerInterface()
35 {
36 }
37
38 ViewerInterface(const ViewerInterface &) = delete;
39 ViewerInterface &operator=(const ViewerInterface &) = delete;
40
41 /**
42 * Show the specified source location centrally in the viewer.
43 *
44 * @param fileName source file name
45 * @param line in the source file, starts from 0
46 * @param column in the source file, starts from 0
47 * @param showGraphically controls whether the given source location will be
48 * shown graphically in the viewer (if that feature is globally activated)
49 */
50 virtual void showSourceLocation(const QString &fileName, int line, int column, bool showGraphically = true) = 0;
51
52 /**
53 * Clear the source location that was set last in the viewer.
54 */
55 virtual void clearLastShownSourceLocation() = 0;
56
57 /**
58 * Returns true iff source locations are shown graphically.
59 */
60 virtual bool areSourceLocationsShownGraphically() const = 0;
61
62 /**
63 * Allows to control whether source locations are shown graphically, or not.
64 */
65 virtual void setShowSourceLocationsGraphically(bool b) = 0;
66
67 /**
68 * Returns true iff the watch file mode is enabled.
69 */
70 virtual bool isWatchFileModeEnabled() const = 0;
71
72 /**
73 * Allows to enable or disable the watch file mode
74 */
75 virtual void setWatchFileModeEnabled(bool b) = 0;
76
77 /**
78 * Should the shell that supports tabs open new files in tabs?
79 */
80 virtual bool openNewFilesInTabs() const = 0;
81
82 /**
83 * Returns the sidebar container.
84 *
85 * @since 23.04
86 */
87 virtual QWidget *getSideContainer() const = 0;
88
89 // SIGNALS
90 /**
91 * The signal 'openSourceReference' is emitted whenever the user has triggered a source
92 * reference in the currently displayed document.
93 */
94 void openSourceReference(const QString &absFileName, int line, int column);
95
96 /**
97 * The signal 'viewerMenuStateChange' is emitted whenever the state of the menu
98 * 'menu_okular_part_viewer' defined in 'part-viewermode.rc' has changed.
99 */
100 void viewerMenuStateChange(bool enabled);
101};
102
103}
104
105Q_DECLARE_INTERFACE(Okular::ViewerInterface, "org.kde.okular.ViewerInterface/0.1")
106
107#endif
Abstract interface for controlling advanced features of a document viewer.
void viewerMenuStateChange(bool enabled)
The signal 'viewerMenuStateChange' is emitted whenever the state of the menu 'menu_okular_part_viewer...
void openSourceReference(const QString &absFileName, int line, int column)
The signal 'openSourceReference' is emitted whenever the user has triggered a source reference in the...
virtual void clearLastShownSourceLocation()=0
Clear the source location that was set last in the viewer.
virtual void showSourceLocation(const QString &fileName, int line, int column, bool showGraphically=true)=0
Show the specified source location centrally in the viewer.
virtual void setShowSourceLocationsGraphically(bool b)=0
Allows to control whether source locations are shown graphically, or not.
virtual bool isWatchFileModeEnabled() const =0
Returns true iff the watch file mode is enabled.
virtual void setWatchFileModeEnabled(bool b)=0
Allows to enable or disable the watch file mode.
virtual bool areSourceLocationsShownGraphically() const =0
Returns true iff source locations are shown graphically.
virtual QWidget * getSideContainer() const =0
Returns the sidebar container.
virtual bool openNewFilesInTabs() const =0
Should the shell that supports tabs open new files in tabs?
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:54 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.