1//========================================================================
2//
3// ViewerPreferences.h
4//
5// This file is licensed under the GPLv2 or later
6//
7// Copyright 2011 Pino Toscano <pino@kde.org>
8// Copyright 2019 Marek Kasik <mkasik@redhat.com>
9// Copyright 2021, 2022 Albert Astals Cid <aacid@kde.org>
10//
11//========================================================================
12
13#ifndef VIEWERPREFERENCES_H
14#define VIEWERPREFERENCES_H
15
16#include <vector>
17
18class Dict;
19
20//------------------------------------------------------------------------
21// ViewerPreferences
22//------------------------------------------------------------------------
23
24class ViewerPreferences
25{
26public:
27 enum NonFullScreenPageMode
28 {
29 nfpmUseNone,
30 nfpmUseOutlines,
31 nfpmUseThumbs,
32 nfpmUseOC
33 };
34 enum Direction
35 {
36 directionL2R,
37 directionR2L
38 };
39 enum PrintScaling
40 {
41 printScalingNone,
42 printScalingAppDefault
43 };
44 enum Duplex
45 {
46 duplexNone,
47 duplexSimplex,
48 duplexDuplexFlipShortEdge,
49 duplexDuplexFlipLongEdge
50 };
51
52 explicit ViewerPreferences(Dict *prefDict);
53 ~ViewerPreferences();
54
55 bool getHideToolbar() const { return hideToolbar; }
56 bool getHideMenubar() const { return hideMenubar; }
57 bool getHideWindowUI() const { return hideWindowUI; }
58 bool getFitWindow() const { return fitWindow; }
59 bool getCenterWindow() const { return centerWindow; }
60 bool getDisplayDocTitle() const { return displayDocTitle; }
61 NonFullScreenPageMode getNonFullScreenPageMode() const { return nonFullScreenPageMode; }
62 Direction getDirection() const { return direction; }
63 PrintScaling getPrintScaling() const { return printScaling; }
64 Duplex getDuplex() const { return duplex; }
65 bool getPickTrayByPDFSize() const { return pickTrayByPDFSize; }
66 int getNumCopies() const { return numCopies; }
67 std::vector<std::pair<int, int>> getPrintPageRange() const { return printPageRange; }
68
69private:
70 void init();
71
72 bool hideToolbar;
73 bool hideMenubar;
74 bool hideWindowUI;
75 bool fitWindow;
76 bool centerWindow;
77 bool displayDocTitle;
78 NonFullScreenPageMode nonFullScreenPageMode = nfpmUseNone;
79 Direction direction = directionL2R;
80 PrintScaling printScaling = printScalingAppDefault;
81 Duplex duplex = duplexNone;
82 bool pickTrayByPDFSize;
83 int numCopies = 1;
84 std::vector<std::pair<int, int>> printPageRange;
85};
86
87#endif
88

source code of poppler/poppler/ViewerPreferences.h