Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cffl_textobject.cpp
Go to the documentation of this file.
1
// Copyright 2017 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
"fpdfsdk/formfiller/cffl_textobject.h"
8
9
#
include
"core/fpdfapi/page/cpdf_page.h"
10
#
include
"core/fpdfdoc/cpdf_bafontmap.h"
11
#
include
"fpdfsdk/cpdfsdk_widget.h"
12
13
CFFL_TextObject
::
CFFL_TextObject
(CFFL_InteractiveFormFiller* pFormFiller,
14
CPDFSDK_Widget* pWidget)
15
:
CFFL_FormField
(
pFormFiller
,
pWidget
)
{}
16
17
CFFL_TextObject
::~
CFFL_TextObject
() {
18
// Destroy view classes before this object's members are destroyed since
19
// the view classes have pointers to m_pFontMap that would be left dangling.
20
DestroyWindows
();
21
}
22
23
CPWL_Wnd
*
CFFL_TextObject
::
ResetPWLWindow
(
const
CPDFSDK_PageView* pPageView) {
24
DestroyPWLWindow
(pPageView);
25
ObservedPtr<
CPWL_Wnd
> pRet(CreateOrUpdatePWLWindow(pPageView));
26
m_pWidget->UpdateField();
// May invoke JS, invalidating |pRet|.
27
return
pRet.Get();
28
}
29
30
CPWL_Wnd
*
CFFL_TextObject
::
RestorePWLWindow
(
const
CPDFSDK_PageView* pPageView) {
31
SavePWLWindowState
(pPageView);
32
DestroyPWLWindow
(pPageView);
33
RecreatePWLWindowFromSavedState
(pPageView);
34
ObservedPtr<
CPWL_Wnd
> pRet(GetPWLWindow(pPageView));
35
m_pWidget->UpdateField();
// May invoke JS, invalidating |pRet|.
36
return
pRet.Get();
37
}
38
39
CPDF_BAFontMap*
CFFL_TextObject
::
GetOrCreateFontMap
() {
40
if
(!m_pFontMap) {
41
m_pFontMap = std::make_unique<CPDF_BAFontMap>(
42
m_pWidget->GetPDFPage()->GetDocument(),
43
m_pWidget->GetPDFAnnot()->GetMutableAnnotDict(),
"N"
);
44
}
45
return
m_pFontMap.get();
46
}
CFFL_FormField
Definition
cffl_formfield.h:27
CFFL_FormField::DestroyWindows
void DestroyWindows()
Definition
cffl_formfield.cpp:29
CFFL_FormField::RecreatePWLWindowFromSavedState
virtual void RecreatePWLWindowFromSavedState(const CPDFSDK_PageView *pPageView)
Definition
cffl_formfield.cpp:541
CFFL_FormField::CFFL_FormField
CFFL_FormField(CFFL_InteractiveFormFiller *pFormFiller, CPDFSDK_Widget *pWidget)
Definition
cffl_formfield.cpp:19
CFFL_FormField::SavePWLWindowState
virtual void SavePWLWindowState(const CPDFSDK_PageView *pPageView)
Definition
cffl_formfield.cpp:539
CFFL_FormField::DestroyPWLWindow
void DestroyPWLWindow(const CPDFSDK_PageView *pPageView)
Definition
cffl_formfield.cpp:384
CFFL_TextObject
Definition
cffl_textobject.h:18
CFFL_TextObject::~CFFL_TextObject
~CFFL_TextObject() override
Definition
cffl_textobject.cpp:17
CFFL_TextObject::GetOrCreateFontMap
CPDF_BAFontMap * GetOrCreateFontMap()
Definition
cffl_textobject.cpp:39
CFFL_TextObject::CFFL_TextObject
CFFL_TextObject(CFFL_InteractiveFormFiller *pFormFiller, CPDFSDK_Widget *pWidget)
Definition
cffl_textobject.cpp:13
CFFL_TextObject::ResetPWLWindow
CPWL_Wnd * ResetPWLWindow(const CPDFSDK_PageView *pPageView) override
Definition
cffl_textobject.cpp:23
CFFL_TextObject::RestorePWLWindow
CPWL_Wnd * RestorePWLWindow(const CPDFSDK_PageView *pPageView) override
Definition
cffl_textobject.cpp:30
CPWL_Wnd
Definition
cpwl_wnd.h:77
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fpdfsdk
formfiller
cffl_textobject.cpp
Generated on
for Qt by
1.18.0