summaryrefslogtreecommitdiff
path: root/include/svx
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/svx
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/svx')
-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
4 files changed, 42 insertions, 50 deletions
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;