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_ICONFIT_H_ 8 #define CORE_FPDFDOC_CPDF_ICONFIT_H_ 9 10 #include "core/fxcrt/fx_system.h" 11 #include "core/fxcrt/unowned_ptr.h" 12 13 class CPDF_Dictionary; 14 15 class CPDF_IconFit { 16 public: 17 enum ScaleMethod { Always = 0, Bigger, Smaller, Never }; 18 19 explicit CPDF_IconFit(const CPDF_Dictionary* pDict); 20 CPDF_IconFit(const CPDF_IconFit& that); 21 ~CPDF_IconFit(); 22 23 ScaleMethod GetScaleMethod(); 24 bool IsProportionalScale(); 25 void GetIconPosition(float& fLeft, float& fBottom); 26 bool GetFittingBounds(); GetDict()27 const CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } 28 29 private: 30 UnownedPtr<const CPDF_Dictionary> const m_pDict; 31 }; 32 33 #endif // CORE_FPDFDOC_CPDF_ICONFIT_H_ 34