summaryrefslogtreecommitdiff
path: root/xfa/fwl/lightwidget
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/lightwidget')
-rw-r--r--xfa/fwl/lightwidget/cfwl_barcode.cpp16
-rw-r--r--xfa/fwl/lightwidget/cfwl_barcode.h6
-rw-r--r--xfa/fwl/lightwidget/cfwl_checkbox.cpp27
-rw-r--r--xfa/fwl/lightwidget/cfwl_checkbox.h13
-rw-r--r--xfa/fwl/lightwidget/cfwl_combobox.cpp135
-rw-r--r--xfa/fwl/lightwidget/cfwl_combobox.h86
-rw-r--r--xfa/fwl/lightwidget/cfwl_datetimepicker.cpp50
-rw-r--r--xfa/fwl/lightwidget/cfwl_datetimepicker.h31
-rw-r--r--xfa/fwl/lightwidget/cfwl_edit.cpp90
-rw-r--r--xfa/fwl/lightwidget/cfwl_edit.h46
-rw-r--r--xfa/fwl/lightwidget/cfwl_listbox.cpp138
-rw-r--r--xfa/fwl/lightwidget/cfwl_listbox.h71
-rw-r--r--xfa/fwl/lightwidget/cfwl_picturebox.cpp53
-rw-r--r--xfa/fwl/lightwidget/cfwl_picturebox.h23
-rw-r--r--xfa/fwl/lightwidget/cfwl_pushbutton.cpp27
-rw-r--r--xfa/fwl/lightwidget/cfwl_pushbutton.h10
-rw-r--r--xfa/fwl/lightwidget/cfwl_scrollbar.cpp34
-rw-r--r--xfa/fwl/lightwidget/cfwl_scrollbar.h14
-rw-r--r--xfa/fwl/lightwidget/cfwl_theme.cpp31
-rw-r--r--xfa/fwl/lightwidget/cfwl_theme.h20
-rw-r--r--xfa/fwl/lightwidget/cfwl_tooltip.cpp46
-rw-r--r--xfa/fwl/lightwidget/cfwl_tooltip.h33
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.cpp116
-rw-r--r--xfa/fwl/lightwidget/cfwl_widget.h50
-rw-r--r--xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp18
-rw-r--r--xfa/fwl/lightwidget/cfwl_widgetdelegate.h10
26 files changed, 599 insertions, 595 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.cpp b/xfa/fwl/lightwidget/cfwl_barcode.cpp
index 4ac358ce54..4b998d04d7 100644
--- a/xfa/fwl/lightwidget/cfwl_barcode.cpp
+++ b/xfa/fwl/lightwidget/cfwl_barcode.cpp
@@ -12,21 +12,21 @@ CFWL_Barcode* CFWL_Barcode::Create() {
return new CFWL_Barcode;
}
-FWL_ERR CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_Barcode> pBarcode(IFWL_Barcode::Create(
m_pProperties->MakeWidgetImpProperties(&m_barcodeData)));
- FWL_ERR ret = pBarcode->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pBarcode->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pBarcode.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFWL_Barcode::CFWL_Barcode() {}
@@ -44,7 +44,7 @@ FX_BOOL CFWL_Barcode::IsProtectedType() {
return 0;
return static_cast<IFWL_Barcode*>(m_pIface)->IsProtectedType();
}
-FWL_ERR CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
- return FWL_ERR_Succeeded;
+FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
+ return FWL_Error::Succeeded;
}
diff --git a/xfa/fwl/lightwidget/cfwl_barcode.h b/xfa/fwl/lightwidget/cfwl_barcode.h
index f52b0eef9d..565ebb884e 100644
--- a/xfa/fwl/lightwidget/cfwl_barcode.h
+++ b/xfa/fwl/lightwidget/cfwl_barcode.h
@@ -17,7 +17,7 @@ class CFWL_WidgetProperties;
class CFWL_Barcode : public CFWL_Edit {
public:
static CFWL_Barcode* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
void SetType(BC_TYPE type);
FX_BOOL IsProtectedType();
@@ -86,8 +86,8 @@ class CFWL_Barcode : public CFWL_Edit {
public:
CFWL_BarcodeDP() : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {}
- FWL_ERR GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) override;
+ FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) override;
BC_CHAR_ENCODING GetCharEncoding() override { return m_eCharEncoding; }
int32_t GetModuleHeight() override { return m_nModuleHeight; }
int32_t GetModuleWidth() override { return m_nModuleWidth; }
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.cpp b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
index b5e2a87d67..a93bc4674a 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.cpp
@@ -14,38 +14,38 @@ CFWL_CheckBox* CFWL_CheckBox::Create() {
return new CFWL_CheckBox;
}
-FWL_ERR CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_CheckBox> pCheckBox(IFWL_CheckBox::Create(
m_pProperties->MakeWidgetImpProperties(&m_checkboxData), nullptr));
- FWL_ERR ret = pCheckBox->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pCheckBox->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pCheckBox.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) {
+FWL_Error CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) {
m_checkboxData.m_wsCaption = wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) {
+FWL_Error CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) {
m_checkboxData.m_fBoxHeight = fHeight;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_CheckBox::GetCheckState() {
return static_cast<IFWL_CheckBox*>(m_pIface)->GetCheckState();
}
-FWL_ERR CFWL_CheckBox::SetCheckState(int32_t iCheck) {
+FWL_Error CFWL_CheckBox::SetCheckState(int32_t iCheck) {
return static_cast<IFWL_CheckBox*>(m_pIface)->SetCheckState(iCheck);
}
@@ -56,10 +56,11 @@ CFWL_CheckBox::~CFWL_CheckBox() {}
CFWL_CheckBox::CFWL_CheckBoxDP::CFWL_CheckBoxDP()
: m_fBoxHeight(16.0f), m_wsCaption(L"Check box") {}
-FWL_ERR CFWL_CheckBox::CFWL_CheckBoxDP::GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
+FWL_Error CFWL_CheckBox::CFWL_CheckBoxDP::GetCaption(
+ IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
wsCaption = m_wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_CheckBox::CFWL_CheckBoxDP::GetBoxSize(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/lightwidget/cfwl_checkbox.h b/xfa/fwl/lightwidget/cfwl_checkbox.h
index 7b7e4004bd..061e46f777 100644
--- a/xfa/fwl/lightwidget/cfwl_checkbox.h
+++ b/xfa/fwl/lightwidget/cfwl_checkbox.h
@@ -14,12 +14,12 @@ class CFWL_CheckBox : public CFWL_Widget {
public:
static CFWL_CheckBox* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR GetCaption(CFX_WideString& wsCaption);
- FWL_ERR SetCaption(const CFX_WideStringC& wsCaption);
- FWL_ERR SetBoxSize(FX_FLOAT fHeight);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error GetCaption(CFX_WideString& wsCaption);
+ FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
+ FWL_Error SetBoxSize(FX_FLOAT fHeight);
int32_t GetCheckState();
- FWL_ERR SetCheckState(int32_t iCheck);
+ FWL_Error SetCheckState(int32_t iCheck);
CFWL_CheckBox();
virtual ~CFWL_CheckBox();
@@ -27,7 +27,8 @@ class CFWL_CheckBox : public CFWL_Widget {
class CFWL_CheckBoxDP : public IFWL_CheckBoxDP {
public:
CFWL_CheckBoxDP();
- virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
+ virtual FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption);
virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget);
FX_FLOAT m_fBoxHeight;
CFX_WideString m_wsCaption;
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.cpp b/xfa/fwl/lightwidget/cfwl_combobox.cpp
index f2cd1f5d6b..ca88a23429 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_combobox.cpp
@@ -15,21 +15,21 @@ CFWL_ComboBox* CFWL_ComboBox::Create() {
return new CFWL_ComboBox;
}
-FWL_ERR CFWL_ComboBox::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_ComboBox::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_ComboBox> pComboBox(IFWL_ComboBox::Create(
m_pProperties->MakeWidgetImpProperties(&m_comboBoxData)));
- FWL_ERR ret = pComboBox->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pComboBox->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pComboBox.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_ComboBox::AddString(const CFX_WideStringC& wsText) {
@@ -67,13 +67,14 @@ int32_t CFWL_ComboBox::CountItems() {
return m_comboBoxData.CountItems(GetWidget());
}
-FWL_ERR CFWL_ComboBox::GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) {
+FWL_Error CFWL_ComboBox::GetTextByIndex(int32_t iIndex,
+ CFX_WideString& wsText) {
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(
m_comboBoxData.GetItem(m_pIface, iIndex));
if (!pItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
wsText = pItem->m_wsText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_ComboBox::GetCurSel() {
@@ -82,15 +83,15 @@ int32_t CFWL_ComboBox::GetCurSel() {
return static_cast<IFWL_ComboBox*>(m_pIface)->GetCurSel();
}
-FWL_ERR CFWL_ComboBox::SetCurSel(int32_t iSel) {
+FWL_Error CFWL_ComboBox::SetCurSel(int32_t iSel) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->SetCurSel(iSel);
}
-FWL_ERR CFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
+FWL_Error CFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->SetEditText(wsText);
}
@@ -100,18 +101,18 @@ int32_t CFWL_ComboBox::GetEditTextLength() const {
return static_cast<IFWL_ComboBox*>(m_pIface)->GetEditTextLength();
}
-FWL_ERR CFWL_ComboBox::GetEditText(CFX_WideString& wsText,
- int32_t nStart,
- int32_t nCount) const {
+FWL_Error CFWL_ComboBox::GetEditText(CFX_WideString& wsText,
+ int32_t nStart,
+ int32_t nCount) const {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)
->GetEditText(wsText, nStart, nCount);
}
-FWL_ERR CFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) {
+FWL_Error CFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->SetEditSelRange(nStart, nCount);
}
@@ -127,15 +128,15 @@ int32_t CFWL_ComboBox::GetEditLimit() {
return static_cast<IFWL_ComboBox*>(m_pIface)->GetEditLimit();
}
-FWL_ERR CFWL_ComboBox::SetEditLimit(int32_t nLimit) {
+FWL_Error CFWL_ComboBox::SetEditLimit(int32_t nLimit) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->SetEditLimit(nLimit);
}
-FWL_ERR CFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
+FWL_Error CFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->EditDoClipboard(iCmd);
}
@@ -151,18 +152,18 @@ FX_BOOL CFWL_ComboBox::EditUndo(const CFX_ByteStringC& bsRecord) {
return static_cast<IFWL_ComboBox*>(m_pIface)->EditUndo(bsRecord);
}
-FWL_ERR CFWL_ComboBox::SetMaxListHeight(FX_FLOAT fMaxHeight) {
+FWL_Error CFWL_ComboBox::SetMaxListHeight(FX_FLOAT fMaxHeight) {
m_comboBoxData.m_fMaxListHeight = fMaxHeight;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ComboBox::SetItemData(int32_t iIndex, void* pData) {
+FWL_Error CFWL_ComboBox::SetItemData(int32_t iIndex, void* pData) {
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(
m_comboBoxData.GetItem(m_pIface, iIndex));
if (!pItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
pItem->m_pData = pData;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void* CFWL_ComboBox::GetItemData(int32_t iIndex) {
@@ -173,7 +174,7 @@ void* CFWL_ComboBox::GetItemData(int32_t iIndex) {
return pItem->m_pData;
}
-FWL_ERR CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) {
+FWL_Error CFWL_ComboBox::SetListTheme(IFWL_ThemeProvider* pTheme) {
return static_cast<IFWL_ComboBox*>(m_pIface)->GetListBoxt()->SetThemeProvider(
pTheme);
}
@@ -182,7 +183,7 @@ FX_BOOL CFWL_ComboBox::AfterFocusShowDropList() {
return static_cast<IFWL_ComboBox*>(m_pIface)->AfterFocusShowDropList();
}
-FWL_ERR CFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
+FWL_Error CFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
return static_cast<IFWL_ComboBox*>(m_pIface)->OpenDropDownList(bActivate);
}
@@ -264,16 +265,16 @@ FX_BOOL CFWL_ComboBox::EditDeSelect() {
return static_cast<IFWL_ComboBox*>(m_pIface)->EditDeSelect();
}
-FWL_ERR CFWL_ComboBox::GetBBox(CFX_RectF& rect) {
+FWL_Error CFWL_ComboBox::GetBBox(CFX_RectF& rect) {
if (!m_pIface)
- return FALSE;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)->GetBBox(rect);
}
-FWL_ERR CFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded,
- uint32_t dwStylesExRemoved) {
+FWL_Error CFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved) {
if (!m_pIface)
- return FALSE;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ComboBox*>(m_pIface)
->EditModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
@@ -328,24 +329,24 @@ uint32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemStyles(IFWL_Widget* pWidget,
return reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_dwStyles;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::GetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_WideString& wsText) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_WideString& wsText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
wsText = reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_wsText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::GetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtItem) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtItem) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(hItem);
rtItem.Set(pItem->m_rtItem.left, pItem->m_rtItem.top, pItem->m_rtItem.width,
pItem->m_rtItem.height);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemData(IFWL_Widget* pWidget,
@@ -356,31 +357,31 @@ void* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemData(IFWL_Widget* pWidget,
return pItem->m_pData;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::SetItemStyles(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- uint32_t dwStyle) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemStyles(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwStyle) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_dwStyles = dwStyle;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::SetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const FX_WCHAR* pszText) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const FX_WCHAR* pszText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_wsText = pszText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::SetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtItem) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const CFX_RectF& rtItem) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_rtItem = rtItem;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetItemHeight(IFWL_Widget* pWidget) {
@@ -394,21 +395,21 @@ CFX_DIBitmap* CFWL_ComboBox::CFWL_ComboBoxDP::GetItemIcon(IFWL_Widget* pWidget,
return reinterpret_cast<CFWL_ComboBoxItem*>(hItem)->m_pDIB;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtCheck) {
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtCheck) {
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(hItem);
rtCheck = pItem->m_rtCheckBox;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckRect(
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckRect(
IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
const CFX_RectF& rtCheck) {
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(hItem);
pItem->m_rtCheckBox = rtCheck;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
uint32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckState(
@@ -418,13 +419,13 @@ uint32_t CFWL_ComboBox::CFWL_ComboBoxDP::GetItemCheckState(
return pItem->m_dwCheckState;
}
-FWL_ERR CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckState(
+FWL_Error CFWL_ComboBox::CFWL_ComboBoxDP::SetItemCheckState(
IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
uint32_t dwCheckState) {
CFWL_ComboBoxItem* pItem = reinterpret_cast<CFWL_ComboBoxItem*>(hItem);
pItem->m_dwCheckState = dwCheckState;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_ComboBox::CFWL_ComboBoxDP::GetListHeight(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/lightwidget/cfwl_combobox.h b/xfa/fwl/lightwidget/cfwl_combobox.h
index c92a063cdf..5a639e33d9 100644
--- a/xfa/fwl/lightwidget/cfwl_combobox.h
+++ b/xfa/fwl/lightwidget/cfwl_combobox.h
@@ -21,33 +21,33 @@ class CFWL_ComboBoxItem;
class CFWL_ComboBox : public CFWL_Widget {
public:
static CFWL_ComboBox* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
int32_t AddString(const CFX_WideStringC& wsText);
int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon);
bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range.
void RemoveAll();
int32_t CountItems();
- FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText);
+ FWL_Error GetTextByIndex(int32_t iIndex, CFX_WideString& wsText);
int32_t GetCurSel();
- FWL_ERR SetCurSel(int32_t iSel);
- FWL_ERR SetEditText(const CFX_WideString& wsText);
+ FWL_Error SetCurSel(int32_t iSel);
+ FWL_Error SetEditText(const CFX_WideString& wsText);
int32_t GetEditTextLength() const;
- FWL_ERR GetEditText(CFX_WideString& wsText,
- int32_t nStart = 0,
- int32_t nCount = -1) const;
- FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1);
+ FWL_Error GetEditText(CFX_WideString& wsText,
+ int32_t nStart = 0,
+ int32_t nCount = -1) const;
+ FWL_Error SetEditSelRange(int32_t nStart, int32_t nCount = -1);
int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart);
int32_t GetEditLimit();
- FWL_ERR SetEditLimit(int32_t nLimit);
- FWL_ERR EditDoClipboard(int32_t iCmd);
+ FWL_Error SetEditLimit(int32_t nLimit);
+ FWL_Error EditDoClipboard(int32_t iCmd);
FX_BOOL EditRedo(const CFX_ByteStringC& bsRecord);
FX_BOOL EditUndo(const CFX_ByteStringC& bsRecord);
- FWL_ERR SetMaxListHeight(FX_FLOAT fMaxHeight);
- FWL_ERR SetItemData(int32_t iIndex, void* pData);
+ FWL_Error SetMaxListHeight(FX_FLOAT fMaxHeight);
+ FWL_Error SetItemData(int32_t iIndex, void* pData);
void* GetItemData(int32_t iIndex);
- FWL_ERR SetListTheme(IFWL_ThemeProvider* pTheme);
+ FWL_Error SetListTheme(IFWL_ThemeProvider* pTheme);
FX_BOOL AfterFocusShowDropList();
- FWL_ERR OpenDropDownList(FX_BOOL bActivate);
+ FWL_Error OpenDropDownList(FX_BOOL bActivate);
FX_BOOL EditCanUndo();
FX_BOOL EditCanRedo();
@@ -62,9 +62,9 @@ class CFWL_ComboBox : public CFWL_Widget {
FX_BOOL EditSelectAll();
FX_BOOL EditDelete();
FX_BOOL EditDeSelect();
- FWL_ERR GetBBox(CFX_RectF& rect);
- FWL_ERR EditModifyStylesEx(uint32_t dwStylesExAdded,
- uint32_t dwStylesExRemoved);
+ FWL_Error GetBBox(CFX_RectF& rect);
+ FWL_Error EditModifyStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved);
CFWL_ComboBox();
virtual ~CFWL_ComboBox();
@@ -73,9 +73,9 @@ class CFWL_ComboBox : public CFWL_Widget {
public:
CFWL_ComboBoxDP();
~CFWL_ComboBoxDP();
- virtual FWL_ERR GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
- return FWL_ERR_Succeeded;
+ virtual FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
+ return FWL_Error::Succeeded;
}
virtual int32_t CountItems(IFWL_Widget* pWidget);
@@ -86,36 +86,36 @@ class CFWL_ComboBox : public CFWL_Widget {
int32_t nIndex);
virtual uint32_t GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem);
- virtual FWL_ERR GetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_WideString& wsText);
- virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtItem);
+ virtual FWL_Error GetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_WideString& wsText);
+ virtual FWL_Error GetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtItem);
virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem);
- virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget,
+ virtual FWL_Error SetItemStyles(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwStyle);
+ virtual FWL_Error SetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const FX_WCHAR* pszText);
+ virtual FWL_Error SetItemRect(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
- uint32_t dwStyle);
- virtual FWL_ERR SetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const FX_WCHAR* pszText);
- virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtItem);
+ const CFX_RectF& rtItem);
virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget);
virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem);
- virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtCheck);
- virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtCheck);
+ virtual FWL_Error GetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtCheck);
+ virtual FWL_Error SetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const CFX_RectF& rtCheck);
virtual uint32_t GetItemCheckState(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem);
- virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- uint32_t dwCheckState);
+ virtual FWL_Error SetItemCheckState(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwCheckState);
virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget);
std::vector<std::unique_ptr<CFWL_ComboBoxItem>> m_ItemArray;
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
index ba99ad8551..dba1a527b4 100644
--- a/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.cpp
@@ -16,10 +16,10 @@ CFWL_DateTimePicker* CFWL_DateTimePicker::Create() {
return new CFWL_DateTimePicker;
}
-FWL_ERR CFWL_DateTimePicker::Initialize(
+FWL_Error CFWL_DateTimePicker::Initialize(
const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
@@ -27,22 +27,22 @@ FWL_ERR CFWL_DateTimePicker::Initialize(
IFWL_DateTimePicker::Create(
m_pProperties->MakeWidgetImpProperties(&m_DateTimePickerDP),
nullptr));
- FWL_ERR ret = pDateTimePicker->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pDateTimePicker->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pDateTimePicker.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_DateTimePicker::SetToday(int32_t iYear,
- int32_t iMonth,
- int32_t iDay) {
+FWL_Error CFWL_DateTimePicker::SetToday(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
m_DateTimePickerDP.m_iYear = iYear;
m_DateTimePickerDP.m_iMonth = iMonth;
m_DateTimePickerDP.m_iDay = iDay;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_DateTimePicker::CountSelRanges() {
@@ -54,24 +54,24 @@ int32_t CFWL_DateTimePicker::GetSelRange(int32_t nIndex, int32_t& nStart) {
->GetSelRange(nIndex, nStart);
}
-FWL_ERR CFWL_DateTimePicker::GetEditText(CFX_WideString& wsText) {
+FWL_Error CFWL_DateTimePicker::GetEditText(CFX_WideString& wsText) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetEditText(wsText);
}
-FWL_ERR CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) {
+FWL_Error CFWL_DateTimePicker::SetEditText(const CFX_WideString& wsText) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditText(wsText);
}
-FWL_ERR CFWL_DateTimePicker::GetCurSel(int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay) {
+FWL_Error CFWL_DateTimePicker::GetCurSel(int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)
->GetCurSel(iYear, iMonth, iDay);
}
-FWL_ERR CFWL_DateTimePicker::SetCurSel(int32_t iYear,
- int32_t iMonth,
- int32_t iDay) {
+FWL_Error CFWL_DateTimePicker::SetCurSel(int32_t iYear,
+ int32_t iMonth,
+ int32_t iDay) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)
->SetCurSel(iYear, iMonth, iDay);
}
@@ -86,14 +86,14 @@ CFWL_DateTimePicker::CFWL_DateTimePickerDP::CFWL_DateTimePickerDP() {
m_iDay = 1;
}
-FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetCaption(
+FWL_Error CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetCaption(
IFWL_Widget* pWidget,
CFX_WideString& wsCaption) {
wsCaption = m_wsData;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(
+FWL_Error CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(
IFWL_Widget* pWidget,
int32_t& iYear,
int32_t& iMonth,
@@ -101,7 +101,7 @@ FWL_ERR CFWL_DateTimePicker::CFWL_DateTimePickerDP::GetToday(
iYear = m_iYear;
iMonth = m_iMonth;
iDay = m_iDay;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CFWL_DateTimePicker::CanUndo() {
@@ -156,16 +156,16 @@ FX_BOOL CFWL_DateTimePicker::DeSelect() {
return static_cast<IFWL_DateTimePicker*>(m_pIface)->DeSelect();
}
-FWL_ERR CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) {
+FWL_Error CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)->GetBBox(rect);
}
-FWL_ERR CFWL_DateTimePicker::SetEditLimit(int32_t nLimit) {
+FWL_Error CFWL_DateTimePicker::SetEditLimit(int32_t nLimit) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)->SetEditLimit(nLimit);
}
-FWL_ERR CFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded,
- uint32_t dwStylesExRemoved) {
+FWL_Error CFWL_DateTimePicker::ModifyEditStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved) {
return static_cast<IFWL_DateTimePicker*>(m_pIface)
->ModifyEditStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
diff --git a/xfa/fwl/lightwidget/cfwl_datetimepicker.h b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
index befe57a079..b4349d0cb0 100644
--- a/xfa/fwl/lightwidget/cfwl_datetimepicker.h
+++ b/xfa/fwl/lightwidget/cfwl_datetimepicker.h
@@ -13,14 +13,14 @@
class CFWL_DateTimePicker : public CFWL_Widget {
public:
static CFWL_DateTimePicker* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR SetToday(int32_t iYear, int32_t iMonth, int32_t iDay);
- FWL_ERR GetEditText(CFX_WideString& wsText);
- FWL_ERR SetEditText(const CFX_WideString& wsText);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay);
+ FWL_Error GetEditText(CFX_WideString& wsText);
+ FWL_Error SetEditText(const CFX_WideString& wsText);
int32_t CountSelRanges();
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
- FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
- FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
+ FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
+ FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
FX_BOOL CanUndo();
FX_BOOL CanRedo();
FX_BOOL Undo();
@@ -34,10 +34,10 @@ class CFWL_DateTimePicker : public CFWL_Widget {
FX_BOOL SelectAll();
FX_BOOL Delete();
FX_BOOL DeSelect();
- FWL_ERR GetBBox(CFX_RectF& rect);
- FWL_ERR SetEditLimit(int32_t nLimit);
- FWL_ERR ModifyEditStylesEx(uint32_t dwStylesExAdded,
- uint32_t dwStylesExRemoved);
+ FWL_Error GetBBox(CFX_RectF& rect);
+ FWL_Error SetEditLimit(int32_t nLimit);
+ FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved);
protected:
CFWL_DateTimePicker();
@@ -45,11 +45,12 @@ class CFWL_DateTimePicker : public CFWL_Widget {
class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP {
public:
CFWL_DateTimePickerDP();
- virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
- virtual FWL_ERR GetToday(IFWL_Widget* pWidget,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay);
+ virtual FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption);
+ virtual FWL_Error GetToday(IFWL_Widget* pWidget,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay);
int32_t m_iYear;
int32_t m_iMonth;
int32_t m_iDay;
diff --git a/xfa/fwl/lightwidget/cfwl_edit.cpp b/xfa/fwl/lightwidget/cfwl_edit.cpp
index ba0ff58f6d..0303e6c2a2 100644
--- a/xfa/fwl/lightwidget/cfwl_edit.cpp
+++ b/xfa/fwl/lightwidget/cfwl_edit.cpp
@@ -15,26 +15,26 @@ CFWL_Edit* CFWL_Edit::Create() {
return new CFWL_Edit;
}
-FWL_ERR CFWL_Edit::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_Edit::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_Edit> pEdit(IFWL_Edit::Create(
m_pProperties->MakeWidgetImpProperties(nullptr), nullptr));
- FWL_ERR ret = pEdit->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pEdit->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pEdit.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_Edit::SetText(const CFX_WideString& wsText) {
+FWL_Error CFWL_Edit::SetText(const CFX_WideString& wsText) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->SetText(wsText);
}
@@ -44,17 +44,17 @@ int32_t CFWL_Edit::GetTextLength() const {
return static_cast<IFWL_Edit*>(m_pIface)->GetTextLength();
}
-FWL_ERR CFWL_Edit::GetText(CFX_WideString& wsText,
- int32_t nStart,
- int32_t nCount) const {
+FWL_Error CFWL_Edit::GetText(CFX_WideString& wsText,
+ int32_t nStart,
+ int32_t nCount) const {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->GetText(wsText, nStart, nCount);
}
-FWL_ERR CFWL_Edit::ClearText() {
+FWL_Error CFWL_Edit::ClearText() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->ClearText();
}
@@ -70,9 +70,9 @@ int32_t CFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
return static_cast<IFWL_Edit*>(m_pIface)->SetCaretPos(nIndex, bBefore);
}
-FWL_ERR CFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) {
+int32_t CFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return -1;
static_cast<IFWL_Edit*>(m_pIface)->AddSelRange(nStart, nCount);
int32_t pos = 0;
int32_t sum = static_cast<IFWL_Edit*>(m_pIface)->GetTextLength();
@@ -96,9 +96,9 @@ int32_t CFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) {
return static_cast<IFWL_Edit*>(m_pIface)->GetSelRange(nIndex, nStart);
}
-FWL_ERR CFWL_Edit::ClearSelections() {
+FWL_Error CFWL_Edit::ClearSelections() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->ClearSelections();
}
@@ -108,55 +108,55 @@ int32_t CFWL_Edit::GetLimit() {
return static_cast<IFWL_Edit*>(m_pIface)->GetLimit();
}
-FWL_ERR CFWL_Edit::SetLimit(int32_t nLimit) {
+FWL_Error CFWL_Edit::SetLimit(int32_t nLimit) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->SetLimit(nLimit);
}
-FWL_ERR CFWL_Edit::SetAliasChar(FX_WCHAR wAlias) {
+FWL_Error CFWL_Edit::SetAliasChar(FX_WCHAR wAlias) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->SetAliasChar(wAlias);
}
-FWL_ERR CFWL_Edit::Insert(int32_t nStart,
- const FX_WCHAR* lpText,
- int32_t nLen) {
+FWL_Error CFWL_Edit::Insert(int32_t nStart,
+ const FX_WCHAR* lpText,
+ int32_t nLen) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->Insert(nStart, lpText, nLen);
}
-FWL_ERR CFWL_Edit::DeleteSelections() {
+FWL_Error CFWL_Edit::DeleteSelections() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->DeleteSelections();
}
-FWL_ERR CFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) {
+FWL_Error CFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->DeleteRange(nStart, nCount);
}
-FWL_ERR CFWL_Edit::ReplaceSelections(const CFX_WideStringC& wsReplace) {
+FWL_Error CFWL_Edit::ReplaceSelections(const CFX_WideStringC& wsReplace) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->ReplaceSelections(wsReplace);
}
-FWL_ERR CFWL_Edit::Replace(int32_t nStart,
- int32_t nLen,
- const CFX_WideStringC& wsReplace) {
+FWL_Error CFWL_Edit::Replace(int32_t nStart,
+ int32_t nLen,
+ const CFX_WideStringC& wsReplace) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->Replace(nStart, nLen, wsReplace);
}
-FWL_ERR CFWL_Edit::DoClipboard(int32_t iCmd) {
+FWL_Error CFWL_Edit::DoClipboard(int32_t iCmd) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->DoClipboard(iCmd);
}
@@ -172,29 +172,29 @@ FX_BOOL CFWL_Edit::Undo(const CFX_ByteStringC& bsRecord) {
return static_cast<IFWL_Edit*>(m_pIface)->Undo(bsRecord);
}
-FWL_ERR CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
+FWL_Error CFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)
->SetTabWidth(fTabWidth, bEquidistant);
}
-FWL_ERR CFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
+FWL_Error CFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
if (iMin > iMax) {
- return FWL_ERR_Parameter_Invalid;
+ return FWL_Error::ParameterInvalid;
}
return static_cast<IFWL_Edit*>(m_pIface)->SetNumberRange(iMin, iMax);
}
-FWL_ERR CFWL_Edit::SetBackColor(uint32_t dwColor) {
+FWL_Error CFWL_Edit::SetBackColor(uint32_t dwColor) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->SetBackColor(dwColor);
}
-FWL_ERR CFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
+FWL_Error CFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_Edit*>(m_pIface)->SetFont(wsFont, fSize);
}
diff --git a/xfa/fwl/lightwidget/cfwl_edit.h b/xfa/fwl/lightwidget/cfwl_edit.h
index 153c756044..5f3e045535 100644
--- a/xfa/fwl/lightwidget/cfwl_edit.h
+++ b/xfa/fwl/lightwidget/cfwl_edit.h
@@ -16,37 +16,37 @@ class CFWL_WidgetProperties;
class CFWL_Edit : public CFWL_Widget {
public:
static CFWL_Edit* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR SetText(const CFX_WideString& wsText);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error SetText(const CFX_WideString& wsText);
int32_t GetTextLength() const;
- FWL_ERR GetText(CFX_WideString& wsText,
- int32_t nStart = 0,
- int32_t nCount = -1) const;
- FWL_ERR ClearText();
+ FWL_Error GetText(CFX_WideString& wsText,
+ int32_t nStart = 0,
+ int32_t nCount = -1) const;
+ FWL_Error ClearText();
int32_t GetCaretPos() const;
int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE);
- FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1);
+ int32_t AddSelRange(int32_t nStart, int32_t nCount = -1);
int32_t CountSelRanges();
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
- FWL_ERR ClearSelections();
+ FWL_Error ClearSelections();
int32_t GetLimit();
- FWL_ERR SetLimit(int32_t nLimit);
- FWL_ERR SetAliasChar(FX_WCHAR wAlias);
- FWL_ERR SetFormatString(const CFX_WideString& wsFormat);
- FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen);
- FWL_ERR DeleteSelections();
- FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1);
- FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace);
- FWL_ERR Replace(int32_t nStart,
- int32_t nLen,
- const CFX_WideStringC& wsReplace);
- FWL_ERR DoClipboard(int32_t iCmd);
+ FWL_Error SetLimit(int32_t nLimit);
+ FWL_Error SetAliasChar(FX_WCHAR wAlias);
+ FWL_Error SetFormatString(const CFX_WideString& wsFormat);
+ FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen);
+ FWL_Error DeleteSelections();
+ FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1);
+ FWL_Error ReplaceSelections(const CFX_WideStringC& wsReplace);
+ FWL_Error Replace(int32_t nStart,
+ int32_t nLen,
+ const CFX_WideStringC& wsReplace);
+ FWL_Error DoClipboard(int32_t iCmd);
FX_BOOL Redo(const CFX_ByteStringC& bsRecord);
FX_BOOL Undo(const CFX_ByteStringC& bsRecord);
- FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
- FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax);
- FWL_ERR SetBackColor(uint32_t dwColor);
- FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize);
+ FWL_Error SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant);
+ FWL_Error SetNumberRange(int32_t iMin, int32_t iMax);
+ FWL_Error SetBackColor(uint32_t dwColor);
+ FWL_Error SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize);
FX_BOOL CanUndo();
FX_BOOL CanRedo();
FX_BOOL Undo();
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.cpp b/xfa/fwl/lightwidget/cfwl_listbox.cpp
index 2102d2d3ee..46433a3198 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_listbox.cpp
@@ -14,26 +14,26 @@ CFWL_ListBox* CFWL_ListBox::Create() {
return new CFWL_ListBox;
}
-FWL_ERR CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create(
m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr));
- FWL_ERR ret = pListBox->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pListBox->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pListBox.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem) {
+FWL_Error CFWL_ListBox::AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem) {
reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB = pDIB;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FWL_HLISTITEM CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd,
@@ -91,27 +91,28 @@ int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) {
return static_cast<IFWL_ListBox*>(m_pIface)->GetSelIndex(nIndex);
}
-FWL_ERR CFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) {
+FWL_Error CFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ListBox*>(m_pIface)->SetSelItem(hItem, bSelect);
}
-FWL_ERR CFWL_ListBox::GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText) {
+FWL_Error CFWL_ListBox::GetItemText(FWL_HLISTITEM hItem,
+ CFX_WideString& wsText) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ListBox*>(m_pIface)->GetItemText(hItem, wsText);
}
-FWL_ERR CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
+FWL_Error CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fPos, bVert);
}
-FWL_ERR CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) {
+FWL_Error CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) {
m_ListBoxDP.m_fItemHeight = fItemHeight;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FWL_HLISTITEM CFWL_ListBox::GetFocusItem() {
@@ -122,14 +123,10 @@ FWL_HLISTITEM CFWL_ListBox::GetFocusItem() {
return nullptr;
}
-FWL_ERR CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem) {
+FWL_Error CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem) {
int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem);
m_ListBoxDP.m_ItemArray[nIndex]->m_dwStates |= FWL_ITEMSTATE_LTB_Focused;
- return FWL_ERR_Succeeded;
-}
-
-FWL_ERR* CFWL_ListBox::Sort(IFWL_ListBoxCompare* pCom) {
- return static_cast<IFWL_ListBox*>(m_pIface)->Sort(pCom);
+ return FWL_Error::Succeeded;
}
int32_t CFWL_ListBox::CountItems() {
@@ -143,27 +140,27 @@ FWL_HLISTITEM CFWL_ListBox::GetItem(int32_t nIndex) {
return (FWL_HLISTITEM)m_ListBoxDP.m_ItemArray[nIndex].get();
}
-FWL_ERR CFWL_ListBox::SetItemString(FWL_HLISTITEM hItem,
- const CFX_WideStringC& wsText) {
+FWL_Error CFWL_ListBox::SetItemString(FWL_HLISTITEM hItem,
+ const CFX_WideStringC& wsText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = wsText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::GetItemString(FWL_HLISTITEM hItem,
- CFX_WideString& wsText) {
+FWL_Error CFWL_ListBox::GetItemString(FWL_HLISTITEM hItem,
+ CFX_WideString& wsText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::SetItemData(FWL_HLISTITEM hItem, void* pData) {
+FWL_Error CFWL_ListBox::SetItemData(FWL_HLISTITEM hItem, void* pData) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ListItem*>(hItem)->m_pData = pData;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void* CFWL_ListBox::GetItemData(FWL_HLISTITEM hItem) {
@@ -212,10 +209,10 @@ CFWL_ListBox::CFWL_ListBoxDP::CFWL_ListBoxDP() {}
CFWL_ListBox::CFWL_ListBoxDP::~CFWL_ListBoxDP() {}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
wsCaption = m_wsData;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget* pWidget) {
@@ -256,23 +253,23 @@ uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemStyles(IFWL_Widget* pWidget,
return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_WideString& wsText) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_WideString& wsText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtItem) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtItem) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFWL_ListItem* pItem = reinterpret_cast<CFWL_ListItem*>(hItem);
rtItem = pItem->m_rtItem;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget,
@@ -283,31 +280,31 @@ void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget,
return pItem->m_pData;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- uint32_t dwStyle) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwStyle) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates = dwStyle;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const FX_WCHAR* pszText) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const FX_WCHAR* pszText) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = pszText;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtItem) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const CFX_RectF& rtItem) {
if (!hItem)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtItem = rtItem;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_ListBox::CFWL_ListBoxDP::GetItemHeight(IFWL_Widget* pWidget) {
@@ -319,19 +316,19 @@ CFX_DIBitmap* CFWL_ListBox::CFWL_ListBoxDP::GetItemIcon(IFWL_Widget* pWidget,
return reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtCheck) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtCheck) {
rtCheck = reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckRect(
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckRect(
IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
const CFX_RectF& rtCheck) {
reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox = rtCheck;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckState(IFWL_Widget* pWidget,
@@ -339,9 +336,10 @@ uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckState(IFWL_Widget* pWidget,
return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState;
}
-FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckState(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- uint32_t dwCheckState) {
+FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckState(
+ IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwCheckState) {
reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState = dwCheckState;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
diff --git a/xfa/fwl/lightwidget/cfwl_listbox.h b/xfa/fwl/lightwidget/cfwl_listbox.h
index 28fb42af69..a40d0f975c 100644
--- a/xfa/fwl/lightwidget/cfwl_listbox.h
+++ b/xfa/fwl/lightwidget/cfwl_listbox.h
@@ -20,8 +20,8 @@ class CFWL_ListItem;
class CFWL_ListBox : public CFWL_Widget {
public:
static CFWL_ListBox* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem);
FWL_HLISTITEM AddString(const CFX_WideStringC& wsAdd,
FX_BOOL bSelect = FALSE);
FX_BOOL DeleteString(FWL_HLISTITEM hItem);
@@ -29,18 +29,17 @@ class CFWL_ListBox : public CFWL_Widget {
int32_t CountSelItems();
FWL_HLISTITEM GetSelItem(int32_t nIndexSel);
int32_t GetSelIndex(int32_t nIndex);
- FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE);
- FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText);
- FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE);
- FWL_ERR SetItemHeight(FX_FLOAT fItemHeight);
+ FWL_Error SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE);
+ FWL_Error GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText);
+ FWL_Error GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE);
+ FWL_Error SetItemHeight(FX_FLOAT fItemHeight);
FWL_HLISTITEM GetFocusItem();
- FWL_ERR SetFocusItem(FWL_HLISTITEM hItem);
- FWL_ERR* Sort(IFWL_ListBoxCompare* pCom);
+ FWL_Error SetFocusItem(FWL_HLISTITEM hItem);
int32_t CountItems();
FWL_HLISTITEM GetItem(int32_t nIndex);
- FWL_ERR SetItemString(FWL_HLISTITEM hItem, const CFX_WideStringC& wsText);
- FWL_ERR GetItemString(FWL_HLISTITEM hItem, CFX_WideString& wsText);
- FWL_ERR SetItemData(FWL_HLISTITEM hItem, void* pData);
+ FWL_Error SetItemString(FWL_HLISTITEM hItem, const CFX_WideStringC& wsText);
+ FWL_Error GetItemString(FWL_HLISTITEM hItem, CFX_WideString& wsText);
+ FWL_Error SetItemData(FWL_HLISTITEM hItem, void* pData);
void* GetItemData(FWL_HLISTITEM hItem);
FWL_HLISTITEM GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy);
uint32_t GetItemStates(FWL_HLISTITEM hItem);
@@ -54,8 +53,8 @@ class CFWL_ListBox : public CFWL_Widget {
~CFWL_ListBoxDP();
// IFWL_DataProvider:
- FWL_ERR GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) override;
+ FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) override;
// IFWL_ListBoxDP:
int32_t CountItems(IFWL_Widget* pWidget) override;
@@ -65,36 +64,36 @@ class CFWL_ListBox : public CFWL_Widget {
FWL_HLISTITEM hItem,
int32_t nIndex) override;
uint32_t GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) override;
- FWL_ERR GetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_WideString& wsText) override;
- FWL_ERR GetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtItem) override;
+ FWL_Error GetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_WideString& wsText) override;
+ FWL_Error GetItemRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtItem) override;
void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) override;
- FWL_ERR SetItemStyles(IFWL_Widget* pWidget,
+ FWL_Error SetItemStyles(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwStyle) override;
+ FWL_Error SetItemText(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const FX_WCHAR* pszText) override;
+ FWL_Error SetItemRect(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem,
- uint32_t dwStyle) override;
- FWL_ERR SetItemText(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const FX_WCHAR* pszText) override;
- FWL_ERR SetItemRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtItem) override;
+ const CFX_RectF& rtItem) override;
FX_FLOAT GetItemHeight(IFWL_Widget* pWidget) override;
CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem) override;
- FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- CFX_RectF& rtCheck) override;
- FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- const CFX_RectF& rtCheck) override;
+ FWL_Error GetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ CFX_RectF& rtCheck) override;
+ FWL_Error SetItemCheckRect(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ const CFX_RectF& rtCheck) override;
uint32_t GetItemCheckState(IFWL_Widget* pWidget,
FWL_HLISTITEM hItem) override;
- FWL_ERR SetItemCheckState(IFWL_Widget* pWidget,
- FWL_HLISTITEM hItem,
- uint32_t dwCheckState) override;
+ FWL_Error SetItemCheckState(IFWL_Widget* pWidget,
+ FWL_HLISTITEM hItem,
+ uint32_t dwCheckState) override;
std::vector<std::unique_ptr<CFWL_ListItem>> m_ItemArray;
CFX_WideString m_wsData;
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.cpp b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
index b0bd3c9931..f3f52ab993 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
@@ -12,94 +12,95 @@ CFWL_PictureBox* CFWL_PictureBox::Create() {
return new CFWL_PictureBox;
}
-FWL_ERR CFWL_PictureBox::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_PictureBox::Initialize(
+ const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_PictureBox> pPictureBox(IFWL_PictureBox::Create(
m_pProperties->MakeWidgetImpProperties(&m_PictureBoxDP), nullptr));
- FWL_ERR ret = pPictureBox->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pPictureBox->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pPictureBox.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PictureBox::GetPicture() {
return m_PictureBoxDP.m_pBitmap;
}
-FWL_ERR CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) {
+FWL_Error CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) {
m_PictureBoxDP.m_pBitmap = pBitmap;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_PictureBox::GetRotation() {
return m_PictureBoxDP.m_fRotation;
}
-FWL_ERR CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) {
+FWL_Error CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) {
m_PictureBoxDP.m_fRotation = fRotation;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::GetFlipMode() {
return m_PictureBoxDP.GetFlipMode(m_pIface);
}
-FWL_ERR CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) {
+FWL_Error CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) {
m_PictureBoxDP.m_iFlipMode = iFlipMode;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::GetOpacity() {
return m_PictureBoxDP.GetOpacity(m_pIface);
}
-FWL_ERR CFWL_PictureBox::SetOpacity(int32_t iOpacity) {
+FWL_Error CFWL_PictureBox::SetOpacity(int32_t iOpacity) {
m_PictureBoxDP.m_iOpacity = iOpacity;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY) {
+FWL_Error CFWL_PictureBox::GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY) {
CFX_Matrix matrix;
m_PictureBoxDP.GetMatrix(m_pIface, matrix);
matrix.Scale(fScaleX, fScaleY);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY) {
+FWL_Error CFWL_PictureBox::SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY) {
m_PictureBoxDP.m_fScaleX = fScaleX;
m_PictureBoxDP.m_fScaleY = fScaleY;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::GetOffset(FX_FLOAT& fx, FX_FLOAT& fy) {
+FWL_Error CFWL_PictureBox::GetOffset(FX_FLOAT& fx, FX_FLOAT& fy) {
CFX_Matrix matrix;
m_PictureBoxDP.GetMatrix(m_pIface, matrix);
fx = matrix.e;
fy = matrix.f;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::SetOffset(FX_FLOAT fx, FX_FLOAT fy) {
+FWL_Error CFWL_PictureBox::SetOffset(FX_FLOAT fx, FX_FLOAT fy) {
m_PictureBoxDP.m_fOffSetX = fx;
m_PictureBoxDP.m_fOffSetY = fy;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFWL_PictureBox::CFWL_PictureBox() {}
CFWL_PictureBox::~CFWL_PictureBox() {}
-FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetCaption(
+FWL_Error CFWL_PictureBox::CFWL_PictureBoxDP::GetCaption(
IFWL_Widget* pWidget,
CFX_WideString& wsCaption) {
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PictureBox::CFWL_PictureBoxDP::GetPicture(
@@ -121,8 +122,8 @@ int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget* pWidget) {
return m_iOpacity;
}
-FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
- CFX_Matrix& matrix) {
+FWL_Error CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
+ CFX_Matrix& matrix) {
CFX_RectF rect;
pWidget->GetClientRect(rect);
FX_FLOAT fLen = rect.width / 2;
@@ -133,7 +134,7 @@ FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
matrix.Translate(fLen, fWid);
matrix.Scale(m_fScaleX, m_fScaleY);
matrix.Translate(m_fOffSetX, m_fOffSetY);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.h b/xfa/fwl/lightwidget/cfwl_picturebox.h
index 8fa985acd8..8b0b13de24 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.h
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.h
@@ -14,19 +14,19 @@
class CFWL_PictureBox : public CFWL_Widget {
public:
static CFWL_PictureBox* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
CFX_DIBitmap* GetPicture();
- FWL_ERR SetPicture(CFX_DIBitmap* pBitmap);
+ FWL_Error SetPicture(CFX_DIBitmap* pBitmap);
FX_FLOAT GetRotation();
- FWL_ERR SetRotation(FX_FLOAT fRotation);
+ FWL_Error SetRotation(FX_FLOAT fRotation);
int32_t GetFlipMode();
- FWL_ERR SetFlipMode(int32_t iFlipMode);
+ FWL_Error SetFlipMode(int32_t iFlipMode);
int32_t GetOpacity();
- FWL_ERR SetOpacity(int32_t iOpacity);
- FWL_ERR GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY);
- FWL_ERR SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY);
- FWL_ERR GetOffset(FX_FLOAT& fx, FX_FLOAT& fy);
- FWL_ERR SetOffset(FX_FLOAT fx, FX_FLOAT fy);
+ FWL_Error SetOpacity(int32_t iOpacity);
+ FWL_Error GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY);
+ FWL_Error SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY);
+ FWL_Error GetOffset(FX_FLOAT& fx, FX_FLOAT& fy);
+ FWL_Error SetOffset(FX_FLOAT fx, FX_FLOAT fy);
CFWL_PictureBox();
virtual ~CFWL_PictureBox();
@@ -41,13 +41,14 @@ class CFWL_PictureBox : public CFWL_Widget {
m_fOffSetY = 0.0f;
m_pBitmap = NULL;
}
- virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
+ virtual FWL_Error GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption);
virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget);
virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget);
virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget);
virtual int32_t GetOpacity(IFWL_Widget* pWidget);
virtual int32_t GetFlipMode(IFWL_Widget* pWidget);
- virtual FWL_ERR GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix);
+ virtual FWL_Error GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix);
CFX_DIBitmap* m_pBitmap;
int32_t m_iOpacity;
int32_t m_iFlipMode;
diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
index 52747bdebe..7c8a9fa64d 100644
--- a/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
+++ b/xfa/fwl/lightwidget/cfwl_pushbutton.cpp
@@ -12,51 +12,52 @@ CFWL_PushButton* CFWL_PushButton::Create() {
return new CFWL_PushButton;
}
-FWL_ERR CFWL_PushButton::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_PushButton::Initialize(
+ const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_PushButton> pPushButton(IFWL_PushButton::Create(
m_pProperties->MakeWidgetImpProperties(&m_buttonData), nullptr));
- FWL_ERR ret = pPushButton->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pPushButton->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pPushButton.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PushButton::GetCaption(CFX_WideString& wsCaption) {
+FWL_Error CFWL_PushButton::GetCaption(CFX_WideString& wsCaption) {
wsCaption = m_buttonData.m_wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PushButton::SetCaption(const CFX_WideStringC& wsCaption) {
+FWL_Error CFWL_PushButton::SetCaption(const CFX_WideStringC& wsCaption) {
m_buttonData.m_wsCaption = wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PushButton::GetPicture() {
return m_buttonData.m_pBitmap;
}
-FWL_ERR CFWL_PushButton::SetPicture(CFX_DIBitmap* pBitmap) {
+FWL_Error CFWL_PushButton::SetPicture(CFX_DIBitmap* pBitmap) {
m_buttonData.m_pBitmap = pBitmap;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFWL_PushButton::CFWL_PushButton() {}
CFWL_PushButton::~CFWL_PushButton() {}
-FWL_ERR CFWL_PushButton::CFWL_PushButtonDP::GetCaption(
+FWL_Error CFWL_PushButton::CFWL_PushButtonDP::GetCaption(
IFWL_Widget* pWidget,
CFX_WideString& wsCaption) {
wsCaption = m_wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PushButton::CFWL_PushButtonDP::GetPicture(
diff --git a/xfa/fwl/lightwidget/cfwl_pushbutton.h b/xfa/fwl/lightwidget/cfwl_pushbutton.h
index 99b067d2cf..5ca3dded37 100644
--- a/xfa/fwl/lightwidget/cfwl_pushbutton.h
+++ b/xfa/fwl/lightwidget/cfwl_pushbutton.h
@@ -13,11 +13,11 @@
class CFWL_PushButton : public CFWL_Widget {
public:
static CFWL_PushButton* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR GetCaption(CFX_WideString& wsCaption);
- FWL_ERR SetCaption(const CFX_WideStringC& wsCaption);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error GetCaption(CFX_WideString& wsCaption);
+ FWL_Error SetCaption(const CFX_WideStringC& wsCaption);
CFX_DIBitmap* GetPicture();
- FWL_ERR SetPicture(CFX_DIBitmap* pBitmap);
+ FWL_Error SetPicture(CFX_DIBitmap* pBitmap);
CFWL_PushButton();
virtual ~CFWL_PushButton();
@@ -25,7 +25,7 @@ class CFWL_PushButton : public CFWL_Widget {
class CFWL_PushButtonDP : public IFWL_PushButtonDP {
public:
CFWL_PushButtonDP() : m_pBitmap(NULL) {}
- FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
+ FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget);
CFX_WideString m_wsCaption;
CFX_DIBitmap* m_pBitmap;
diff --git a/xfa/fwl/lightwidget/cfwl_scrollbar.cpp b/xfa/fwl/lightwidget/cfwl_scrollbar.cpp
index 0c02314733..eb4276c2d1 100644
--- a/xfa/fwl/lightwidget/cfwl_scrollbar.cpp
+++ b/xfa/fwl/lightwidget/cfwl_scrollbar.cpp
@@ -18,21 +18,21 @@ CFWL_ScrollBar::CFWL_ScrollBar() {}
CFWL_ScrollBar::~CFWL_ScrollBar() {}
-FWL_ERR CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_ScrollBar::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_ScrollBar> pScrollBar(IFWL_ScrollBar::Create(
m_pProperties->MakeWidgetImpProperties(nullptr), nullptr));
- FWL_ERR ret = pScrollBar->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pScrollBar->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pScrollBar.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CFWL_ScrollBar::IsVertical() {
@@ -41,15 +41,15 @@ FX_BOOL CFWL_ScrollBar::IsVertical() {
return static_cast<IFWL_ScrollBar*>(m_pIface)->IsVertical();
}
-FWL_ERR CFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
+FWL_Error CFWL_ScrollBar::GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->GetRange(fMin, fMax);
}
-FWL_ERR CFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
+FWL_Error CFWL_ScrollBar::SetRange(FX_FLOAT fMin, FX_FLOAT fMax) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->SetRange(fMin, fMax);
}
@@ -59,9 +59,9 @@ FX_FLOAT CFWL_ScrollBar::GetPageSize() {
return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPageSize();
}
-FWL_ERR CFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
+FWL_Error CFWL_ScrollBar::SetPageSize(FX_FLOAT fPageSize) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPageSize(fPageSize);
}
@@ -71,9 +71,9 @@ FX_FLOAT CFWL_ScrollBar::GetStepSize() {
return static_cast<IFWL_ScrollBar*>(m_pIface)->GetStepSize();
}
-FWL_ERR CFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
+FWL_Error CFWL_ScrollBar::SetStepSize(FX_FLOAT fStepSize) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->SetStepSize(fStepSize);
}
@@ -83,9 +83,9 @@ FX_FLOAT CFWL_ScrollBar::GetPos() {
return static_cast<IFWL_ScrollBar*>(m_pIface)->GetPos();
}
-FWL_ERR CFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
+FWL_Error CFWL_ScrollBar::SetPos(FX_FLOAT fPos) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->SetPos(fPos);
}
@@ -95,9 +95,9 @@ FX_FLOAT CFWL_ScrollBar::GetTrackPos() {
return static_cast<IFWL_ScrollBar*>(m_pIface)->GetTrackPos();
}
-FWL_ERR CFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
+FWL_Error CFWL_ScrollBar::SetTrackPos(FX_FLOAT fTrackPos) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return static_cast<IFWL_ScrollBar*>(m_pIface)->SetTrackPos(fTrackPos);
}
diff --git a/xfa/fwl/lightwidget/cfwl_scrollbar.h b/xfa/fwl/lightwidget/cfwl_scrollbar.h
index 89c0fe44e4..fd80e8b8ab 100644
--- a/xfa/fwl/lightwidget/cfwl_scrollbar.h
+++ b/xfa/fwl/lightwidget/cfwl_scrollbar.h
@@ -12,18 +12,18 @@
class CFWL_ScrollBar : public CFWL_Widget {
public:
static CFWL_ScrollBar* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
FX_BOOL IsVertical();
- FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
- FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
+ FWL_Error GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax);
+ FWL_Error SetRange(FX_FLOAT fMin, FX_FLOAT fMax);
FX_FLOAT GetPageSize();
- FWL_ERR SetPageSize(FX_FLOAT fPageSize);
+ FWL_Error SetPageSize(FX_FLOAT fPageSize);
FX_FLOAT GetStepSize();
- FWL_ERR SetStepSize(FX_FLOAT fStepSize);
+ FWL_Error SetStepSize(FX_FLOAT fStepSize);
FX_FLOAT GetPos();
- FWL_ERR SetPos(FX_FLOAT fPos);
+ FWL_Error SetPos(FX_FLOAT fPos);
FX_FLOAT GetTrackPos();
- FWL_ERR SetTrackPos(FX_FLOAT fTrackPos);
+ FWL_Error SetTrackPos(FX_FLOAT fTrackPos);
FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f);
CFWL_ScrollBar();
virtual ~CFWL_ScrollBar();
diff --git a/xfa/fwl/lightwidget/cfwl_theme.cpp b/xfa/fwl/lightwidget/cfwl_theme.cpp
index 65a5aaf689..594dbd84a4 100644
--- a/xfa/fwl/lightwidget/cfwl_theme.cpp
+++ b/xfa/fwl/lightwidget/cfwl_theme.cpp
@@ -64,13 +64,13 @@ uint32_t CFWL_Theme::SetThemeID(IFWL_Widget* pWidget,
return dwID;
}
-FWL_ERR CFWL_Theme::GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) {
- return FWL_ERR_Succeeded;
+FWL_Error CFWL_Theme::GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) {
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_Theme::SetThemeMatrix(IFWL_Widget* pWidget,
- const CFX_Matrix& matrix) {
- return FWL_ERR_Succeeded;
+FWL_Error CFWL_Theme::SetThemeMatrix(IFWL_Widget* pWidget,
+ const CFX_Matrix& matrix) {
+ return FWL_Error::Succeeded;
}
FX_BOOL CFWL_Theme::DrawBackground(CFWL_ThemeBackground* pParams) {
@@ -90,7 +90,8 @@ FX_BOOL CFWL_Theme::IsCustomizedLayout(IFWL_Widget* pWidget) {
return GetTheme(pWidget)->IsCustomizedLayout(pWidget);
}
-FWL_ERR CFWL_Theme::GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) {
+FWL_Error CFWL_Theme::GetPartRect(CFWL_ThemePart* pThemePart,
+ CFX_RectF& rtPart) {
return GetTheme(pThemePart->m_pWidget)->GetPartRect(pThemePart, rtPart);
}
@@ -104,30 +105,30 @@ FX_BOOL CFWL_Theme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
return GetTheme(pParams->m_pWidget)->CalcTextRect(pParams, rect);
}
-FWL_ERR CFWL_Theme::Initialize() {
+FWL_Error CFWL_Theme::Initialize() {
for (const auto& pTheme : m_ThemesArray)
pTheme->Initialize();
FWLTHEME_Init();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_Theme::Finalize() {
+FWL_Error CFWL_Theme::Finalize() {
for (const auto& pTheme : m_ThemesArray)
pTheme->Finalize();
FWLTHEME_Release();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_Theme::SetFont(IFWL_Widget* pWidget,
- const FX_WCHAR* strFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont) {
+FWL_Error CFWL_Theme::SetFont(IFWL_Widget* pWidget,
+ const FX_WCHAR* strFont,
+ FX_FLOAT fFontSize,
+ FX_ARGB rgbFont) {
for (const auto& pTheme : m_ThemesArray)
pTheme->SetFont(pWidget, strFont, fFontSize, rgbFont);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFWL_WidgetTP* CFWL_Theme::GetTheme(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/lightwidget/cfwl_theme.h b/xfa/fwl/lightwidget/cfwl_theme.h
index 110a9dbb69..ba20013c10 100644
--- a/xfa/fwl/lightwidget/cfwl_theme.h
+++ b/xfa/fwl/lightwidget/cfwl_theme.h
@@ -31,26 +31,26 @@ class CFWL_Theme : public IFWL_ThemeProvider {
uint32_t SetThemeID(IFWL_Widget* pWidget,
uint32_t dwThemeID,
FX_BOOL bChildren = TRUE) override;
- FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override;
- FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget,
- const CFX_Matrix& matrix) override;
+ FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override;
+ FWL_Error SetThemeMatrix(IFWL_Widget* pWidget,
+ const CFX_Matrix& matrix) override;
FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override;
FX_BOOL DrawText(CFWL_ThemeText* pParams) override;
void* GetCapacity(CFWL_ThemePart* pThemePart,
CFWL_WidgetCapacity dwCapacity) override;
FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override;
- FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override;
+ FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override;
FX_BOOL IsInPart(CFWL_ThemePart* pThemePart,
FX_FLOAT fx,
FX_FLOAT fy) override;
FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override;
- FWL_ERR Initialize();
- FWL_ERR Finalize();
- FWL_ERR SetFont(IFWL_Widget* pWidget,
- const FX_WCHAR* strFont,
- FX_FLOAT fFontSize,
- FX_ARGB rgbFont);
+ FWL_Error Initialize();
+ FWL_Error Finalize();
+ FWL_Error SetFont(IFWL_Widget* pWidget,
+ const FX_WCHAR* strFont,
+ FX_FLOAT fFontSize,
+ FX_ARGB rgbFont);
CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget);
protected:
diff --git a/xfa/fwl/lightwidget/cfwl_tooltip.cpp b/xfa/fwl/lightwidget/cfwl_tooltip.cpp
index efb61ce018..7a9a26cf9e 100644
--- a/xfa/fwl/lightwidget/cfwl_tooltip.cpp
+++ b/xfa/fwl/lightwidget/cfwl_tooltip.cpp
@@ -16,79 +16,73 @@ CFWL_ToolTip* CFWL_ToolTip::Create() {
return new CFWL_ToolTip;
}
-FWL_ERR CFWL_ToolTip::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_ToolTip::Initialize(const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_ToolTip> pToolTip(IFWL_ToolTip::Create(
m_pProperties->MakeWidgetImpProperties(&m_tooltipData), nullptr));
- FWL_ERR ret = pToolTip->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pToolTip->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pToolTip.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_ToolTip::GetCaption(CFX_WideString& wsCaption) {
+void CFWL_ToolTip::GetCaption(CFX_WideString& wsCaption) {
wsCaption = m_tooltipData.m_wsCaption;
- return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_ToolTip::SetCaption(const CFX_WideStringC& wsCaption) {
+void CFWL_ToolTip::SetCaption(const CFX_WideStringC& wsCaption) {
m_tooltipData.m_wsCaption = wsCaption;
- return FWL_ERR_Succeeded;
}
int32_t CFWL_ToolTip::GetInitialDelay() {
return m_tooltipData.m_nInitDelayTime;
}
-int32_t CFWL_ToolTip::SetInitialDelay(int32_t nDelayTime) {
+void CFWL_ToolTip::SetInitialDelay(int32_t nDelayTime) {
m_tooltipData.m_nInitDelayTime = nDelayTime;
- return FWL_ERR_Succeeded;
}
int32_t CFWL_ToolTip::GetAutoPopDelay() {
return m_tooltipData.m_nAutoPopDelayTime;
}
-int32_t CFWL_ToolTip::SetAutoPopDelay(int32_t nDelayTime) {
+void CFWL_ToolTip::SetAutoPopDelay(int32_t nDelayTime) {
m_tooltipData.m_nAutoPopDelayTime = nDelayTime;
- return FWL_ERR_Succeeded;
}
CFX_DIBitmap* CFWL_ToolTip::GetToolTipIcon() {
return m_tooltipData.m_pBitmap;
}
-FWL_ERR CFWL_ToolTip::SetToolTipIcon(CFX_DIBitmap* pBitmap) {
+void CFWL_ToolTip::SetToolTipIcon(CFX_DIBitmap* pBitmap) {
m_tooltipData.m_pBitmap = pBitmap;
- return FWL_ERR_Succeeded;
}
CFX_SizeF CFWL_ToolTip::GetToolTipIconSize() {
return m_tooltipData.m_fIconSize;
}
-FWL_ERR CFWL_ToolTip::SetToolTipIconSize(CFX_SizeF fSize) {
+void CFWL_ToolTip::SetToolTipIconSize(CFX_SizeF fSize) {
m_tooltipData.m_fIconSize = fSize;
- return FWL_ERR_Succeeded;
}
-FWL_ERR CFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) {
- return static_cast<IFWL_ToolTip*>(m_pIface)->SetAnchor(rtAnchor);
+void CFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) {
+ static_cast<IFWL_ToolTip*>(m_pIface)->SetAnchor(rtAnchor);
}
-FWL_ERR CFWL_ToolTip::Show() {
- return static_cast<IFWL_ToolTip*>(m_pIface)->Show();
+void CFWL_ToolTip::Show() {
+ static_cast<IFWL_ToolTip*>(m_pIface)->Show();
}
-FWL_ERR CFWL_ToolTip::Hide() {
- return static_cast<IFWL_ToolTip*>(m_pIface)->Hide();
+void CFWL_ToolTip::Hide() {
+ static_cast<IFWL_ToolTip*>(m_pIface)->Hide();
}
CFWL_ToolTip::CFWL_ToolTip() {}
@@ -102,10 +96,10 @@ CFWL_ToolTip::CFWL_ToolTipDP::CFWL_ToolTipDP() : m_pBitmap(NULL) {
m_fAnchor.Set(0.0, 0.0, 0.0, 0.0);
}
-FWL_ERR CFWL_ToolTip::CFWL_ToolTipDP::GetCaption(IFWL_Widget* pWidget,
- CFX_WideString& wsCaption) {
+FWL_Error CFWL_ToolTip::CFWL_ToolTipDP::GetCaption(IFWL_Widget* pWidget,
+ CFX_WideString& wsCaption) {
wsCaption = m_wsCaption;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_ToolTip::CFWL_ToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) {
diff --git a/xfa/fwl/lightwidget/cfwl_tooltip.h b/xfa/fwl/lightwidget/cfwl_tooltip.h
index 817362a41c..74f702849c 100644
--- a/xfa/fwl/lightwidget/cfwl_tooltip.h
+++ b/xfa/fwl/lightwidget/cfwl_tooltip.h
@@ -13,28 +13,35 @@
class CFWL_ToolTip : public CFWL_Widget {
public:
static CFWL_ToolTip* Create();
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
- FWL_ERR GetCaption(CFX_WideString& wsCaption);
- FWL_ERR SetCaption(const CFX_WideStringC& wsCaption);
+
+ CFWL_ToolTip();
+ virtual ~CFWL_ToolTip();
+
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr);
+
+ void GetCaption(CFX_WideString& wsCaption);
+ void SetCaption(const CFX_WideStringC& wsCaption);
+
int32_t GetInitialDelay();
- int32_t SetInitialDelay(int32_t nDelayTime);
+ void SetInitialDelay(int32_t nDelayTime);
+
int32_t GetAutoPopDelay();
- int32_t SetAutoPopDelay(int32_t nDelayTime);
+ void SetAutoPopDelay(int32_t nDelayTime);
+
CFX_DIBitmap* GetToolTipIcon();
- FWL_ERR SetToolTipIcon(CFX_DIBitmap* pBitmap);
+ void SetToolTipIcon(CFX_DIBitmap* pBitmap);
CFX_SizeF GetToolTipIconSize();
- FWL_ERR SetToolTipIconSize(CFX_SizeF fSize);
- FWL_ERR SetAnchor(const CFX_RectF& rtAnchor);
- FWL_ERR Show();
- FWL_ERR Hide();
- CFWL_ToolTip();
- virtual ~CFWL_ToolTip();
+ void SetToolTipIconSize(CFX_SizeF fSize);
+
+ void SetAnchor(const CFX_RectF& rtAnchor);
+ void Show();
+ void Hide();
protected:
class CFWL_ToolTipDP : public IFWL_ToolTipDP {
public:
CFWL_ToolTipDP();
- FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
+ FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption);
int32_t GetInitialDelay(IFWL_Widget* pWidget);
int32_t GetAutoPopDelay(IFWL_Widget* pWidget);
CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget);
diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp
index 96238ae348..e1959797b3 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.cpp
+++ b/xfa/fwl/lightwidget/cfwl_widget.cpp
@@ -23,9 +23,9 @@ IFWL_Widget* CFWL_Widget::GetWidget() {
return m_pIface;
}
-FWL_ERR CFWL_Widget::GetClassName(CFX_WideString& wsClass) const {
+FWL_Error CFWL_Widget::GetClassName(CFX_WideString& wsClass) const {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->GetClassName(wsClass);
}
@@ -43,33 +43,33 @@ FX_BOOL CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const {
static void* gs_pFWLWidget = (void*)FXBSTR_ID('l', 'i', 'g', 't');
-FWL_ERR CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->SetPrivateData(gs_pFWLWidget, this, nullptr);
}
-FWL_ERR CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->GetWidgetRect(rect, bAutoSize);
}
-FWL_ERR CFWL_Widget::GetGlobalRect(CFX_RectF& rect) {
+FWL_Error CFWL_Widget::GetGlobalRect(CFX_RectF& rect) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->GetGlobalRect(rect);
}
-FWL_ERR CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
+FWL_Error CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->SetWidgetRect(rect);
}
-FWL_ERR CFWL_Widget::GetClientRect(CFX_RectF& rect) {
+FWL_Error CFWL_Widget::GetClientRect(CFX_RectF& rect) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->GetClientRect(rect);
}
@@ -83,9 +83,9 @@ CFWL_Widget* CFWL_Widget::GetParent() {
return nullptr;
}
-FWL_ERR CFWL_Widget::SetParent(CFWL_Widget* pParent) {
+FWL_Error CFWL_Widget::SetParent(CFWL_Widget* pParent) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->SetParent(pParent ? pParent->GetWidget() : nullptr);
}
@@ -93,10 +93,10 @@ CFWL_Widget* CFWL_Widget::GetOwner() {
return nullptr;
}
-FWL_ERR CFWL_Widget::SetOwner(CFWL_Widget* pOwner) {
+FWL_Error CFWL_Widget::SetOwner(CFWL_Widget* pOwner) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Indefinite;
+ return FWL_Error::Succeeded;
}
uint32_t CFWL_Widget::GetStyles() {
@@ -105,10 +105,10 @@ uint32_t CFWL_Widget::GetStyles() {
return m_pIface->GetStyles();
}
-FWL_ERR CFWL_Widget::ModifyStyles(uint32_t dwStylesAdded,
- uint32_t dwStylesRemoved) {
+FWL_Error CFWL_Widget::ModifyStyles(uint32_t dwStylesAdded,
+ uint32_t dwStylesRemoved) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->ModifyStyles(dwStylesAdded, dwStylesRemoved);
}
@@ -118,14 +118,14 @@ uint32_t CFWL_Widget::GetStylesEx() {
return m_pIface->GetStylesEx();
}
-FWL_ERR CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded,
- uint32_t dwStylesExRemoved) {
+FWL_Error CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved) {
return m_pIface->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
uint32_t CFWL_Widget::GetStates() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return 0;
return m_pIface->GetStates();
}
@@ -134,11 +134,11 @@ void CFWL_Widget::SetStates(uint32_t dwStates, FX_BOOL bSet) {
m_pIface->SetStates(dwStates, bSet);
}
-FWL_ERR CFWL_Widget::SetPrivateData(void* module_id,
- void* pData,
- PD_CALLBACK_FREEDATA callback) {
+FWL_Error CFWL_Widget::SetPrivateData(void* module_id,
+ void* pData,
+ PD_CALLBACK_FREEDATA callback) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->SetPrivateData(module_id, pData, callback);
}
@@ -148,21 +148,21 @@ void* CFWL_Widget::GetPrivateData(void* module_id) {
return m_pIface->GetPrivateData(module_id);
}
-FWL_ERR CFWL_Widget::Update() {
+FWL_Error CFWL_Widget::Update() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->Update();
}
-FWL_ERR CFWL_Widget::LockUpdate() {
+FWL_Error CFWL_Widget::LockUpdate() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->LockUpdate();
}
-FWL_ERR CFWL_Widget::UnlockUpdate() {
+FWL_Error CFWL_Widget::UnlockUpdate() {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->UnlockUpdate();
}
@@ -172,37 +172,37 @@ FWL_WidgetHit CFWL_Widget::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
return m_pIface->HitTest(fx, fy);
}
-FWL_ERR CFWL_Widget::TransformTo(CFWL_Widget* pWidget,
- FX_FLOAT& fx,
- FX_FLOAT& fy) {
+FWL_Error CFWL_Widget::TransformTo(CFWL_Widget* pWidget,
+ FX_FLOAT& fx,
+ FX_FLOAT& fy) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->TransformTo(pWidget ? pWidget->GetWidget() : nullptr, fx,
fy);
}
-FWL_ERR CFWL_Widget::TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt) {
+FWL_Error CFWL_Widget::TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->TransformTo(pWidget ? pWidget->GetWidget() : nullptr, rt);
}
-FWL_ERR CFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
+FWL_Error CFWL_Widget::GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->GetMatrix(matrix, bGlobal);
}
-FWL_ERR CFWL_Widget::SetMatrix(const CFX_Matrix& matrix) {
+FWL_Error CFWL_Widget::SetMatrix(const CFX_Matrix& matrix) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->SetMatrix(matrix);
}
-FWL_ERR CFWL_Widget::DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
+FWL_Error CFWL_Widget::DrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
return m_pIface->DrawWidget(pGraphics, pMatrix);
}
@@ -229,9 +229,9 @@ CFWL_Widget::~CFWL_Widget() {
}
}
-FWL_ERR CFWL_Widget::Repaint(const CFX_RectF* pRect) {
+FWL_Error CFWL_Widget::Repaint(const CFX_RectF* pRect) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFX_RectF rect;
if (pRect) {
@@ -243,17 +243,17 @@ FWL_ERR CFWL_Widget::Repaint(const CFX_RectF* pRect) {
return m_pWidgetMgr->RepaintWidget(m_pIface, &rect);
}
-FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) {
+FWL_Error CFWL_Widget::SetFocus(FX_BOOL bFocus) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
IFWL_App* pApp = m_pIface->GetOwnerApp();
if (!pApp)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (bFocus) {
pDriver->SetFocus(m_pIface);
@@ -262,23 +262,23 @@ FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) {
pDriver->SetFocus(nullptr);
}
}
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_Widget::SetGrab(FX_BOOL bSet) {
+FWL_Error CFWL_Widget::SetGrab(FX_BOOL bSet) {
if (!m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
IFWL_App* pApp = m_pIface->GetOwnerApp();
if (!pApp)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFWL_NoteDriver* pDriver = pApp->GetNoteDriver();
if (!pDriver)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
pDriver->SetGrab(m_pIface, bSet);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void CFWL_Widget::RegisterEventTarget(CFWL_Widget* pEventSource,
diff --git a/xfa/fwl/lightwidget/cfwl_widget.h b/xfa/fwl/lightwidget/cfwl_widget.h
index 5ec370ecea..fd30b71b4c 100644
--- a/xfa/fwl/lightwidget/cfwl_widget.h
+++ b/xfa/fwl/lightwidget/cfwl_widget.h
@@ -21,41 +21,43 @@ class CFWL_Widget {
public:
virtual ~CFWL_Widget();
IFWL_Widget* GetWidget();
- FWL_ERR GetClassName(CFX_WideString& wsClass) const;
+ FWL_Error GetClassName(CFX_WideString& wsClass) const;
uint32_t GetClassID() const;
virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const;
- FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
- FWL_ERR GetGlobalRect(CFX_RectF& rect);
- FWL_ERR SetWidgetRect(const CFX_RectF& rect);
- FWL_ERR GetClientRect(CFX_RectF& rtClient);
+ FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
+ FWL_Error GetGlobalRect(CFX_RectF& rect);
+ FWL_Error SetWidgetRect(const CFX_RectF& rect);
+ FWL_Error GetClientRect(CFX_RectF& rtClient);
CFWL_Widget* GetParent();
- FWL_ERR SetParent(CFWL_Widget* pParent);
+ FWL_Error SetParent(CFWL_Widget* pParent);
CFWL_Widget* GetOwner();
- FWL_ERR SetOwner(CFWL_Widget* pOwner);
+ FWL_Error SetOwner(CFWL_Widget* pOwner);
uint32_t GetStyles();
- FWL_ERR ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved);
+ FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved);
uint32_t GetStylesEx();
- FWL_ERR ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved);
+ FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded,
+ uint32_t dwStylesExRemoved);
uint32_t GetStates();
void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
- FWL_ERR SetPrivateData(void* module_id,
- void* pData,
- PD_CALLBACK_FREEDATA callback);
+ FWL_Error SetPrivateData(void* module_id,
+ void* pData,
+ PD_CALLBACK_FREEDATA callback);
void* GetPrivateData(void* module_id);
- FWL_ERR Update();
- FWL_ERR LockUpdate();
- FWL_ERR UnlockUpdate();
+ FWL_Error Update();
+ FWL_Error LockUpdate();
+ FWL_Error UnlockUpdate();
FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy);
- FWL_ERR TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy);
- FWL_ERR TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt);
- FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
- FWL_ERR SetMatrix(const CFX_Matrix& matrix);
- FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL);
+ FWL_Error TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy);
+ FWL_Error TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt);
+ FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
+ FWL_Error SetMatrix(const CFX_Matrix& matrix);
+ FWL_Error DrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate);
- FWL_ERR Repaint(const CFX_RectF* pRect = NULL);
- FWL_ERR SetFocus(FX_BOOL bFocus);
- FWL_ERR SetGrab(FX_BOOL bSet);
+ FWL_Error Repaint(const CFX_RectF* pRect = NULL);
+ FWL_Error SetFocus(FX_BOOL bFocus);
+ FWL_Error SetGrab(FX_BOOL bSet);
CFWL_Widget();
void RegisterEventTarget(CFWL_Widget* pEventSource = NULL,
@@ -70,7 +72,7 @@ class CFWL_Widget {
CFWL_WidgetProperties* m_pProperties;
protected:
- FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL);
+ FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL);
};
#endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_
diff --git a/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp b/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp
index 1596aba48a..fcb7232622 100644
--- a/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp
+++ b/xfa/fwl/lightwidget/cfwl_widgetdelegate.cpp
@@ -13,15 +13,9 @@ CFWL_WidgetDelegate::CFWL_WidgetDelegate() {}
CFWL_WidgetDelegate::~CFWL_WidgetDelegate() {}
-int32_t CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message* pMessage) {
- return 1;
-}
-
-FWL_ERR CFWL_WidgetDelegate::OnProcessEvent(CFWL_Event* pEvent) {
- return FWL_ERR_Succeeded;
-}
-
-FWL_ERR CFWL_WidgetDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return FWL_ERR_Succeeded;
-}
+void CFWL_WidgetDelegate::OnProcessMessage(CFWL_Message* pMessage) {}
+
+void CFWL_WidgetDelegate::OnProcessEvent(CFWL_Event* pEvent) {}
+
+void CFWL_WidgetDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {}
diff --git a/xfa/fwl/lightwidget/cfwl_widgetdelegate.h b/xfa/fwl/lightwidget/cfwl_widgetdelegate.h
index 42f6f9329f..1f5cdab8f4 100644
--- a/xfa/fwl/lightwidget/cfwl_widgetdelegate.h
+++ b/xfa/fwl/lightwidget/cfwl_widgetdelegate.h
@@ -7,6 +7,8 @@
#ifndef XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_
#define XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_
+#include <stdint.h>
+
#include "xfa/fwl/core/fwl_error.h"
#include "xfa/fwl/core/ifwl_widgetdelegate.h"
@@ -20,10 +22,10 @@ class CFWL_WidgetDelegate : public IFWL_WidgetDelegate {
CFWL_WidgetDelegate();
virtual ~CFWL_WidgetDelegate();
- int32_t OnProcessMessage(CFWL_Message* pMessage) override;
- FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override;
- FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = nullptr) override;
+ void OnProcessMessage(CFWL_Message* pMessage) override;
+ void OnProcessEvent(CFWL_Event* pEvent) override;
+ void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = nullptr) override;
};
#endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGETDELEGATE_H_