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>
62 css::uno::Reference< css::frame::XModel >
m_xDoc;
67 void init(
const OUString& rModuleName,
const css::uno::Reference< css::frame::XModel >& xModel);
73 std::vector< SfxStyleInfo_Impl >
getStyles(
const OUString& sFamily);
75 static OUString
generateCommand(std::u16string_view sFamily, std::u16string_view sStyle);
99 nKind( n ), nUniqueID( nr ), pObject( pObj ) {}
114 void set_sensitive(
bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); }
119 void thaw() { m_xTreeView->thaw(); }
122 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false,
nullptr);
126 std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator());
127 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, xIter.get());
130 void append(
const OUString& rId,
const OUString& rStr,
const OUString& rImage,
const weld::TreeIter* pParent =
nullptr)
132 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, m_xScratchIter.get());
133 m_xTreeView->set_image(*m_xScratchIter, rImage);
135 void append(
const OUString& rId,
const OUString& rStr,
const css::uno::Reference<css::graphic::XGraphic>& rImage,
const weld::TreeIter* pParent =
nullptr)
137 m_xTreeView->insert(pParent, -1, &rStr, &rId,
nullptr,
nullptr,
false, m_xScratchIter.get());
138 m_xTreeView->set_image(*m_xScratchIter, rImage, -1);
140 void remove(
int nPos) { m_xTreeView->remove(
nPos); }
147 OUString
get_text(
int nPos)
const {
return m_xTreeView->get_text(nPos); }
152 if (!m_xTreeView->get_selected(m_xScratchIter.get()))
154 return m_xTreeView->get_text(*m_xScratchIter);
158 if (!m_xTreeView->get_selected(m_xScratchIter.get()))
160 return m_xTreeView->get_id(*m_xScratchIter);
162 void select(
int pos) { m_xTreeView->select(pos); }
163 void set_size_request(
int nWidth,
int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
171 OUString
GetHelpText(
bool bConsiderParent =
true );
181 std::unique_ptr<SvxConfigGroupBoxResource_Impl>
xImp;
185 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
186 css::uno::Reference< css::frame::XFrame >
m_xFrame;
195 const css::uno::Reference< css::script::browse::XBrowseNode >& node,
196 css::uno::Reference< css::uno::XComponentContext >
const & xCtx,
200 css::uno::Reference< css::uno::XComponentContext >
const & xCtx,
201 std::u16string_view docName);
204 void FillScriptList(
const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
206 void FillFunctionsList(
const css::uno::Sequence< css::frame::DispatchInformation >& xCommands);
213 void set_sensitive(
bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); }
215 void set_size_request(
int nWidth,
int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); }
220 void Init(
const css::uno::Reference< css::uno::XComponentContext >& xContext,
221 const css::uno::Reference< css::frame::XFrame >& xFrame,
222 const OUString& sModuleLongName,
225 { m_pFunctionListBox = pBox; }
228 void SelectMacro(std::u16string_view,
const OUString&);
257 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
void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode > &xRootNode, const weld::TreeIter *pParentEntry, bool bCheapChildrenOnDemand)
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
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)
std::unique_ptr< weld::Label > m_xCommandsFT
static OUString generateCommand(std::u16string_view sFamily, std::u16string_view sStyle)
void connect_popup_menu(const Link< const CommandEvent &, bool > &rLink)
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
void SelectMacro(const SfxMacroInfoItem *)
std::unique_ptr< weld::Label > m_xCategoryFT
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)