Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_ffapp.cpp
Go to the documentation of this file.
1// Copyright 2014 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 "xfa/fxfa/cxfa_ffapp.h"
8
9#include "xfa/fwl/cfwl_notedriver.h"
10#include "xfa/fwl/cfwl_widgetmgr.h"
11#include "xfa/fxfa/cxfa_ffdoc.h"
12#include "xfa/fxfa/cxfa_ffwidgethandler.h"
13#include "xfa/fxfa/cxfa_fontmgr.h"
14#include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
15#include "xfa/fxfa/cxfa_fwltheme.h"
16
17CXFA_FFApp::CXFA_FFApp(CallbackIface* pProvider) : m_pProvider(pProvider) {
18 // Ensure fully initialized before making objects based on |this|.
19 m_pXFAFontMgr = cppgc::MakeGarbageCollected<CXFA_FontMgr>(
20 GetHeap()->GetAllocationHandle());
21 m_pFWLApp = cppgc::MakeGarbageCollected<CFWL_App>(
22 GetHeap()->GetAllocationHandle(), this);
23}
24
25CXFA_FFApp::~CXFA_FFApp() = default;
26
27void CXFA_FFApp::Trace(cppgc::Visitor* visitor) const {
28 visitor->Trace(m_pXFAFontMgr);
29 visitor->Trace(m_pAdapterWidgetMgr);
30 visitor->Trace(m_pFWLTheme);
31 visitor->Trace(m_pFWLApp);
32}
33
34bool CXFA_FFApp::LoadFWLTheme(CXFA_FFDoc* doc) {
35 auto* fwl_theme = cppgc::MakeGarbageCollected<CXFA_FWLTheme>(
36 GetHeap()->GetAllocationHandle(), GetHeap(), this);
37 if (!fwl_theme->LoadCalendarFont(doc))
38 return false;
39
40 m_pFWLTheme = fwl_theme;
41 return true;
42}
43
44CFWL_WidgetMgr::AdapterIface* CXFA_FFApp::GetWidgetMgrAdapter() {
45 if (!m_pAdapterWidgetMgr) {
46 m_pAdapterWidgetMgr = cppgc::MakeGarbageCollected<CXFA_FWLAdapterWidgetMgr>(
47 GetHeap()->GetAllocationHandle());
48 }
49 return m_pAdapterWidgetMgr;
50}
51
53 return m_pProvider->GetTimerHandler();
54}
55
57 return m_pFWLTheme;
58}
59
60cppgc::Heap* CXFA_FFApp::GetHeap() {
61 return m_pProvider->GetGCHeap();
62}
void Trace(cppgc::Visitor *visitor) const override
bool LoadFWLTheme(CXFA_FFDoc *doc)
CFX_Timer::HandlerIface * GetTimerHandler() override
CFWL_WidgetMgr::AdapterIface * GetWidgetMgrAdapter() override
IFWL_ThemeProvider * GetThemeProvider() override
~CXFA_FFApp() override
cppgc::Heap * GetHeap() override
Definition heap.h:12