Home | History | Annotate | Download | only in page
      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_FPDFAPI_PAGE_CPDF_FORMOBJECT_H_
      8 #define CORE_FPDFAPI_PAGE_CPDF_FORMOBJECT_H_
      9 
     10 #include <memory>
     11 
     12 #include "core/fpdfapi/page/cpdf_pageobject.h"
     13 #include "core/fxcrt/fx_coordinates.h"
     14 
     15 class CPDF_Form;
     16 
     17 class CPDF_FormObject : public CPDF_PageObject {
     18  public:
     19   CPDF_FormObject(std::unique_ptr<CPDF_Form> pForm, const CFX_Matrix& matrix);
     20   ~CPDF_FormObject() override;
     21 
     22   // CPDF_PageObject:
     23   Type GetType() const override;
     24   void Transform(const CFX_Matrix& matrix) override;
     25   bool IsForm() const override;
     26   CPDF_FormObject* AsForm() override;
     27   const CPDF_FormObject* AsForm() const override;
     28 
     29   void CalcBoundingBox();
     30   const CPDF_Form* form() const { return m_pForm.get(); }
     31   const CFX_Matrix& form_matrix() const { return m_FormMatrix; }
     32 
     33  private:
     34   const std::unique_ptr<CPDF_Form> m_pForm;
     35   CFX_Matrix m_FormMatrix;
     36 };
     37 
     38 #endif  // CORE_FPDFAPI_PAGE_CPDF_FORMOBJECT_H_
     39