• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_THEME_CFWL_PUSHBUTTONTP_H_
8 #define XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_
9 
10 #include <array>
11 #include <memory>
12 
13 #include "fxjs/gc/heap.h"
14 #include "xfa/fwl/cfwl_themepart.h"
15 #include "xfa/fwl/theme/cfwl_widgettp.h"
16 
17 namespace pdfium {
18 
19 class CFWL_PushButtonTP final : public CFWL_WidgetTP {
20  public:
21   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
22   ~CFWL_PushButtonTP() override;
23 
24   // CFWL_WidgetTP:
25   void DrawBackground(const CFWL_ThemeBackground& pParams) override;
26 
27  private:
28   struct PBThemeData {
29     std::array<FX_ARGB, 5> clrBorder;
30     std::array<FX_ARGB, 5> clrStart;
31     std::array<FX_ARGB, 5> clrEnd;
32     std::array<FX_ARGB, 5> clrFill;
33   };
34 
35   CFWL_PushButtonTP();
36 
37   int32_t GetColorID(Mask<CFWL_PartState> dwStates) const;
38   void SetThemeData();
39 
40   std::unique_ptr<PBThemeData> m_pThemeData;
41 };
42 
43 }  // namespace pdfium
44 
45 // TODO(crbug.com/42271761): Remove.
46 using pdfium::CFWL_PushButtonTP;
47 
48 #endif  // XFA_FWL_THEME_CFWL_PUSHBUTTONTP_H_
49