• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ADAPTER_WIDGETMGR_H
8 #define _FWL_ADAPTER_WIDGETMGR_H
9 class IFWL_Widget;
10 class IFWL_Menu;
11 class IFWL_MenuDP;
12 class CFX_Path;
13 class CFX_DIBitmap;
14 class IFWL_AdapterMessageHook;
15 class IFWL_AppDelegate;
16 
17 class IFWL_AdapterWidgetMgr {
18  public:
~IFWL_AdapterWidgetMgr()19   virtual ~IFWL_AdapterWidgetMgr() {}
20   virtual FWL_ERR CreateWidget(IFWL_Widget* pWidget,
21                                IFWL_Widget* pParent = NULL) = 0;
22   virtual FWL_ERR DestroyWidget(IFWL_Widget* pWidget) = 0;
23   virtual FWL_ERR GetWidgetRect(IFWL_Widget* pWidget, CFX_RectF& rect) = 0;
24   virtual FWL_ERR SetWidgetRect(IFWL_Widget* pWidget,
25                                 const CFX_RectF& rect) = 0;
26   virtual FWL_ERR SetWidgetPosition(IFWL_Widget* pWidget,
27                                     FX_FLOAT fx,
28                                     FX_FLOAT fy) = 0;
29   virtual FWL_ERR SetParentWidget(IFWL_Widget* pWidget,
30                                   IFWL_Widget* pParent) = 0;
31   virtual FWL_ERR SetWidgetIcon(IFWL_Widget* pWidget,
32                                 const CFX_DIBitmap* pIcon,
33                                 FX_BOOL bBig) = 0;
34   virtual FWL_ERR SetWidgetCaption(IFWL_Widget* pWidget,
35                                    const CFX_WideStringC& wsCaption) = 0;
36   virtual FWL_ERR SetBorderRegion(IFWL_Widget* pWidget, CFX_Path* pPath) = 0;
37   virtual FWL_ERR SetTransparent(IFWL_Widget* pWidget, FX_DWORD dwAlpha) = 0;
38   virtual FWL_ERR ShowWidget(IFWL_Widget* pWidget) = 0;
39   virtual FWL_ERR HideWidget(IFWL_Widget* pWidget) = 0;
40   virtual FWL_ERR SetNormal(IFWL_Widget* pWidget) = 0;
41   virtual FWL_ERR SetMaximize(IFWL_Widget* pWidget) = 0;
42   virtual FWL_ERR SetMinimize(IFWL_Widget* pWidget) = 0;
43   virtual FWL_ERR SetFullScreen(IFWL_Widget* pWidget, FX_BOOL bFullScreen) = 0;
44   virtual FX_BOOL CheckMessage() = 0;
45   virtual FX_BOOL IsIdleMessage() = 0;
46   virtual FWL_ERR DispatchMessage() = 0;
47   virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget,
48                                 const CFX_RectF* pRect) = 0;
49   virtual FWL_ERR Exit(int32_t iExitCode) = 0;
50   virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget* pWidget,
51                                            void* UserData) = 0;
52   virtual FWL_ERR GetWidgetDC(IFWL_Widget* pWidget, void*& pDC) = 0;
53   virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget,
54                                   void* pDC,
55                                   CFX_RectF* pClip = 0) = 0;
56   virtual void* GetWindow(IFWL_Widget* pWidget) = 0;
57   virtual FX_DWORD GetKeyState(FX_DWORD dwVirtKey) = 0;
58   virtual FWL_ERR RunLoop(IFWL_Widget* widget) = 0;
59   virtual FWL_ERR EndLoop() = 0;
60   virtual FWL_ERR InitMenu(IFWL_Menu* pMenu, IFWL_MenuDP* pMenuData) = 0;
61   virtual FWL_ERR UpdateMenu(IFWL_Menu* pMenu,
62                              const void* hItem,
63                              int32_t iType) = 0;
64   virtual int32_t TrackPopupMenu(IFWL_Menu* pMenu, IFWL_MenuDP* pMenuData) = 0;
65   virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook* hook) = 0;
66   virtual FWL_ERR GetSystemBorder(FX_FLOAT& l,
67                                   FX_FLOAT& t,
68                                   FX_FLOAT& r,
69                                   FX_FLOAT& b) = 0;
70   virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget,
71                               FX_FLOAT fMinHeight,
72                               FX_FLOAT fMaxHeight,
73                               const CFX_RectF& rtAnchor,
74                               CFX_RectF& rtPopup) = 0;
75 };
76 #endif
77