#include "xfa/fwl/cfwl_listbox.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/stl_util.h"
#include "v8/include/cppgc/visitor.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fgas/graphics/cfgas_gegraphics.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_messagekey.h"
#include "xfa/fwl/cfwl_messagemouse.h"
#include "xfa/fwl/cfwl_messagemousewheel.h"
#include "xfa/fwl/cfwl_themebackground.h"
#include "xfa/fwl/cfwl_themepart.h"
#include "xfa/fwl/cfwl_themetext.h"
#include "xfa/fwl/fwl_widgetdef.h"
#include "xfa/fwl/ifwl_themeprovider.h"
namespace pdfium {
namespace {
const int kItemTextMargin = …;
}
CFWL_ListBox::CFWL_ListBox(CFWL_App* app,
const Properties& properties,
CFWL_Widget* pOuter)
: … { … }
CFWL_ListBox::~CFWL_ListBox() = default;
void CFWL_ListBox::Trace(cppgc::Visitor* visitor) const { … }
FWL_Type CFWL_ListBox::GetClassID() const { … }
void CFWL_ListBox::Update() { … }
FWL_WidgetHit CFWL_ListBox::HitTest(const CFX_PointF& point) { … }
void CFWL_ListBox::DrawWidget(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& matrix) { … }
int32_t CFWL_ListBox::CountSelItems() { … }
CFWL_ListBox::Item* CFWL_ListBox::GetSelItem(int32_t nIndexSel) { … }
int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) { … }
void CFWL_ListBox::SetSelItem(Item* pItem, bool bSelect) { … }
CFWL_ListBox::Item* CFWL_ListBox::GetListItem(Item* pItem,
XFA_FWL_VKEYCODE dwKeyCode) { … }
void CFWL_ListBox::SetSelection(Item* hStart, Item* hEnd, bool bSelected) { … }
bool CFWL_ListBox::IsMultiSelection() const { … }
void CFWL_ListBox::ClearSelection() { … }
void CFWL_ListBox::SelectAll() { … }
CFWL_ListBox::Item* CFWL_ListBox::GetFocusedItem() { … }
void CFWL_ListBox::SetFocusItem(Item* pItem) { … }
CFWL_ListBox::Item* CFWL_ListBox::GetItemAtPoint(const CFX_PointF& point) { … }
bool CFWL_ListBox::ScrollToVisible(Item* pItem) { … }
void CFWL_ListBox::DrawBkground(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_ListBox::DrawItems(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_ListBox::DrawItem(CFGAS_GEGraphics* pGraphics,
Item* pItem,
int32_t Index,
const CFX_RectF& rtItem,
const CFX_Matrix& mtMatrix) { … }
CFX_SizeF CFWL_ListBox::CalcSize() { … }
void CFWL_ListBox::UpdateItemSize(Item* pItem,
CFX_SizeF& size,
float fWidth,
float fItemHeight) const { … }
float CFWL_ListBox::GetMaxTextWidth() { … }
float CFWL_ListBox::GetScrollWidth() { … }
float CFWL_ListBox::CalcItemHeight() { … }
void CFWL_ListBox::InitVerticalScrollBar() { … }
void CFWL_ListBox::InitHorizontalScrollBar() { … }
bool CFWL_ListBox::IsShowVertScrollBar() const { … }
bool CFWL_ListBox::IsShowHorzScrollBar() const { … }
bool CFWL_ListBox::ScrollBarPropertiesPresent() const { … }
void CFWL_ListBox::OnProcessMessage(CFWL_Message* pMessage) { … }
void CFWL_ListBox::OnProcessEvent(CFWL_Event* pEvent) { … }
void CFWL_ListBox::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& matrix) { … }
void CFWL_ListBox::OnFocusGained() { … }
void CFWL_ListBox::OnFocusLost() { … }
void CFWL_ListBox::OnLButtonDown(CFWL_MessageMouse* pMsg) { … }
void CFWL_ListBox::OnLButtonUp(CFWL_MessageMouse* pMsg) { … }
void CFWL_ListBox::OnMouseWheel(CFWL_MessageMouseWheel* pMsg) { … }
void CFWL_ListBox::OnKeyDown(CFWL_MessageKey* pMsg) { … }
void CFWL_ListBox::OnVK(Item* pItem, bool bShift, bool bCtrl) { … }
bool CFWL_ListBox::OnScroll(CFWL_ScrollBar* pScrollBar,
CFWL_EventScroll::Code dwCode,
float fPos) { … }
int32_t CFWL_ListBox::CountItems(const CFWL_Widget* pWidget) const { … }
CFWL_ListBox::Item* CFWL_ListBox::GetItem(const CFWL_Widget* pWidget,
int32_t nIndex) const { … }
int32_t CFWL_ListBox::GetItemIndex(CFWL_Widget* pWidget, Item* pItem) { … }
CFWL_ListBox::Item* CFWL_ListBox::AddString(const WideString& wsAdd) { … }
void CFWL_ListBox::RemoveAt(int32_t iIndex) { … }
void CFWL_ListBox::DeleteString(Item* pItem) { … }
void CFWL_ListBox::DeleteAll() { … }
CFWL_ListBox::Item::Item(const WideString& text) : … { … }
CFWL_ListBox::Item::~Item() = default;
}