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 #ifndef XFA_FWL_CFWL_THEMEPART_H_ 8 #define XFA_FWL_CFWL_THEMEPART_H_ 9 10 #include <stdint.h> 11 12 #include "core/fxcrt/fx_coordinates.h" 13 #include "core/fxcrt/fx_memory.h" 14 #include "core/fxcrt/mask.h" 15 #include "core/fxcrt/unowned_ptr.h" 16 #include "xfa/fwl/theme/cfwl_utils.h" 17 18 class CFWL_Widget; 19 20 enum class CFWL_PartState : uint16_t { 21 kNormal = 0, 22 kChecked = 1 << 1, 23 kDefault = 1 << 2, 24 kDisabled = 1 << 3, 25 kFlagged = 1 << 4, 26 kFocused = 1 << 5, 27 kHightLight = 1 << 6, 28 kHovered = 1 << 7, 29 kNeutral = 1 << 9, 30 kPressed = 1 << 10, 31 kReadOnly = 1 << 11, 32 kLSelected = 1 << 12, 33 kRSelected = 1 << 13, 34 kSelected = 1 << 14 35 }; 36 37 class CFWL_ThemePart { 38 public: 39 enum class Part : uint8_t { 40 kNone = 0, 41 42 kBackArrow, 43 kBackground, 44 kBorder, 45 kCaption, 46 kCheck, 47 kCheckBox, 48 kCloseBox, 49 kCombTextLine, 50 kDateInBK, 51 kDateInCircle, 52 kDatesIn, 53 kDatesOut, 54 kDownButton, 55 kDropDownButton, 56 kForeArrow, 57 kHSeparator, 58 kHeadText, 59 kHeader, 60 kIcon, 61 kImage, 62 kLBtn, 63 kListItem, 64 kLowerTrack, 65 kMinimizeBox, 66 kMaximizeBox, 67 kNarrowCaption, 68 kRBtn, 69 kThumb, 70 kThumbBackArrow, 71 kThumbForeArrow, 72 kThumbLowerTrack, 73 kThumbThumb, 74 kThumbUpperTrack, 75 kToday, 76 kTodayCircle, 77 kUpButton, 78 kUpperTrack, 79 kVSeparator, 80 kWeek, 81 kWeekNum, 82 kWeekNumSep 83 }; 84 85 FX_STACK_ALLOCATED(); 86 87 CFWL_ThemePart(Part iPart, CFWL_Widget* pWidget); 88 ~CFWL_ThemePart(); 89 GetPart()90 Part GetPart() const { return m_iPart; } GetWidget()91 CFWL_Widget* GetWidget() const { return m_pWidget; } 92 FWLTHEME_STATE GetThemeState() const; 93 94 CFX_Matrix m_matrix; 95 CFX_RectF m_PartRect; 96 UnownedPtr<const CFX_RectF> m_pRtData; 97 Mask<CFWL_PartState> m_dwStates = CFWL_PartState::kNormal; 98 bool m_bMaximize = false; 99 bool m_bStaticBackground = false; 100 101 private: 102 const Part m_iPart; 103 UnownedPtr<CFWL_Widget> const m_pWidget; 104 }; 105 106 #endif // XFA_FWL_CFWL_THEMEPART_H_ 107