1 // Copyright 2014 PDFium Authors. All rights reserved.
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 _FWL_PICTUREBOX_IMP_H
8 #define _FWL_PICTUREBOX_IMP_H
9 class CFWL_WidgetImp;
10 class CFWL_WidgetImpProperties;
11 class CFWL_WidgetImpDelegate;
12 class IFWL_Widget;
13 class CFWL_PictureBoxImp;
14 class CFWL_PictureBoxImpDelegate;
15 class CFWL_PictureBoxImp : public CFWL_WidgetImp {
16  public:
17   CFWL_PictureBoxImp(const CFWL_WidgetImpProperties& properties,
18                      IFWL_Widget* pOuter);
19   ~CFWL_PictureBoxImp();
20   virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const;
21   virtual FX_DWORD GetClassID() const;
22   virtual FWL_ERR Initialize();
23   virtual FWL_ERR Finalize();
24   virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
25   virtual FWL_ERR Update();
26   virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics,
27                              const CFX_Matrix* pMatrix = NULL);
28 
29  protected:
30   void DrawBkground(CFX_Graphics* pGraphics,
31                     IFWL_ThemeProvider* pTheme,
32                     const CFX_Matrix* pMatrix = NULL);
33   FX_BOOL VStyle(FX_BOOL dwStyle);
34   CFX_RectF m_rtClient;
35   CFX_RectF m_rtImage;
36   CFX_Matrix m_matrix;
37   FX_BOOL m_bTop;
38   FX_BOOL m_bVCenter;
39   FX_BOOL m_bButton;
40   friend class CFWL_PictureBoxImpDelegate;
41 };
42 class CFWL_PictureBoxImpDelegate : public CFWL_WidgetImpDelegate {
43  public:
44   CFWL_PictureBoxImpDelegate(CFWL_PictureBoxImp* pOwner);
45   FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
46                        const CFX_Matrix* pMatrix = NULL) override;
47 
48  protected:
49   CFWL_PictureBoxImp* m_pOwner;
50 };
51 #endif
52