1 // Copyright 2016 The PDFium Authors 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 #include "core/fpdfdoc/cpdf_link.h" 8 9 #include <utility> 10 11 #include "core/fpdfapi/parser/cpdf_dictionary.h" 12 13 CPDF_Link::CPDF_Link() = default; 14 CPDF_Link(RetainPtr<CPDF_Dictionary> pDict)15CPDF_Link::CPDF_Link(RetainPtr<CPDF_Dictionary> pDict) 16 : m_pDict(std::move(pDict)) {} 17 18 CPDF_Link::CPDF_Link(const CPDF_Link& that) = default; 19 20 CPDF_Link::~CPDF_Link() = default; 21 GetRect()22CFX_FloatRect CPDF_Link::GetRect() { 23 return m_pDict->GetRectFor("Rect"); 24 } 25 GetDest(CPDF_Document * pDoc)26CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) { 27 return CPDF_Dest::Create(pDoc, m_pDict->GetDirectObjectFor("Dest")); 28 } 29 GetAction()30CPDF_Action CPDF_Link::GetAction() { 31 return CPDF_Action(m_pDict->GetDictFor("A")); 32 } 33