Okular

viewerinterface.h
1 /*
2  SPDX-FileCopyrightText: 2011 Michel Ludwig <[email protected]>
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 
20 namespace 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  */
28 class VIEWERINTERFACE_EXPORT ViewerInterface
29 {
30 public:
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  // SIGNALS
83  /**
84  * The signal 'openSourceReference' is emitted whenever the user has triggered a source
85  * reference in the currently displayed document.
86  */
87  void openSourceReference(const QString &absFileName, int line, int column);
88 
89  /**
90  * The signal 'viewerMenuStateChange' is emitted whenever the state of the menu
91  * 'menu_okular_part_viewer' defined in 'part-viewermode.rc' has changed.
92  */
93  void viewerMenuStateChange(bool enabled);
94 };
95 
96 }
97 
98 Q_DECLARE_INTERFACE(Okular::ViewerInterface, "org.kde.okular.ViewerInterface/0.1")
99 
100 #endif
global.h
Definition: action.h:16
Abstract interface for controlling advanced features of a document viewer.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 22:32:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.