summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-22 15:59:00 +0000
committerSzymon Kłos <szymon.klos@collabora.com>2020-05-21 11:08:16 +0200
commit598d8c004fb02036d12ab362aa3711bbd760cfaf (patch)
tree80cddf149a125eaf79d4967013f0748c8e6051f4 /include
parentba4a10160dcc138da25161c84dd71c7be23f55a5 (diff)
weld SvxSearchDialog
I have to use the other way to specify an a11y role, both are implemented in the vcl parser, but in my gtk3-3.24.7 the role tag crashes the gtk parser, while the other route works fine. The CONTENT_FLOWS_TO accessibility relation is another additional complexity over the norm Change-Id: Ia096bcbe9f00f9944e4e4d5ad9bb1a52d19c7b3f Reviewed-on: https://gerrit.libreoffice.org/69569 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94592 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/srchdlg.hxx189
-rw-r--r--include/vcl/salvtables.hxx8
-rw-r--r--include/vcl/weld.hxx8
-rw-r--r--include/vcl/window.hxx4
4 files changed, 113 insertions, 96 deletions
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 4b82db88fe7c..3870dc57c63a 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -89,13 +89,13 @@ enum class SearchLabel
class SvxSearchDialog;
class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow
{
- VclPtr<SvxSearchDialog> dialog;
+ std::shared_ptr<SvxSearchDialog> dialog;
public:
SvxSearchDialogWrapper( vcl::Window*pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo const * pInfo );
virtual ~SvxSearchDialogWrapper () override;
- SvxSearchDialog *getDialog () { return dialog;}
+ SvxSearchDialog *getDialog () { return dialog.get();}
static void SetSearchLabel(const SearchLabel& rSL);
static void SetSearchLabel(const OUString& sStr);
static OUString GetSearchLabel();
@@ -109,18 +109,18 @@ public:
*/
-class SvxSearchDialog : public SfxModelessDialog
+class SVX_DLLPUBLIC SvxSearchDialog : public SfxModelessDialogController
{
friend class SvxSearchController;
friend class SvxSearchDialogWrapper;
friend class SvxJSearchOptionsDialog;
public:
- SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
+ SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
virtual ~SvxSearchDialog() override;
- virtual void dispose() override;
- virtual bool Close() override;
+ virtual void EndDialog();
+ virtual void Close();
// Window
virtual void Activate() override;
@@ -132,73 +132,16 @@ public:
TransliterationFlags GetTransliterationFlags() const;
- void SetDocWin( vcl::Window* pDocWin ) { mpDocWin = pDocWin; }
- vcl::Window* GetDocWin() { return mpDocWin; }
+ void SetDocWin(vcl::Window* pDocWin);
void SetSrchFlag( bool bSuccess ) { mbSuccess = bSuccess; }
bool GetSrchFlag() { return mbSuccess; }
- virtual css::uno::Reference< css::awt::XWindowPeer >
- GetComponentInterface( bool bCreate = true ) override;
-
void SetSaveToModule(bool b);
- void SetSearchLabel(const OUString& rStr) { m_pSearchLabel->SetText(rStr); }
+ void SetSearchLabel(const OUString& rStr) { m_xSearchLabel->set_label(rStr); }
private:
- VclPtr<vcl::Window> mpDocWin;
bool mbSuccess;
-
- VclPtr<VclFrame> m_pSearchFrame;
- VclPtr<ComboBox> m_pSearchLB;
- VclPtr<ListBox> m_pSearchTmplLB;
- VclPtr<FixedText> m_pSearchAttrText;
- VclPtr<FixedText> m_pSearchLabel;
-
- VclPtr<VclFrame> m_pReplaceFrame;
- VclPtr<ComboBox> m_pReplaceLB;
- VclPtr<ListBox> m_pReplaceTmplLB;
- VclPtr<FixedText> m_pReplaceAttrText;
-
- VclPtr<PushButton> m_pSearchBtn;
- VclPtr<PushButton> m_pBackSearchBtn;
- VclPtr<PushButton> m_pSearchAllBtn;
- VclPtr<PushButton> m_pReplaceBtn;
- VclPtr<PushButton> m_pReplaceAllBtn;
-
- VclPtr<VclFrame> m_pComponentFrame;
- VclPtr<PushButton> m_pSearchComponent1PB;
- VclPtr<PushButton> m_pSearchComponent2PB;
-
- VclPtr<CheckBox> m_pMatchCaseCB;
- VclPtr<CheckBox> m_pSearchFormattedCB;
- VclPtr<CheckBox> m_pWordBtn;
-
- VclPtr<PushButton> m_pCloseBtn;
- VclPtr<CheckBox> m_pIncludeDiacritics;
- VclPtr<CheckBox> m_pIncludeKashida;
- VclPtr<VclExpander> m_pOtherOptionsExpander;
- VclPtr<CheckBox> m_pSelectionBtn;
- VclPtr<CheckBox> m_pRegExpBtn;
- VclPtr<CheckBox> m_pWildcardBtn;
- VclPtr<CheckBox> m_pSimilarityBox;
- VclPtr<PushButton> m_pSimilarityBtn;
- VclPtr<CheckBox> m_pLayoutBtn;
- VclPtr<CheckBox> m_pNotesBtn;
- VclPtr<CheckBox> m_pJapMatchFullHalfWidthCB;
- VclPtr<CheckBox> m_pJapOptionsCB;
- VclPtr<CheckBox> m_pReplaceBackwardsCB;
- VclPtr<PushButton> m_pJapOptionsBtn;
-
- VclPtr<PushButton> m_pAttributeBtn;
- VclPtr<PushButton> m_pFormatBtn;
- VclPtr<PushButton> m_pNoFormatBtn;
-
- VclPtr<VclContainer> m_pCalcGrid;
- VclPtr<FixedText> m_pCalcSearchInFT;
- VclPtr<ListBox> m_pCalcSearchInLB;
- VclPtr<FixedText> m_pCalcSearchDirFT;
- VclPtr<RadioButton> m_pRowsBtn;
- VclPtr<RadioButton> m_pColumnsBtn;
- VclPtr<CheckBox> m_pAllSheetsCB;
+ bool mbClosing;
SfxBindings& rBindings;
bool bWriter;
@@ -232,41 +175,95 @@ private:
bool m_executingSubDialog = false;
- DECL_LINK( ModifyHdl_Impl, Edit&, void );
- DECL_LINK( FlagHdl_Impl, Button*, void );
- DECL_LINK( CommandHdl_Impl, Button*, void );
- DECL_LINK(TemplateHdl_Impl, Button*, void);
- DECL_LINK( FocusHdl_Impl, Control&, void );
- DECL_LINK( LBSelectHdl_Impl, ListBox&, void );
- DECL_LINK(LoseFocusHdl_Impl, Control&, void);
- DECL_LINK(FormatHdl_Impl, Button*, void);
- DECL_LINK(NoFormatHdl_Impl, Button*, void);
- DECL_LINK(AttributeHdl_Impl, Button*, void);
- DECL_LINK( TimeoutHdl_Impl, Timer*, void );
- void ClickHdl_Impl(void const * pCtrl);
-
- void Construct_Impl();
- void InitControls_Impl();
- void ShowOptionalControls_Impl();
- void Init_Impl( bool bHasItemSet );
- void InitAttrList_Impl( const SfxItemSet* pSSet,
+ std::unique_ptr<weld::Frame> m_xSearchFrame;
+ std::unique_ptr<weld::ComboBox> m_xSearchLB;
+ std::unique_ptr<weld::ComboBox> m_xSearchTmplLB;
+ std::unique_ptr<weld::Label> m_xSearchAttrText;
+ std::unique_ptr<weld::Label> m_xSearchLabel;
+
+ std::unique_ptr<weld::Frame> m_xReplaceFrame;
+ std::unique_ptr<weld::ComboBox> m_xReplaceLB;
+ std::unique_ptr<weld::ComboBox> m_xReplaceTmplLB;
+ std::unique_ptr<weld::Label> m_xReplaceAttrText;
+
+ std::unique_ptr<weld::Button> m_xSearchBtn;
+ std::unique_ptr<weld::Button> m_xBackSearchBtn;
+ std::unique_ptr<weld::Button> m_xSearchAllBtn;
+ std::unique_ptr<weld::Button> m_xReplaceBtn;
+ std::unique_ptr<weld::Button> m_xReplaceAllBtn;
+
+ std::unique_ptr<weld::Frame> m_xComponentFrame;
+ std::unique_ptr<weld::Button> m_xSearchComponent1PB;
+ std::unique_ptr<weld::Button> m_xSearchComponent2PB;
+
+ std::unique_ptr<weld::CheckButton> m_xMatchCaseCB;
+ std::unique_ptr<weld::CheckButton> m_xSearchFormattedCB;
+ std::unique_ptr<weld::CheckButton> m_xWordBtn;
+
+ std::unique_ptr<weld::Button> m_xCloseBtn;
+ std::unique_ptr<weld::CheckButton> m_xIncludeDiacritics;
+ std::unique_ptr<weld::CheckButton> m_xIncludeKashida;
+ std::unique_ptr<weld::Expander> m_xOtherOptionsExpander;
+ std::unique_ptr<weld::CheckButton> m_xSelectionBtn;
+ std::unique_ptr<weld::CheckButton> m_xRegExpBtn;
+ std::unique_ptr<weld::CheckButton> m_xWildcardBtn;
+ std::unique_ptr<weld::CheckButton> m_xSimilarityBox;
+ std::unique_ptr<weld::Button> m_xSimilarityBtn;
+ std::unique_ptr<weld::CheckButton> m_xLayoutBtn;
+ std::unique_ptr<weld::CheckButton> m_xNotesBtn;
+ std::unique_ptr<weld::CheckButton> m_xJapMatchFullHalfWidthCB;
+ std::unique_ptr<weld::CheckButton> m_xJapOptionsCB;
+ std::unique_ptr<weld::CheckButton> m_xReplaceBackwardsCB;
+ std::unique_ptr<weld::Button> m_xJapOptionsBtn;
+
+ std::unique_ptr<weld::Button> m_xAttributeBtn;
+ std::unique_ptr<weld::Button> m_xFormatBtn;
+ std::unique_ptr<weld::Button> m_xNoFormatBtn;
+
+ std::unique_ptr<weld::Widget> m_xCalcGrid;
+ std::unique_ptr<weld::Label> m_xCalcSearchInFT;
+ std::unique_ptr<weld::ComboBox> m_xCalcSearchInLB;
+ std::unique_ptr<weld::Label> m_xCalcSearchDirFT;
+ std::unique_ptr<weld::RadioButton> m_xRowsBtn;
+ std::unique_ptr<weld::RadioButton> m_xColumnsBtn;
+ std::unique_ptr<weld::CheckButton> m_xAllSheetsCB;
+ std::unique_ptr<weld::Label> m_xCalcStrFT;
+
+ DECL_DLLPRIVATE_LINK( ModifyHdl_Impl, weld::ComboBox&, void );
+ DECL_DLLPRIVATE_LINK( FlagHdl_Impl, weld::Button&, void );
+ DECL_DLLPRIVATE_LINK( CommandHdl_Impl, weld::Button&, void );
+ DECL_DLLPRIVATE_LINK(TemplateHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK( FocusHdl_Impl, weld::Widget&, void );
+ DECL_DLLPRIVATE_LINK( LBSelectHdl_Impl, weld::ComboBox&, void );
+ DECL_DLLPRIVATE_LINK(LoseFocusHdl_Impl, weld::Widget&, void);
+ DECL_DLLPRIVATE_LINK(FormatHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK(NoFormatHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK(AttributeHdl_Impl, weld::Button&, void);
+ DECL_DLLPRIVATE_LINK( TimeoutHdl_Impl, Timer*, void );
+ SVX_DLLPRIVATE void ClickHdl_Impl(const weld::Widget* pCtrl);
+
+ SVX_DLLPRIVATE void Construct_Impl();
+ SVX_DLLPRIVATE void InitControls_Impl();
+ SVX_DLLPRIVATE void ShowOptionalControls_Impl();
+ SVX_DLLPRIVATE void Init_Impl( bool bHasItemSet );
+ SVX_DLLPRIVATE void InitAttrList_Impl( const SfxItemSet* pSSet,
const SfxItemSet* pRSet );
- void Remember_Impl( const OUString &rStr, bool bSearch );
- void PaintAttrText_Impl();
- OUString& BuildAttrText_Impl( OUString& rStr, bool bSrchFlag ) const;
+ SVX_DLLPRIVATE void Remember_Impl( const OUString &rStr, bool bSearch );
+ SVX_DLLPRIVATE void PaintAttrText_Impl();
+ SVX_DLLPRIVATE OUString& BuildAttrText_Impl( OUString& rStr, bool bSrchFlag ) const;
- void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool );
- void EnableControls_Impl( const SearchOptionFlags nFlags );
- void EnableControl_Impl( Control const * pCtrl );
- void SetItem_Impl( const SvxSearchItem* pItem );
+ SVX_DLLPRIVATE void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool );
+ SVX_DLLPRIVATE void EnableControls_Impl( const SearchOptionFlags nFlags );
+ SVX_DLLPRIVATE void EnableControl_Impl(const weld::Widget& rCtrl);
+ SVX_DLLPRIVATE void SetItem_Impl( const SvxSearchItem* pItem );
- void SetModifyFlag_Impl( const Control* pCtrl );
- void SaveToModule_Impl();
+ SVX_DLLPRIVATE void SetModifyFlag_Impl(const weld::Widget* pCtrl);
+ SVX_DLLPRIVATE void SaveToModule_Impl();
- void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
- bool IsOtherOptionsExpanded();
+ SVX_DLLPRIVATE void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings );
+ SVX_DLLPRIVATE bool IsOtherOptionsExpanded();
- short executeSubDialog(VclAbstractDialog * dialog);
+ SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog);
};
#endif
diff --git a/include/vcl/salvtables.hxx b/include/vcl/salvtables.hxx
index dad0e71d5137..0de528fa8751 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -262,6 +262,14 @@ public:
virtual OUString strip_mnemonic(const OUString& rLabel) const override;
SystemWindow* getSystemWindow();
+
+ virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override;
+
+ virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) override;
+
+ virtual void add_extra_accessible_relation(const css::accessibility::AccessibleRelation &rRelation) override;
+
+ virtual void clear_extra_accessible_relations() override;
};
class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index e9b816a0f5fa..9ca0209cad08 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -97,6 +97,14 @@ public:
virtual OUString get_accessible_description() const = 0;
+ virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) = 0;
+ virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) = 0;
+
+ virtual void
+ add_extra_accessible_relation(const css::accessibility::AccessibleRelation& rRelation)
+ = 0;
+ virtual void clear_extra_accessible_relations() = 0;
+
virtual void set_tooltip_text(const OUString& rTip) = 0;
virtual void connect_focus_in(const Link<Widget&, void>& rLink)
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index f95ad05cef5b..3585f6d14a23 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -76,6 +76,7 @@ enum class VclEventId;
namespace com { namespace sun { namespace star {
namespace accessibility {
+ struct AccessibleRelation;
class XAccessible;
}
namespace beans {
@@ -1292,6 +1293,9 @@ public:
void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf );
vcl::Window* GetAccessibleRelationMemberOf() const;
+ void AddExtraAccessibleRelation(const css::accessibility::AccessibleRelation &rRelation);
+ const std::vector<css::accessibility::AccessibleRelation>& GetExtraAccessibleRelations() const;
+ void ClearExtraAccessibleRelations();
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path