23 #include <string_view>
25 #include <rtl/ustring.hxx>
27 #include <com/sun/star/frame/DispatchInformation.hpp>
28 #include <com/sun/star/frame/XModel.hpp>
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <com/sun/star/container/XNameAccess.hpp>
31 #include <com/sun/star/script/browse/XBrowseNode.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <config_features.h>
38 #if HAVE_FEATURE_SCRIPTING
39 class SfxMacroInfoItem;
65 css::uno::Reference< css::frame::XModel >
m_xDoc;
70 void init(
const OUString& rModuleName,
const css::uno::Reference< css::frame::XModel >& xModel);
76 std::vector< SfxStyleInfo_Impl >
getStyles(
const OUString& sFamily);
78 static OUString
generateCommand(std::u16string_view sFamily, std::u16string_view sStyle);
103 nKind( n ), nUniqueID( nr ), pObject( pObj ) {}
118 void set_sensitive(
bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); }
123 void thaw() { m_xTreeView->thaw(); }
126 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false,
nullptr);
130 std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator());
131 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, xIter.get());
134 void append(
const OUString& rId,
const OUString& rStr,
const OUString& rImage,
const weld::TreeIter* pParent =
nullptr)
136 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, m_xScratchIter.get());
137 m_xTreeView->set_image(*m_xScratchIter, rImage);
139 void append(
const OUString& rId,
const OUString& rStr,
const css::uno::Reference<css::graphic::XGraphic>& rImage,
const weld::TreeIter* pParent =
nullptr)
141 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, m_xScratchIter.get());
142 m_xTreeView->set_image(*m_xScratchIter, rImage, -1);
144 void remove(
int nPos) { m_xTreeView->remove(
nPos); }
151 OUString
get_text(
int nPos)
const {
return m_xTreeView->get_text(nPos); }
156 if (!m_xTreeView->get_selected(m_xScratchIter.get()))
158 return m_xTreeView->get_text(*m_xScratchIter);
162 if (!m_xTreeView->get_selected(m_xScratchIter.get()))
164 return m_xTreeView->get_id(*m_xScratchIter);
166 void select(
int pos) { m_xTreeView->select(pos); }
167 void set_size_request(
int nWidth,
int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
175 OUString
GetHelpText(
bool bConsiderParent =
true );
185 std::unique_ptr<SvxConfigGroupBoxResource_Impl>
xImp;
189 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
190 css::uno::Reference< css::frame::XFrame >
m_xFrame;
199 const css::uno::Reference< css::script::browse::XBrowseNode >& node,
200 css::uno::Reference< css::uno::XComponentContext >
const & xCtx,
204 css::uno::Reference< css::uno::XComponentContext >
const & xCtx,
205 std::u16string_view docName);
208 void FillScriptList(
const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
210 void FillFunctionsList(
const css::uno::Sequence< css::frame::DispatchInformation >& xCommands);
217 void set_sensitive(
bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); }
219 void set_size_request(
int nWidth,
int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
224 void Init(
const css::uno::Reference< css::uno::XComponentContext >& xContext,
225 const css::uno::Reference< css::frame::XFrame >& xFrame,
226 const OUString& sModuleLongName,
229 { m_pFunctionListBox = pBox; }
231 #if HAVE_FEATURE_SCRIPTING
232 void SelectMacro(
const SfxMacroInfoItem*);
233 void SelectMacro(std::u16string_view, std::u16string_view);
262 const css::uno::Reference< css::frame::XFrame >& xFrame);
weld::TreeView & get_widget()
DECL_LINK(ExpandingHdl, const weld::TreeIter &, bool)
std::unique_ptr< SvxConfigGroupBoxResource_Impl > xImp
css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo
void SetFunctionListBox(CuiConfigFunctionListBox *pBox)
std::vector< SfxStyleInfo_Impl > getStyleFamilies() const
OUString GetHelpText(bool bConsiderParent=true)
std::unique_ptr< CuiConfigFunctionListBox > m_xCommands
OUString GetScriptURL() const
css::uno::Reference< css::frame::XModel > m_xDoc
SfxStylesInfo_Impl * m_pStylesInfo
css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription
Size get_size_request() const
void getLabel4Style(SfxStyleInfo_Impl &aStyle)
void set_sensitive(bool bSensitive)
std::unique_ptr< weld::TreeIter > m_xScratchIter
std::unique_ptr< weld::TreeIter > tree_append(const OUString &rId, const OUString &rStr, const weld::TreeIter *pParent=nullptr)
void append(const OUString &rId, const OUString &rStr, const OUString &rImage, const weld::TreeIter *pParent=nullptr)
~CuiConfigFunctionListBox()
css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo
bool iter_has_child(const weld::TreeIter &rIter) const
DECL_LINK(QueryTooltip, const weld::TreeIter &rIter, OUString)
OUString MapCommand2UIName(const OUString &sCommand)
OUString get_text(int nPos) const
OUString get_selected_text() const
DECL_LINK(ClickHdl, weld::Button &, void)
std::unique_ptr< CuiConfigGroupListBox > m_xCategories
SfxGroupInfoArr_Impl aArr
OUString GetCurLabel() const
void set_size_request(int nWidth, int nHeight)
void Init(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XFrame > &xFrame, const OUString &sModuleLongName, bool bEventMode)
std::unique_ptr< weld::TreeView > m_xTreeView
bool get_selected(weld::TreeIter *pIter) const
SvxScriptSelectorDialog(weld::Window *pParent, const css::uno::Reference< css::frame::XFrame > &xFrame)
SfxStylesInfo_Impl m_aStylesInfo
void connect_changed(const Link< weld::TreeView &, void > &rLink)
SfxGroupInfo_Impl(SfxCfgKind n, sal_uInt16 nr, void *pObj=nullptr)
void set_size_request(int nWidth, int nHeight)
void connect_changed(const Link< weld::TreeView &, void > &rLink)
std::unique_ptr< weld::Label > m_xLibraryFT
void append(const OUString &rId, const OUString &rStr, const css::uno::Reference< css::graphic::XGraphic > &rImage, const weld::TreeIter *pParent=nullptr)
std::vector< SfxStyleInfo_Impl > getStyles(const OUString &sFamily)
virtual ~SvxScriptSelectorDialog() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
OUString GetCurCommand() const
void scroll_to_row(int pos)
OUString GetSelectedScriptURI() const
OUString get_selected_id() const
SfxStyleInfo_Impl(const SfxStyleInfo_Impl &rCopy)
void SetStylesInfo(SfxStylesInfo_Impl *pStyles)
OUString m_sModuleLongName
void init(const OUString &rModuleName, const css::uno::Reference< css::frame::XModel > &xModel)
void connect_row_activated(const Link< weld::TreeView &, bool > &rLink)
std::unique_ptr< weld::TreeIter > make_iterator(const weld::TreeIter *pOrig=nullptr) const
void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode > &xRootNode, const weld::TreeIter *pParentEntry)
std::vector< std::unique_ptr< SfxGroupInfo_Impl > > SfxGroupInfoArr_Impl
std::unique_ptr< weld::Label > m_xMacronameFT
void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation > &xCommands)
SfxGroupInfoArr_Impl aArr
CuiConfigFunctionListBox(std::unique_ptr< weld::TreeView > xTreeView)
static OUString generateCommand(std::u16string_view sFamily, std::u16string_view sStyle)
void connect_popup_menu(const Link< const CommandEvent &, bool > &rLink)
std::unique_ptr< weld::Frame > m_xDescriptionFrame
static OUString GetImage(const css::uno::Reference< css::script::browse::XBrowseNode > &node, css::uno::Reference< css::uno::XComponentContext > const &xCtx, bool bIsRootNode)
void expand_row(const weld::TreeIter &rIter)
std::unique_ptr< weld::Label > m_xDialogDescription
std::unique_ptr< weld::TreeIter > m_xScratchIter
CuiConfigFunctionListBox * m_pFunctionListBox
static css::uno::Reference< css::uno::XInterface > getDocumentModel(css::uno::Reference< css::uno::XComponentContext > const &xCtx, std::u16string_view docName)
static bool parseStyleCommand(SfxStyleInfo_Impl &aStyle)
OUString get_id(const weld::TreeIter &rIter) const
std::unique_ptr< weld::Button > m_xOKButton
weld::TreeView & get_widget()
std::unique_ptr< weld::Button > m_xCancelButton
CuiConfigGroupListBox(std::unique_ptr< weld::TreeView > xTreeView)
css::uno::Reference< css::frame::XFrame > m_xFrame
std::unique_ptr< weld::TreeView > m_xTreeView
void set_sensitive(bool bSensitive)
std::unique_ptr< weld::TextView > m_xDescriptionText
void append(const OUString &rId, const OUString &rStr, const weld::TreeIter *pParent=nullptr)