1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ 8 #define CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ 9 10 #include "core/fxcrt/fx_string.h" 11 #include "core/fxcrt/fx_system.h" 12 #include "core/fxcrt/unowned_ptr.h" 13 #include "third_party/base/optional.h" 14 15 class CPDF_Array; 16 class CPDF_Dictionary; 17 class CPDF_Document; 18 19 class CPDF_ViewerPreferences { 20 public: 21 explicit CPDF_ViewerPreferences(const CPDF_Document* pDoc); 22 ~CPDF_ViewerPreferences(); 23 24 bool IsDirectionR2L() const; 25 bool PrintScaling() const; 26 int32_t NumCopies() const; 27 CPDF_Array* PrintPageRange() const; 28 ByteString Duplex() const; 29 30 // Gets the entry for |bsKey|. 31 Optional<ByteString> GenericName(const ByteString& bsKey) const; 32 33 private: 34 CPDF_Dictionary* GetViewerPreferences() const; 35 36 UnownedPtr<const CPDF_Document> const m_pDoc; 37 }; 38 39 #endif // CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_ 40