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 #ifndef XFA_FWL_IFWL_THEMEPROVIDER_H_ 8 #define XFA_FWL_IFWL_THEMEPROVIDER_H_ 9 10 #include "core/fxcrt/fx_coordinates.h" 11 #include "core/fxcrt/retain_ptr.h" 12 #include "core/fxge/dib/fx_dib.h" 13 #include "fxjs/gc/heap.h" 14 #include "v8/include/cppgc/garbage-collected.h" 15 #include "v8/include/cppgc/member.h" 16 17 class CFGAS_GEFont; 18 class CFWL_ThemeBackground; 19 class CFWL_ThemePart; 20 class CFWL_ThemeText; 21 class CFWL_Widget; 22 class CFWL_WidgetTP; 23 24 class IFWL_ThemeProvider : public cppgc::GarbageCollectedMixin { 25 public: 26 virtual ~IFWL_ThemeProvider(); 27 28 // GarbageCollectedMixin: 29 void Trace(cppgc::Visitor* visitor) const override; 30 31 virtual void DrawBackground(const CFWL_ThemeBackground& pParams) = 0; 32 virtual void DrawText(const CFWL_ThemeText& pParams) = 0; 33 virtual void CalcTextRect(const CFWL_ThemeText& pParams, 34 CFX_RectF* pRect) = 0; 35 virtual float GetCXBorderSize() const = 0; 36 virtual float GetCYBorderSize() const = 0; 37 virtual CFX_RectF GetUIMargin(const CFWL_ThemePart& pThemePart) const = 0; 38 virtual float GetFontSize(const CFWL_ThemePart& pThemePart) const = 0; 39 virtual RetainPtr<CFGAS_GEFont> GetFont(const CFWL_ThemePart& pThemePart) = 0; 40 virtual RetainPtr<CFGAS_GEFont> GetFWLFont() = 0; 41 virtual float GetLineHeight(const CFWL_ThemePart& pThemePart) const = 0; 42 virtual float GetScrollBarWidth() const = 0; 43 virtual FX_COLORREF GetTextColor(const CFWL_ThemePart& pThemePart) const = 0; 44 virtual CFX_SizeF GetSpaceAboveBelow( 45 const CFWL_ThemePart& pThemePart) const = 0; 46 47 protected: 48 explicit IFWL_ThemeProvider(cppgc::Heap* pHeap); 49 50 CFWL_WidgetTP* GetTheme(const CFWL_Widget* pWidget) const; 51 52 private: 53 cppgc::Member<CFWL_WidgetTP> m_pCheckBoxTP; 54 cppgc::Member<CFWL_WidgetTP> m_pListBoxTP; 55 cppgc::Member<CFWL_WidgetTP> m_pPictureBoxTP; 56 cppgc::Member<CFWL_WidgetTP> m_pSrollBarTP; 57 cppgc::Member<CFWL_WidgetTP> m_pEditTP; 58 cppgc::Member<CFWL_WidgetTP> m_pComboBoxTP; 59 cppgc::Member<CFWL_WidgetTP> m_pMonthCalendarTP; 60 cppgc::Member<CFWL_WidgetTP> m_pDateTimePickerTP; 61 cppgc::Member<CFWL_WidgetTP> m_pPushButtonTP; 62 cppgc::Member<CFWL_WidgetTP> m_pCaretTP; 63 cppgc::Member<CFWL_WidgetTP> m_pBarcodeTP; 64 }; 65 66 #endif // XFA_FWL_IFWL_THEMEPROVIDER_H_ 67