Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-10 10:23:54

0001 //========================================================================
0002 //
0003 // ViewerPreferences.h
0004 //
0005 // This file is licensed under the GPLv2 or later
0006 //
0007 // Copyright 2011 Pino Toscano <pino@kde.org>
0008 // Copyright 2019 Marek Kasik <mkasik@redhat.com>
0009 // Copyright 2021, 2022 Albert Astals Cid <aacid@kde.org>
0010 //
0011 //========================================================================
0012 
0013 #ifndef VIEWERPREFERENCES_H
0014 #define VIEWERPREFERENCES_H
0015 
0016 #include <vector>
0017 
0018 class Dict;
0019 
0020 //------------------------------------------------------------------------
0021 // ViewerPreferences
0022 //------------------------------------------------------------------------
0023 
0024 class ViewerPreferences
0025 {
0026 public:
0027     enum NonFullScreenPageMode
0028     {
0029         nfpmUseNone,
0030         nfpmUseOutlines,
0031         nfpmUseThumbs,
0032         nfpmUseOC
0033     };
0034     enum Direction
0035     {
0036         directionL2R,
0037         directionR2L
0038     };
0039     enum PrintScaling
0040     {
0041         printScalingNone,
0042         printScalingAppDefault
0043     };
0044     enum Duplex
0045     {
0046         duplexNone,
0047         duplexSimplex,
0048         duplexDuplexFlipShortEdge,
0049         duplexDuplexFlipLongEdge
0050     };
0051 
0052     explicit ViewerPreferences(Dict *prefDict);
0053     ~ViewerPreferences();
0054 
0055     bool getHideToolbar() const { return hideToolbar; }
0056     bool getHideMenubar() const { return hideMenubar; }
0057     bool getHideWindowUI() const { return hideWindowUI; }
0058     bool getFitWindow() const { return fitWindow; }
0059     bool getCenterWindow() const { return centerWindow; }
0060     bool getDisplayDocTitle() const { return displayDocTitle; }
0061     NonFullScreenPageMode getNonFullScreenPageMode() const { return nonFullScreenPageMode; }
0062     Direction getDirection() const { return direction; }
0063     PrintScaling getPrintScaling() const { return printScaling; }
0064     Duplex getDuplex() const { return duplex; }
0065     bool getPickTrayByPDFSize() const { return pickTrayByPDFSize; }
0066     int getNumCopies() const { return numCopies; }
0067     std::vector<std::pair<int, int>> getPrintPageRange() const { return printPageRange; }
0068 
0069 private:
0070     void init();
0071 
0072     bool hideToolbar;
0073     bool hideMenubar;
0074     bool hideWindowUI;
0075     bool fitWindow;
0076     bool centerWindow;
0077     bool displayDocTitle;
0078     NonFullScreenPageMode nonFullScreenPageMode = nfpmUseNone;
0079     Direction direction = directionL2R;
0080     PrintScaling printScaling = printScalingAppDefault;
0081     Duplex duplex = duplexNone;
0082     bool pickTrayByPDFSize;
0083     int numCopies = 1;
0084     std::vector<std::pair<int, int>> printPageRange;
0085 };
0086 
0087 #endif