summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-22 13:41:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-30 14:32:12 +0200
commit374599f8c26713905a310673d2b429083321186a (patch)
tree2ee4be182670b2ca9396a5f42d4122bed806a3ba /include
parent2d3a5e81e9730c1190f8592f85f5b99b6d4587ef (diff)
weld SvxCharacterMap dialog
and SmSymDefineDialog There's a whole bunch of interrelated stuff which needs to work at the same time. add menu support, keyboard support, better mouse support, a gtk scrollable adaptor to support pseudo scrolling drawing bodge, plugable uitest support for custom widgets, plugable a11y support for custom widgets via the existing atk_object_wrapper_new wrapper for XAccessible In this specific case, change SvxCharacterMap from something that has an internal scrollbar to a scrolledwindow where the scrollbar is external, which drops the need for the a11y impl of SvxCharacterMap to emulate being a scrolled window and internal table and just needs the table a11y impl Change-Id: Ia2743d6958021c525a1900154dcbb69ae33fc400 Reviewed-on: https://gerrit.libreoffice.org/52084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/charmapcontrol.hxx8
-rw-r--r--include/sfx2/charwin.hxx69
-rw-r--r--include/svx/charmap.hxx67
-rw-r--r--include/svx/searchcharmap.hxx16
-rw-r--r--include/svx/strings.hrc5
-rw-r--r--include/svx/svxdlg.hxx4
-rw-r--r--include/vcl/layout.hxx73
-rw-r--r--include/vcl/weld.hxx68
8 files changed, 232 insertions, 78 deletions
diff --git a/include/sfx2/charmapcontrol.hxx b/include/sfx2/charmapcontrol.hxx
index 92796714d326..716f7ba05d26 100644
--- a/include/sfx2/charmapcontrol.hxx
+++ b/include/sfx2/charmapcontrol.hxx
@@ -27,7 +27,7 @@
#include <sfx2/charwin.hxx>
#include <vcl/button.hxx>
-class SvxCharView;
+class SvxCharViewControl;
class SFX2_DLLPUBLIC SfxCharmapCtrl : public SfxPopupWindow
{
@@ -40,15 +40,15 @@ public:
virtual void dispose() override;
private:
- VclPtr<SvxCharView> m_pRecentCharView[16];
- VclPtr<SvxCharView> m_pFavCharView[16];
+ VclPtr<SvxCharViewControl> m_pRecentCharView[16];
+ VclPtr<SvxCharViewControl> m_pFavCharView[16];
std::deque<OUString> maRecentCharList;
std::deque<OUString> maRecentCharFontList;
std::deque<OUString> maFavCharList;
std::deque<OUString> maFavCharFontList;
VclPtr<Button> maDlgBtn;
- DECL_LINK(CharClickHdl, SvxCharView*, void);
+ DECL_LINK(CharClickHdl, SvxCharViewControl*, void);
DECL_STATIC_LINK(SfxCharmapCtrl, LoseFocusHdl, Control&, void);
DECL_LINK(OpenDlgHdl, Button*, void);
diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
index f8c01a141ecc..197812142f07 100644
--- a/include/sfx2/charwin.hxx
+++ b/include/sfx2/charwin.hxx
@@ -22,27 +22,78 @@
#include <sfx2/tbxctrl.hxx>
#include <sfx2/dllapi.h>
+#include <vcl/weld.hxx>
-class SFX2_DLLPUBLIC SvxCharView : public Control
+class SFX2_DLLPUBLIC SvxCharView
{
+private:
+ VclPtr<VirtualDevice> mxVirDev;
+ std::unique_ptr<weld::DrawingArea> mxDrawingArea;
+ Size m_aSize;
+ long mnY;
+ Point maPosition;
+ vcl::Font maFont;
+ bool maHasInsert;
+ OUString m_sText;
+
+ Link<SvxCharView*, void> maMouseClickHdl;
+ Link<SvxCharView*, void> maClearClickHdl;
+ Link<SvxCharView*, void> maClearAllClickHdl;
+
+
+ DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
+ DECL_LINK(DoResize, const Size& rSize, void);
+ DECL_LINK(DoMouseButtonDown, const MouseEvent&, void);
+ DECL_LINK(DoKeyDown, const KeyEvent&, bool);
public:
- SvxCharView(vcl::Window* pParent);
+ SvxCharView(weld::Builder& rBuilder, const OString& rId, const VclPtr<VirtualDevice>& rVirDev);
void SetFont( const vcl::Font& rFont );
- void SetText( const OUString& rText ) override;
+ vcl::Font GetFont() const { return maFont; }
+ void SetText( const OUString& rText );
+ OUString GetText() const { return m_sText; }
+ void Show() { mxDrawingArea->show(); }
+ void Hide() { mxDrawingArea->hide(); }
void SetHasInsert( bool bInsert );
void InsertCharToDoc();
void createContextMenu();
- virtual void Resize() override;
+ void grab_focus() { mxDrawingArea->grab_focus(); }
+ void queue_draw() { mxDrawingArea->queue_draw(); }
+ Size get_preferred_size() const { return mxDrawingArea->get_preferred_size(); }
+
+ void connect_focus_in(const Link<weld::Widget&, void>& rLink) { mxDrawingArea->connect_focus_in(rLink); }
+ void connect_focus_out(const Link<weld::Widget&, void>& rLink) { mxDrawingArea->connect_focus_out(rLink); }
- virtual Size GetOptimalSize() const override;
void setMouseClickHdl(const Link<SvxCharView*,void> &rLink);
void setClearClickHdl(const Link<SvxCharView*,void> &rLink);
void setClearAllClickHdl(const Link<SvxCharView*,void> &rLink);
+ void ContextMenuSelect(const OString& rIdent);
+};
+
+class SFX2_DLLPUBLIC SvxCharViewControl : public Control
+{
+public:
+ SvxCharViewControl(vcl::Window* pParent);
+
+ void SetFont( const vcl::Font& rFont );
+ void SetText( const OUString& rText ) override;
+ void SetHasInsert( bool bInsert );
+ void InsertCharToDoc();
+
+ void createContextMenu();
+
+ virtual void Resize() override;
+
+ virtual Size GetOptimalSize() const override;
+
+ void setMouseClickHdl(const Link<SvxCharViewControl*,void> &rLink);
+ void setClearClickHdl(const Link<SvxCharViewControl*,void> &rLink);
+ void setClearAllClickHdl(const Link<SvxCharViewControl*,void> &rLink);
+
DECL_LINK(ContextMenuSelectHdl, Menu*, bool);
protected:
@@ -58,9 +109,11 @@ private:
vcl::Font maFont;
bool maHasInsert;
- Link<SvxCharView*, void> maMouseClickHdl;
- Link<SvxCharView*, void> maClearClickHdl;
- Link<SvxCharView*, void> maClearAllClickHdl;
+ Link<SvxCharViewControl*, void> maMouseClickHdl;
+ Link<SvxCharViewControl*, void> maClearClickHdl;
+ Link<SvxCharViewControl*, void> maClearAllClickHdl;
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 2cb8702ca5ba..3df37695eb75 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -35,6 +35,7 @@
#include <vcl/outdev.hxx>
#include <vcl/metric.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/weld.hxx>
#include <vcl/window.hxx>
#include <vcl/textview.hxx>
@@ -49,22 +50,25 @@ using namespace ::com::sun::star;
#define COLUMN_COUNT 16
#define ROW_COUNT 8
-class CommandEvent;
-class ScrollBar;
-
namespace svx
{
struct SvxShowCharSetItem;
- class SvxShowCharSetVirtualAcc;
+ class SvxShowCharSetAcc;
}
-class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxShowCharSet : public Control
+class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxShowCharSet
{
+protected:
+ VclPtr<VirtualDevice> mxVirDev;
+ std::unique_ptr<weld::DrawingArea> mxDrawingArea;
+ std::unique_ptr<weld::ScrolledWindow> mxScrollArea;
+ vcl::Font maFont;
+ Size maSize;
public:
- SvxShowCharSet( vcl::Window* pParent );
- virtual ~SvxShowCharSet() override;
- virtual void dispose() override;
- virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
+ SvxShowCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
+ const OString& rScrollId, const VclPtr<VirtualDevice>& rVirDev);
+
+ virtual ~SvxShowCharSet();
virtual void RecalculateFont(vcl::RenderContext& rRenderContext);
@@ -79,6 +83,8 @@ public:
void SetFavClickHdl( const Link<SvxShowCharSet*,void>& rHdl ) { aFavClickHdl = rHdl; }
static sal_uInt32& getSelectedChar();
void SetFont( const vcl::Font& rFont );
+ vcl::Font GetFont() const { return mxVirDev->GetFont(); }
+ bool GetFontCharMap(FontCharMapRef& rxFontCharMap) const { return mxVirDev->GetFontCharMap(rxFontCharMap); }
bool isFavChar(const OUString& sTitle, const OUString& rFont);
void getFavCharacterList(); //gets both Fav char and Fav char font list
void updateFavCharacterList(const OUString& rChar, const OUString& rFont);
@@ -96,27 +102,29 @@ public:
static sal_uInt16 GetRowPos(sal_uInt16 _nPos);
static sal_uInt16 GetColumnPos(sal_uInt16 _nPos);
- ScrollBar& getScrollBar() { return *aVscrollSB.get();}
- void ReleaseAccessible();
virtual sal_Int32 getMaxCharCount() const;
- virtual void Resize() override;
+ void Show() { mxScrollArea->show(); }
+ void Hide() { mxScrollArea->hide(); }
+ bool HasFocus() const { return mxDrawingArea->has_focus(); }
+ void GrabFocus() { mxDrawingArea->grab_focus(); }
+ bool IsEnabled() const { return mxDrawingArea->get_sensitive(); }
+ bool IsVisible() const { return mxDrawingArea->get_visible(); }
+ const Size& GetSize() const { return maSize; }
- virtual FactoryFunction GetUITestFactory() const override;
+ uno::Reference<css::accessibility::XAccessible> getAccessibleParent() { return mxDrawingArea->get_accessible_parent(); }
-protected:
- virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override;
- virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
- virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
- virtual void MouseMove( const MouseEvent& rMEvt ) override;
- virtual void Command( const CommandEvent& rCEvt ) override;
- virtual void KeyInput( const KeyEvent& rKEvt ) override;
- virtual void GetFocus() override;
- virtual void LoseFocus() override;
- virtual void StateChanged( StateChangedType nStateChange ) override;
- virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
-
- virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
+private:
+ DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
+ DECL_LINK(DoResize, const Size& rSize, void);
+ DECL_LINK(DoMouseButtonDown, const MouseEvent& rMEvt, void);
+ DECL_LINK(DoMouseMove, const MouseEvent& rMEvt, void);
+ DECL_LINK(DoMouseButtonUp, const MouseEvent& rMEvt, void);
+ DECL_LINK(DoKeyDown, const KeyEvent& rKEvt, bool);
+ DECL_LINK(DoGetFocus, weld::Widget&, void);
+ DECL_LINK(DoLoseFocus, weld::Widget&, void);
+
+ css::uno::Reference<css::accessibility::XAccessible> CreateAccessible();
protected:
typedef std::map<sal_Int32, std::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap;
@@ -130,7 +138,7 @@ protected:
std::deque<OUString> maFavCharList;
std::deque<OUString> maFavCharFontList;
- rtl::Reference<svx::SvxShowCharSetVirtualAcc> m_xAccessible;
+ rtl::Reference<svx::SvxShowCharSetAcc> m_xAccessible;
uno::Reference< uno::XComponentContext > mxContext;
long nX;
long nY;
@@ -143,7 +151,6 @@ protected:
FontCharMapRef mxFontCharMap;
Size maFontSize;
Point maPosition;
- VclPtr<ScrollBar> aVscrollSB;
bool mbRecalculateFont : 1;
bool mbUpdateForeground : 1;
@@ -155,8 +162,8 @@ protected:
void InitSettings(vcl::RenderContext& rRenderContext);
// abstraction layers are: Unicode<->MapIndex<->Pixel
Point MapIndexToPixel( int) const;
- DECL_LINK(VscrollHdl, ScrollBar*, void);
- DECL_LINK(ContextMenuSelectHdl, Menu*, bool);
+ DECL_LINK(VscrollHdl, weld::ScrolledWindow&, void);
+ void ContextMenuSelect(const OString& rIdent);
void init();
tools::Rectangle getGridRectangle(const Point &rPointUL, const Size &rOutputSize);
diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx
index cfb46036b5f4..8f23c4b96d5a 100644
--- a/include/svx/searchcharmap.hxx
+++ b/include/svx/searchcharmap.hxx
@@ -50,18 +50,12 @@ namespace vcl { class Font; }
class CommandEvent;
class ScrollBar;
-namespace svx
-{
- struct SvxShowCharSetItem;
- class SvxShowCharSetVirtualAcc;
-}
-
class SVX_DLLPUBLIC SvxSearchCharSet : public SvxShowCharSet
{
public:
- SvxSearchCharSet( vcl::Window* pParent );
+ SvxSearchCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
+ const OString& rScrollId, const VclPtr<VirtualDevice> &rDevice);
virtual ~SvxSearchCharSet() override;
- virtual void dispose() override;
virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override;
@@ -76,10 +70,6 @@ public:
virtual sal_Int32 getMaxCharCount() const override;
-protected:
- virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override;
- virtual void KeyInput( const KeyEvent& rKEvt ) override;
-
private:
sal_Int32 nCount;
@@ -88,6 +78,8 @@ private:
std::unordered_map<sal_Int32, sal_UCS4> m_aItemList;
private:
virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
+ DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
+ DECL_LINK(DoKeyDown, const KeyEvent&, bool);
};
#endif
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index c9f4fd2b2cec..16dbd5f4673e 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1356,11 +1356,6 @@
// String for saving modified image (instead of original)
#define RID_SVXSTR_SAVE_MODIFIED_IMAGE NC_("RID_SVXSTR_SAVE_MODIFIED_IMAGE", "The image has been modified. By default the original image will be saved.\nDo you want to save the modified version instead?")
-#define RID_ADD_TO_FAVORITES NC_("RID_SUBSETMAP", "Add to favorites")
-#define RID_REMOVE_FAVORITES NC_("RID_SUBSETMAP", "Remove from favorites")
-#define RID_INSERT NC_("RID_SUBSETMAP", "Insert into document")
-#define RID_COPY_CLIPBOARD NC_("RID_SUBSETMAP", "Copy to clipboard")
-
#define RID_SUBSETSTR_BASIC_LATIN NC_("RID_SUBSETMAP", "Basic Latin")
#define RID_SUBSETSTR_LATIN_1 NC_("RID_SUBSETMAP", "Latin-1")
#define RID_SUBSETSTR_LATIN_EXTENDED_A NC_("RID_SUBSETMAP", "Latin Extended-A")
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index dff3fc05a20d..3899e4a6f204 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -438,9 +438,7 @@ public:
const SfxItemSet& rAttr,
const SdrView* pView,
sal_uInt32 nResId )=0;
- virtual VclPtr<SfxAbstractDialog> CreateCharMapDialog( vcl::Window* pParent,
- const SfxItemSet& rAttr,
- bool bInsert )=0;
+ virtual VclPtr<SfxAbstractDialog> CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, bool bInsert) = 0;
virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog( vcl::Window* pParent,
const SfxItemSet& rAttr,
const css::uno::Reference< css::frame::XFrame >& _rxFrame )=0;
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 6af0686775d0..47b80fdfb6e8 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -613,11 +613,15 @@ public:
class VCL_DLLPUBLIC VclDrawingArea : public Control
{
private:
+ FactoryFunction m_pFactoryFunction;
+ void* m_pUserData;
Link<std::pair<vcl::RenderContext&, const tools::Rectangle&>, void> m_aPaintHdl;
Link<const Size&, void> m_aResizeHdl;
- Link<const Point&, void> m_aMousePressHdl;
- Link<const Point&, void> m_aMouseMotionHdl;
- Link<const Point&, void> m_aMouseReleaseHdl;
+ Link<const MouseEvent&, void> m_aMousePressHdl;
+ Link<const MouseEvent&, void> m_aMouseMotionHdl;
+ Link<const MouseEvent&, void> m_aMouseReleaseHdl;
+ Link<const KeyEvent&, bool> m_aKeyPressHdl;
+ Link<const KeyEvent&, bool> m_aKeyReleaseHdl;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override
{
@@ -629,22 +633,65 @@ private:
}
virtual void MouseMove(const MouseEvent& rMEvt) override
{
- m_aMouseMotionHdl.Call(rMEvt.GetPosPixel());
+ m_aMouseMotionHdl.Call(rMEvt);
}
virtual void MouseButtonDown(const MouseEvent& rMEvt) override
{
- m_aMousePressHdl.Call(rMEvt.GetPosPixel());
+ m_aMousePressHdl.Call(rMEvt);
}
virtual void MouseButtonUp(const MouseEvent& rMEvt) override
{
- m_aMouseReleaseHdl.Call(rMEvt.GetPosPixel());
+ m_aMouseReleaseHdl.Call(rMEvt);
+ }
+ virtual void KeyInput(const KeyEvent& rKEvt) override
+ {
+ if (!m_aKeyPressHdl.Call(rKEvt))
+ Control::KeyInput(rKEvt);
+
+ }
+ virtual void KeyUp(const KeyEvent& rKEvt) override
+ {
+ if (!m_aKeyReleaseHdl.Call(rKEvt))
+ Control::KeyUp(rKEvt);
+ }
+
+ virtual void StateChanged(StateChangedType nType) override
+ {
+ Control::StateChanged(nType);
+ if (nType == StateChangedType::ControlForeground || nType == StateChangedType::ControlBackground)
+ Invalidate();
+ }
+
+ virtual void DataChanged(const DataChangedEvent& rDCEvt) override
+ {
+ Control::DataChanged(rDCEvt);
+ if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
+ Invalidate();
+ }
+
+ virtual FactoryFunction GetUITestFactory() const override
+ {
+ if (m_pFactoryFunction)
+ return m_pFactoryFunction;
+ return Control::GetUITestFactory();
}
public:
VclDrawingArea(vcl::Window *pParent, WinBits nStyle)
: Control(pParent, nStyle)
+ , m_pFactoryFunction(nullptr)
+ , m_pUserData(nullptr)
{
}
+ void SetUITestFactory(FactoryFunction pFactoryFunction, void* pUserData)
+ {
+ m_pFactoryFunction = pFactoryFunction;
+ m_pUserData = pUserData;
+ }
+ void* GetUserData() const
+ {
+ return m_pUserData;
+ }
void SetPaintHdl(const Link<std::pair<vcl::RenderContext&, const tools::Rectangle&>, void>& rLink)
{
m_aPaintHdl = rLink;
@@ -653,18 +700,26 @@ public:
{
m_aResizeHdl = rLink;
}
- void SetMousePressHdl(const Link<const Point&, void>& rLink)
+ void SetMousePressHdl(const Link<const MouseEvent&, void>& rLink)
{
m_aMousePressHdl = rLink;
}
- void SetMouseMoveHdl(const Link<const Point&, void>& rLink)
+ void SetMouseMoveHdl(const Link<const MouseEvent&, void>& rLink)
{
m_aMouseMotionHdl = rLink;
}
- void SetMouseReleaseHdl(const Link<const Point&, void>& rLink)
+ void SetMouseReleaseHdl(const Link<const MouseEvent&, void>& rLink)
{
m_aMouseReleaseHdl = rLink;
}
+ void SetKeyPressHdl(const Link<const KeyEvent&, bool>& rLink)
+ {
+ m_aKeyPressHdl = rLink;
+ }
+ void SetKeyReleaseHdl(const Link<const KeyEvent&, bool>& rLink)
+ {
+ m_aKeyReleaseHdl = rLink;
+ }
};
//Get first window of a pTopLevel window as
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 4a8340e1ed63..e791724c0a43 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -71,6 +71,9 @@ public:
virtual void connect_focus_in(const Link<Widget&, void>& rLink) = 0;
virtual void connect_focus_out(const Link<Widget&, void>& rLink) = 0;
+ virtual void grab_add() = 0;
+ virtual void grab_remove() = 0;
+
virtual Container* weld_parent() const = 0;
virtual ~Widget() {}
@@ -83,6 +86,26 @@ public:
virtual void add(weld::Widget* pWidget) = 0;
};
+class VCL_DLLPUBLIC ScrolledWindow : virtual public Container
+{
+protected:
+ Link<ScrolledWindow&, void> m_aVChangeHdl;
+
+ void signal_vadjustment_changed() { m_aVChangeHdl.Call(*this); }
+
+public:
+ virtual void set_user_managed_scrolling() = 0;
+ virtual void vadjustment_configure(int value, int lower, int upper, int step_increment,
+ int page_increment, int page_size)
+ = 0;
+ virtual int vadjustment_get_value() const = 0;
+ virtual void vadjustment_set_value(int value) = 0;
+ void connect_vadjustment_changed(const Link<ScrolledWindow&, void>& rLink)
+ {
+ m_aVChangeHdl = rLink;
+ }
+};
+
class VCL_DLLPUBLIC Frame : virtual public Container
{
public:
@@ -199,6 +222,12 @@ public:
void set_active(const OUString& rStr) { set_active(find_text(rStr)); }
+ virtual void set_entry_text(const OUString& rStr) = 0;
+ virtual void select_entry_region(int nStartPos, int nEndPos) = 0;
+ virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0;
+
+ virtual void unset_entry_completion() = 0;
+
void save_value() { m_sSavedValue = get_active_text(); }
bool get_value_changed_from_saved() const { return m_sSavedValue != get_active_text(); }
@@ -341,6 +370,7 @@ public:
virtual void set_width_chars(int nChars) = 0;
virtual void set_max_length(int nChars) = 0;
virtual void select_region(int nStartPos, int nEndPos) = 0;
+ virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0;
virtual void set_position(int nCursorPos) = 0;
virtual void set_editable(bool bEditable) = 0;
@@ -545,21 +575,41 @@ public:
protected:
Link<draw_args, void> m_aDrawHdl;
Link<const Size&, void> m_aSizeAllocateHdl;
- Link<const Point&, void> m_aMousePressHdl;
- Link<const Point&, void> m_aMouseMotionHdl;
- Link<const Point&, void> m_aMouseReleaseHdl;
+ Link<const MouseEvent&, void> m_aMousePressHdl;
+ Link<const MouseEvent&, void> m_aMouseMotionHdl;
+ Link<const MouseEvent&, void> m_aMouseReleaseHdl;
+ Link<const KeyEvent&, bool> m_aKeyPressHdl;
+ Link<const KeyEvent&, bool> m_aKeyReleaseHdl;
public:
void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; }
void connect_size_allocate(const Link<const Size&, void>& rLink) { m_aSizeAllocateHdl = rLink; }
- void connect_mouse_press(const Link<const Point&, void>& rLink) { m_aMousePressHdl = rLink; }
- void connect_mouse_move(const Link<const Point&, void>& rLink) { m_aMouseMotionHdl = rLink; }
- void connect_mouse_release(const Link<const Point&, void>& rLink)
+ void connect_mouse_press(const Link<const MouseEvent&, void>& rLink)
+ {
+ m_aMousePressHdl = rLink;
+ }
+ void connect_mouse_move(const Link<const MouseEvent&, void>& rLink)
+ {
+ m_aMouseMotionHdl = rLink;
+ }
+ void connect_mouse_release(const Link<const MouseEvent&, void>& rLink)
{
m_aMouseReleaseHdl = rLink;
}
+ void connect_key_press(const Link<const KeyEvent&, bool>& rLink) { m_aKeyPressHdl = rLink; }
+ void connect_key_release(const Link<const KeyEvent&, bool>& rLink) { m_aKeyReleaseHdl = rLink; }
virtual void queue_draw() = 0;
virtual void queue_draw_area(int x, int y, int width, int height) = 0;
+ virtual a11yref get_accessible_parent() = 0;
+};
+
+class VCL_DLLPUBLIC Menu
+{
+public:
+ virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0;
+ virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0;
+ virtual void show(const OString& rIdent, bool bShow) = 0;
+ virtual ~Menu() {}
};
class VCL_DLLPUBLIC Builder
@@ -583,6 +633,8 @@ public:
virtual Container* weld_container(const OString& id, bool bTakeOwnership = false) = 0;
virtual Button* weld_button(const OString& id, bool bTakeOwnership = false) = 0;
virtual Frame* weld_frame(const OString& id, bool bTakeOwnership = false) = 0;
+ virtual ScrolledWindow* weld_scrolled_window(const OString& id, bool bTakeOwnership = false)
+ = 0;
virtual Notebook* weld_notebook(const OString& id, bool bTakeOwnership = false) = 0;
virtual RadioButton* weld_radio_button(const OString& id, bool bTakeOwnership = false) = 0;
virtual CheckButton* weld_check_button(const OString& id, bool bTakeOwnership = false) = 0;
@@ -598,8 +650,10 @@ public:
virtual Expander* weld_expander(const OString& id, bool bTakeOwnership = false) = 0;
virtual Entry* weld_entry(const OString& id, bool bTakeOwnership = false) = 0;
virtual DrawingArea* weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr,
- bool bTakeOwnership = false)
+ FactoryFunction pUITestFactoryFunction = nullptr,
+ void* pUserData = nullptr, bool bTakeOwnership = false)
= 0;
+ virtual Menu* weld_menu(const OString& id, bool bTakeOwnership = true) = 0;
virtual ~Builder() {}
};