Home | History | Annotate | Download | only in fpdfdoc
      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 
     14 class CPDF_Array;
     15 class CPDF_Dictionary;
     16 class CPDF_Document;
     17 
     18 class CPDF_ViewerPreferences {
     19  public:
     20   explicit CPDF_ViewerPreferences(CPDF_Document* pDoc);
     21   ~CPDF_ViewerPreferences();
     22 
     23   bool IsDirectionR2L() const;
     24   bool PrintScaling() const;
     25   int32_t NumCopies() const;
     26   CPDF_Array* PrintPageRange() const;
     27   ByteString Duplex() const;
     28 
     29   // Gets the entry for |bsKey|. If the entry exists and it is of type name,
     30   // then this method writes the value into |bsVal| and returns true. Otherwise
     31   // returns false and |bsVal| is untouched. |bsVal| must not be NULL.
     32   bool GenericName(const ByteString& bsKey, ByteString* bsVal) const;
     33 
     34  private:
     35   CPDF_Dictionary* GetViewerPreferences() const;
     36 
     37   UnownedPtr<CPDF_Document> const m_pDoc;
     38 };
     39 
     40 #endif  // CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_
     41