From f920e86fbf3968104e1dfc0e9934e80652ed0837 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 22 Mar 2019 15:59:00 +0000 Subject: weld SvxSearchDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Caolán McNamara --- include/svx/srchdlg.hxx | 190 ++++++++++++++++++++++++------------------------ include/vcl/weld.hxx | 5 ++ include/vcl/window.hxx | 4 + 3 files changed, 102 insertions(+), 97 deletions(-) (limited to 'include') 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 dialog; + std::shared_ptr 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 mpDocWin; bool mbSuccess; - - VclPtr m_pSearchFrame; - VclPtr m_pSearchLB; - VclPtr m_pSearchTmplLB; - VclPtr m_pSearchAttrText; - VclPtr m_pSearchLabel; - - VclPtr m_pReplaceFrame; - VclPtr m_pReplaceLB; - VclPtr m_pReplaceTmplLB; - VclPtr m_pReplaceAttrText; - - VclPtr m_pSearchBtn; - VclPtr m_pBackSearchBtn; - VclPtr m_pSearchAllBtn; - VclPtr m_pReplaceBtn; - VclPtr m_pReplaceAllBtn; - - VclPtr m_pComponentFrame; - VclPtr m_pSearchComponent1PB; - VclPtr m_pSearchComponent2PB; - - VclPtr m_pMatchCaseCB; - VclPtr m_pSearchFormattedCB; - VclPtr m_pWordBtn; - - VclPtr m_pCloseBtn; - VclPtr m_pIncludeDiacritics; - VclPtr m_pIncludeKashida; - VclPtr m_pOtherOptionsExpander; - VclPtr m_pSelectionBtn; - VclPtr m_pRegExpBtn; - VclPtr m_pWildcardBtn; - VclPtr m_pSimilarityBox; - VclPtr m_pSimilarityBtn; - VclPtr m_pLayoutBtn; - VclPtr m_pNotesBtn; - VclPtr m_pJapMatchFullHalfWidthCB; - VclPtr m_pJapOptionsCB; - VclPtr m_pReplaceBackwardsCB; - VclPtr m_pJapOptionsBtn; - - VclPtr m_pAttributeBtn; - VclPtr m_pFormatBtn; - VclPtr m_pNoFormatBtn; - - VclPtr m_pCalcGrid; - VclPtr m_pCalcSearchInFT; - VclPtr m_pCalcSearchInLB; - VclPtr m_pCalcSearchDirFT; - VclPtr m_pRowsBtn; - VclPtr m_pColumnsBtn; - VclPtr 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 m_xSearchFrame; + std::unique_ptr m_xSearchLB; + std::unique_ptr m_xSearchTmplLB; + std::unique_ptr m_xSearchAttrText; + std::unique_ptr m_xSearchLabel; + + std::unique_ptr m_xReplaceFrame; + std::unique_ptr m_xReplaceLB; + std::unique_ptr m_xReplaceTmplLB; + std::unique_ptr m_xReplaceAttrText; + + std::unique_ptr m_xSearchBtn; + std::unique_ptr m_xBackSearchBtn; + std::unique_ptr m_xSearchAllBtn; + std::unique_ptr m_xReplaceBtn; + std::unique_ptr m_xReplaceAllBtn; + + std::unique_ptr m_xComponentFrame; + std::unique_ptr m_xSearchComponent1PB; + std::unique_ptr m_xSearchComponent2PB; + + std::unique_ptr m_xMatchCaseCB; + std::unique_ptr m_xSearchFormattedCB; + std::unique_ptr m_xWordBtn; + + std::unique_ptr m_xCloseBtn; + std::unique_ptr m_xIncludeDiacritics; + std::unique_ptr m_xIncludeKashida; + std::unique_ptr m_xOtherOptionsExpander; + std::unique_ptr m_xSelectionBtn; + std::unique_ptr m_xRegExpBtn; + std::unique_ptr m_xWildcardBtn; + std::unique_ptr m_xSimilarityBox; + std::unique_ptr m_xSimilarityBtn; + std::unique_ptr m_xLayoutBtn; + std::unique_ptr m_xNotesBtn; + std::unique_ptr m_xJapMatchFullHalfWidthCB; + std::unique_ptr m_xJapOptionsCB; + std::unique_ptr m_xReplaceBackwardsCB; + std::unique_ptr m_xJapOptionsBtn; + + std::unique_ptr m_xAttributeBtn; + std::unique_ptr m_xFormatBtn; + std::unique_ptr m_xNoFormatBtn; + + std::unique_ptr m_xCalcGrid; + std::unique_ptr m_xCalcSearchInFT; + std::unique_ptr m_xCalcSearchInLB; + std::unique_ptr m_xCalcSearchDirFT; + std::unique_ptr m_xRowsBtn; + std::unique_ptr m_xColumnsBtn; + std::unique_ptr m_xAllSheetsCB; + std::unique_ptr 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& GetExtraAccessibleRelations() const; + void ClearExtraAccessibleRelations(); // to avoid sending accessibility events in cases like closing dialogs // by default checks complete parent path -- cgit