summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-22 15:59:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-24 18:19:29 +0100
commitf920e86fbf3968104e1dfc0e9934e80652ed0837 (patch)
tree01f8ed9c445821739b9709c5fee6e51eab0ae24d /include
parentda881f38c088c439f034e340bbbb4ca53e67389f (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>
Diffstat (limited to 'include')
-rw-r--r--include/svx/srchdlg.hxx190
-rw-r--r--include/vcl/weld.hxx5
-rw-r--r--include/vcl/window.hxx4
3 files changed, 102 insertions, 97 deletions
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 5b202aeebcc9..aa995edbf04f 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() override;
+ virtual void Close() override;
// Window
virtual void Activate() override;
@@ -132,74 +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;
@@ -234,41 +176,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/weld.hxx b/include/vcl/weld.hxx
index 96f292c4d695..a180243019df 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -141,6 +141,11 @@ public:
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 OUString get_tooltip_text() const = 0;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index fff03ed1ffb5..c109e80d982d 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -67,6 +67,7 @@ enum class PointerStyle;
namespace com { namespace sun { namespace star {
namespace accessibility {
+ struct AccessibleRelation;
class XAccessible;
}
@@ -1252,6 +1253,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