Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpwl_list_box.h
Go to the documentation of this file.
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 FPDFSDK_PWL_CPWL_LIST_BOX_H_
8#define FPDFSDK_PWL_CPWL_LIST_BOX_H_
9
10#include <memory>
11
12#include "core/fxcrt/unowned_ptr.h"
13#include "fpdfsdk/pwl/cpwl_list_ctrl.h"
14#include "fpdfsdk/pwl/cpwl_wnd.h"
15
17
19 public:
20 CPWL_ListBox(const CreateParams& cp,
21 std::unique_ptr<IPWL_FillerNotify::PerWindowData> pAttachedData);
22 ~CPWL_ListBox() override;
23
24 // CPWL_Wnd:
25 void OnCreated() override;
26 void OnDestroy() override;
28 const CFX_Matrix& mtUser2Device) override;
29 bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask<FWL_EVENTFLAG> nFlag) override;
30 bool OnChar(uint16_t nChar, Mask<FWL_EVENTFLAG> nFlag) override;
31 bool OnLButtonDown(Mask<FWL_EVENTFLAG> nFlag,
32 const CFX_PointF& point) override;
33 bool OnLButtonUp(Mask<FWL_EVENTFLAG> nFlag, const CFX_PointF& point) override;
34 bool OnMouseMove(Mask<FWL_EVENTFLAG> nFlag, const CFX_PointF& point) override;
35 bool OnMouseWheel(Mask<FWL_EVENTFLAG> nFlag,
36 const CFX_PointF& point,
37 const CFX_Vector& delta) override;
38 WideString GetText() override;
39 void SetScrollInfo(const PWL_SCROLL_INFO& info) override;
40 void SetScrollPosition(float pos) override;
41 void ScrollWindowVertically(float pos) override;
42 bool RepositionChildWnd() override;
43 CFX_FloatRect GetFocusRect() const override;
44 void SetFontSize(float fFontSize) override;
45 float GetFontSize() const override;
46
47 // CPWL_ListCtrl::NotifyIface:
48 void OnSetScrollInfoY(float fPlateMin,
49 float fPlateMax,
50 float fContentMin,
51 float fContentMax,
52 float fSmallStep,
53 float fBigStep) override;
54 void OnSetScrollPosY(float fy) override;
55 [[nodiscard]] bool OnInvalidateRect(const CFX_FloatRect& pRect) override;
56
57 bool OnNotifySelectionChanged(bool bKeyDown, Mask<FWL_EVENTFLAG> nFlag);
58
59 void AddString(const WideString& str);
60 void SetTopVisibleIndex(int32_t nItemIndex);
61 void ScrollToListItem(int32_t nItemIndex);
62
63 void Select(int32_t nItemIndex);
64 void Deselect(int32_t nItemIndex);
65 void SetCaret(int32_t nItemIndex);
66 void SetHoverSel(bool bHoverSel);
67
68 int32_t GetCount() const;
69 bool IsMultipleSel() const;
70 int32_t GetCaretIndex() const;
71 int32_t GetCurSel() const;
72 bool IsItemSelected(int32_t nItemIndex) const;
73 int32_t GetTopVisibleIndex() const;
75 float GetFirstHeight() const;
77
78 protected:
79 bool m_bMouseDown = false;
80 bool m_bHoverSel = false;
82};
83
84#endif // FPDFSDK_PWL_CPWL_LIST_BOX_H_
virtual bool OnChar(CPDFSDK_Widget *pAnnot, uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags)
CPWL_Wnd * GetPWLWindow(const CPDFSDK_PageView *pPageView) const
CPWL_Wnd * CreateOrUpdatePWLWindow(const CPDFSDK_PageView *pPageView)
virtual CPWL_Wnd::CreateParams GetCreateParam()
CPDFSDK_PageView * GetCurPageView()
bool IsValid() const
bool IsDataChanged(const CPDFSDK_PageView *pPageView) override
CFFL_ListBox(CFFL_InteractiveFormFiller *pFormFiller, CPDFSDK_Widget *pWidget)
void GetActionData(const CPDFSDK_PageView *pPageView, CPDF_AAction::AActionType type, CFFL_FieldAction &fa) override
bool SetIndexSelected(int index, bool selected) override
void SavePWLWindowState(const CPDFSDK_PageView *pPageView) override
std::unique_ptr< CPWL_Wnd > NewPWLWindow(const CPWL_Wnd::CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData) override
void SaveData(const CPDFSDK_PageView *pPageView) override
~CFFL_ListBox() override
bool IsIndexSelected(int index) override
bool OnChar(CPDFSDK_Widget *pWidget, uint32_t nChar, Mask< FWL_EVENTFLAG > nFlags) override
void RecreatePWLWindowFromSavedState(const CPDFSDK_PageView *pPageView) override
CPWL_Wnd::CreateParams GetCreateParam() override
void SetFormField(CFFL_FormField *pFormField)
CPDF_BAFontMap * GetOrCreateFontMap()
CFFL_TextObject(CFFL_InteractiveFormFiller *pFormFiller, CPDFSDK_Widget *pWidget)
void SetScrollPosition(float pos) override
void AddString(const WideString &str)
~CPWL_ListBox() override
void SetTopVisibleIndex(int32_t nItemIndex)
void SetScrollInfo(const PWL_SCROLL_INFO &info) override
void SetHoverSel(bool bHoverSel)
void SetFontSize(float fFontSize) override
void ScrollToListItem(int32_t nItemIndex)
bool OnKeyDown(FWL_VKEYCODE nKeyCode, Mask< FWL_EVENTFLAG > nFlag) override
void OnDestroy() override
void ScrollWindowVertically(float pos) override
std::unique_ptr< CPWL_ListCtrl > m_pListCtrl
int32_t GetCurSel() const
float GetFirstHeight() const
bool OnNotifySelectionChanged(bool bKeyDown, Mask< FWL_EVENTFLAG > nFlag)
CFX_FloatRect GetListRect() const
bool OnMouseWheel(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point, const CFX_Vector &delta) override
void DrawThisAppearance(CFX_RenderDevice *pDevice, const CFX_Matrix &mtUser2Device) override
void Deselect(int32_t nItemIndex)
bool OnLButtonUp(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
CFX_FloatRect GetContentRect() const
WideString GetText() override
CPWL_ListBox(const CreateParams &cp, std::unique_ptr< IPWL_FillerNotify::PerWindowData > pAttachedData)
void Select(int32_t nItemIndex)
void OnCreated() override
int32_t GetTopVisibleIndex() const
CFX_FloatRect GetFocusRect() const override
bool OnLButtonDown(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
void OnSetScrollPosY(float fy) override
float GetFontSize() const override
bool OnInvalidateRect(const CFX_FloatRect &pRect) override
void SetCaret(int32_t nItemIndex)
void OnSetScrollInfoY(float fPlateMin, float fPlateMax, float fContentMin, float fContentMax, float fSmallStep, float fBigStep) override
bool OnMouseMove(Mask< FWL_EVENTFLAG > nFlag, const CFX_PointF &point) override
int32_t GetCaretIndex() const
int32_t GetCount() const
bool IsMultipleSel() const
bool IsItemSelected(int32_t nItemIndex) const
bool RepositionChildWnd() override
bool OnChar(uint16_t nChar, Mask< FWL_EVENTFLAG > nFlag) override
#define PWS_VSCROLL
Definition cpwl_wnd.h:32
#define PWS_AUTOFONTSIZE
Definition cpwl_wnd.h:35
#define PLBS_MULTIPLESEL
Definition cpwl_wnd.h:55
constexpr uint32_t kChoiceMultiSelect
Definition form_flags.h:39