diff options
Diffstat (limited to 'cui/source/inc/cfgutil.hxx')
-rw-r--r-- | cui/source/inc/cfgutil.hxx | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index b3b7d091b61a..b1f22e4065b9 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -16,11 +16,12 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CUI_SOURCE_INC_CFGUTIL_HXX -#define INCLUDED_CUI_SOURCE_INC_CFGUTIL_HXX +#pragma once #include <vector> #include <memory> +#include <string_view> + #include <rtl/ustring.hxx> #include <com/sun/star/frame/DispatchInformation.hpp> @@ -30,10 +31,13 @@ #include <com/sun/star/script/browse/XBrowseNode.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <vcl/weld.hxx> +#include <config_features.h> class Button; class SaveInData; +#if HAVE_FEATURE_SCRIPTING class SfxMacroInfoItem; +#endif struct SfxStyleInfo_Impl { @@ -71,7 +75,7 @@ public: std::vector< SfxStyleInfo_Impl > getStyleFamilies() const; std::vector< SfxStyleInfo_Impl > getStyles(const OUString& sFamily); - static OUString generateCommand(const OUString& sFamily, const OUString& sStyle); + static OUString generateCommand(std::u16string_view sFamily, std::u16string_view sStyle); }; enum class SfxCfgKind @@ -81,7 +85,8 @@ enum class SfxCfgKind GROUP_SCRIPTCONTAINER = 3, FUNCTION_SCRIPT = 4, GROUP_STYLES = 5, - GROUP_ALLFUNCTIONS = 6 + GROUP_ALLFUNCTIONS = 6, + GROUP_SIDEBARDECKS = 7 }; struct SfxGroupInfo_Impl @@ -112,6 +117,7 @@ public: CuiConfigFunctionListBox(std::unique_ptr<weld::TreeView> xTreeView); void set_sensitive(bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); } void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); } + void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) { m_xTreeView->connect_popup_menu(rLink); } void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { m_xTreeView->connect_row_activated(rLink); } void freeze() { m_xTreeView->freeze(); } void thaw() { m_xTreeView->thaw(); } @@ -141,15 +147,9 @@ public: void expand_row(const weld::TreeIter& rIter) { m_xTreeView->expand_row(rIter); } int n_children() const { return m_xTreeView->n_children(); } std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pOrig = nullptr) const { return m_xTreeView->make_iterator(pOrig); } - bool get_iter_first(weld::TreeIter& rIter) const { return m_xTreeView->get_iter_first(rIter); } - // set iter to point to next node, depth first, then sibling - bool iter_next(weld::TreeIter& rIter) const { return m_xTreeView->iter_next(rIter); } - bool iter_next_sibling(weld::TreeIter& rIter) const { return m_xTreeView->iter_next_sibling(rIter); } bool iter_has_child(const weld::TreeIter& rIter) const { return m_xTreeView->iter_has_child(rIter); } - OUString get_text(const weld::TreeIter& rIter) const { return m_xTreeView->get_text(rIter); } OUString get_text(int nPos) const { return m_xTreeView->get_text(nPos); } OUString get_id(const weld::TreeIter& rIter) const { return m_xTreeView->get_id(rIter); } - OUString get_id(int nPos) const { return m_xTreeView->get_id(nPos); } bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); } OUString get_selected_text() const { @@ -163,8 +163,6 @@ public: return OUString(); return m_xTreeView->get_id(*m_xScratchIter); } - int get_selected_index() const { return m_xTreeView->get_selected_index(); } - void select(const weld::TreeIter& rIter) { m_xTreeView->select(rIter); } void select(int pos) { m_xTreeView->select(pos); } void set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); } Size get_size_request() const { return m_xTreeView->get_size_request(); } @@ -204,11 +202,11 @@ class CuiConfigGroupListBox static css::uno::Reference< css::uno::XInterface > getDocumentModel( css::uno::Reference< css::uno::XComponentContext > const & xCtx, - OUString const & docName); + std::u16string_view docName); - void InitModule(); + sal_Int32 InitModule(); void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode, - const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand); + const weld::TreeIter* pParentEntry); void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation >& xCommands); OUString MapCommand2UIName(const OUString& sCommand); @@ -230,8 +228,9 @@ public: void SetFunctionListBox( CuiConfigFunctionListBox *pBox ) { m_pFunctionListBox = pBox; } void GroupSelected(); +#if HAVE_FEATURE_SCRIPTING void SelectMacro(const SfxMacroInfoItem*); - void SelectMacro(const OUString&, const OUString&); +#endif void SetStylesInfo(SfxStylesInfo_Impl* pStyles); }; @@ -244,16 +243,16 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController std::unique_ptr<CuiConfigGroupListBox> m_xCategories; std::unique_ptr<CuiConfigFunctionListBox> m_xCommands; std::unique_ptr<weld::Label> m_xLibraryFT; - std::unique_ptr<weld::Label> m_xCategoryFT; std::unique_ptr<weld::Label> m_xMacronameFT; - std::unique_ptr<weld::Label> m_xCommandsFT; std::unique_ptr<weld::Button> m_xOKButton; std::unique_ptr<weld::Button> m_xCancelButton; std::unique_ptr<weld::TextView> m_xDescriptionText; + std::unique_ptr<weld::Frame> m_xDescriptionFrame; DECL_LINK(ClickHdl, weld::Button&, void); DECL_LINK(SelectHdl, weld::TreeView&, void); DECL_LINK(FunctionDoubleClickHdl, weld::TreeView&, bool); + DECL_LINK(ContextMenuHdl, const CommandEvent&, bool); void UpdateUI(); @@ -264,8 +263,8 @@ public: OUString GetScriptURL() const; void SetRunLabel(); + void SaveLastUsedMacro(); + void LoadLastUsedMacro(); }; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |