Kaydet (Commit) ccb2b007 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SvxMenuConfigPage/SvxToolbarConfigPage

Change-Id: I166ac6c0be8461ea38db711796d1e14fc5b78998
Reviewed-on: https://gerrit.libreoffice.org/68889
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 96d0cf0d
......@@ -917,7 +917,7 @@ void SbTreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation
m_xControl->thaw();
}
void SbTreeListBox::ImpCreateLibEntries(weld::TreeIter& rIter, const ScriptDocument& rDocument, LibraryLocation eLocation)
void SbTreeListBox::ImpCreateLibEntries(const weld::TreeIter& rIter, const ScriptDocument& rDocument, LibraryLocation eLocation)
{
// get a sorted list of library names
Sequence< OUString > aLibNames( rDocument.getLibraryNames() );
......@@ -976,7 +976,7 @@ void SbTreeListBox::ImpCreateLibEntries(weld::TreeIter& rIter, const ScriptDocum
}
}
void SbTreeListBox::ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName)
void SbTreeListBox::ImpCreateLibSubEntries(const weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName)
{
// modules
if ( nMode & BrowseMode::Modules )
......@@ -1075,7 +1075,7 @@ void SbTreeListBox::ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const
}
}
void SbTreeListBox::ImpCreateLibSubEntriesInVBAMode(weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName )
void SbTreeListBox::ImpCreateLibSubEntriesInVBAMode(const weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName )
{
auto const aEntries = {
std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, IDEResId(RID_STR_DOCUMENT_OBJECTS) ),
......@@ -1102,7 +1102,7 @@ void SbTreeListBox::ImpCreateLibSubEntriesInVBAMode(weld::TreeIter& rLibRootEntr
}
}
void SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(weld::TreeIter& rLibSubRootEntry, const ScriptDocument& rDocument, const OUString& rLibName)
void SbTreeListBox::ImpCreateLibSubSubEntriesInVBAMode(const weld::TreeIter& rLibSubRootEntry, const ScriptDocument& rDocument, const OUString& rLibName)
{
uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, rLibName );
if( !xLib.is() )
......@@ -1347,7 +1347,7 @@ bool SbTreeListBox::IsEntryProtected(const weld::TreeIter* pEntry)
void SbTreeListBox::AddEntry(
const OUString& rText,
const OUString& rImage,
weld::TreeIter* pParent,
const weld::TreeIter* pParent,
bool bChildrenOnDemand,
std::unique_ptr<Entry>&& rUserData)
{
......@@ -1357,7 +1357,7 @@ void SbTreeListBox::AddEntry(
void SbTreeListBox::SetEntryBitmaps(const weld::TreeIter& rIter, const OUString& rImage)
{
m_xControl->set_expander_image(rIter, rImage);
m_xControl->set_image(rIter, rImage, -1);
}
LibraryType SbTreeListBox::GetLibraryType() const
......
......@@ -130,7 +130,7 @@ void TreeListBox::RequestingChildren( SvTreeListEntry* pEntry )
}
}
IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, weld::TreeIter&, rEntry, bool)
IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const weld::TreeIter&, rEntry, bool)
{
EntryDescriptor aDesc = GetEntryDescriptor(&rEntry);
const ScriptDocument& aDocument = aDesc.GetDocument();
......
......@@ -259,12 +259,12 @@ private:
void SetEntryBitmaps(const weld::TreeIter& rIter, const OUString& rImage);
protected:
DECL_LINK(RequestingChildrenHdl, weld::TreeIter&, bool);
DECL_LINK(RequestingChildrenHdl, const weld::TreeIter&, bool);
DECL_LINK(OpenCurrentHdl, weld::TreeView&, void);
void ImpCreateLibEntries(weld::TreeIter& rShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation);
void ImpCreateLibSubEntries(weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName);
void ImpCreateLibSubEntriesInVBAMode(weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName );
void ImpCreateLibSubSubEntriesInVBAMode(weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName);
void ImpCreateLibEntries(const weld::TreeIter& rShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation);
void ImpCreateLibSubEntries(const weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName);
void ImpCreateLibSubEntriesInVBAMode(const weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName );
void ImpCreateLibSubSubEntriesInVBAMode(const weld::TreeIter& rLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName);
bool ImpFindEntry(weld::TreeIter& rIter, const OUString& rText);
// DocumentEventListener
......@@ -300,7 +300,7 @@ public:
static ItemType ConvertType (EntryType eType);
bool IsValidEntry(weld::TreeIter& rEntry);
void AddEntry(const OUString& rText, const OUString& rImage,
weld::TreeIter* pIter, bool bChildrenOnDemand, std::unique_ptr<Entry>&& rUserData);
const weld::TreeIter* pIter, bool bChildrenOnDemand, std::unique_ptr<Entry>&& rUserData);
void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xControl->connect_changed(rLink); }
std::unique_ptr<weld::TreeIter> make_iterator(const weld::TreeIter* pIter = nullptr) const { return m_xControl->make_iterator(pIter); }
......
......@@ -887,6 +887,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(TabPageParent pParent, const
m_xOfficeButton->connect_clicked( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
m_xModuleButton->connect_clicked( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
m_xSearchEdit->connect_changed( LINK( this, SfxAcceleratorConfigPage, SearchUpdateHdl ));
m_xSearchEdit->connect_focus_out(LINK(this, SfxAcceleratorConfigPage, FocusOut_Impl));
// detect max keyname width
int nMaxWidth = 0;
......@@ -1121,6 +1122,15 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SearchUpdateHdl, weld::Entry&, void)
m_aUpdateDataTimer.Start();
}
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, FocusOut_Impl, weld::Widget&, void)
{
if (m_aUpdateDataTimer.IsActive())
{
m_aUpdateDataTimer.Stop();
m_aUpdateDataTimer.Invoke();
}
}
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Load, weld::Button&, void)
{
// ask for filename, where we should load the new config data from
......
This diff is collapsed.
......@@ -247,86 +247,6 @@ std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const OUString& s
return lStyles;
}
SfxConfigFunctionListBox::SfxConfigFunctionListBox(vcl::Window* pParent, WinBits nStyle)
: SvTreeListBox( pParent, nStyle )
{
SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
GetModel()->SetSortMode( SortAscending );
SetQuickSearch( true );
}
VCL_BUILDER_FACTORY_CONSTRUCTOR(SfxConfigFunctionListBox, WB_TABSTOP)
SfxConfigFunctionListBox::~SfxConfigFunctionListBox()
{
disposeOnce();
}
void SfxConfigFunctionListBox::dispose()
{
ClearAll();
SvTreeListBox::dispose();
}
void SfxConfigFunctionListBox::MouseMove( const MouseEvent& )
{
}
void SfxConfigFunctionListBox::ClearAll()
/* Description
Deletes all entries in the FunctionListBox, all UserData and all
possibly existing MacroInfo.
*/
{
sal_uInt16 nCount = aArr.size();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
SfxGroupInfo_Impl *pData = aArr[i].get();
if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT )
{
OUString* pScriptURI = static_cast<OUString*>(pData->pObject);
delete pScriptURI;
}
if ( pData->nKind == SfxCfgKind::GROUP_SCRIPTCONTAINER )
{
XInterface* xi = static_cast<XInterface *>(pData->pObject);
if (xi != nullptr)
{
xi->release();
}
}
}
aArr.clear();
Clear();
}
OUString SfxConfigFunctionListBox::GetHelpText( bool bConsiderParent )
{
SvTreeListEntry *pEntry = FirstSelected();
if ( pEntry )
{
SfxGroupInfo_Impl *pData = static_cast<SfxGroupInfo_Impl*>(pEntry->GetUserData());
if ( pData )
{
if ( pData->nKind == SfxCfgKind::FUNCTION_SLOT )
{
if (bConsiderParent)
return Application::GetHelp()->GetHelpText( pData->sCommand, this );
else
return Application::GetHelp()->GetHelpText( pData->sCommand, static_cast<weld::Widget*>(nullptr) );
}
else if ( pData->nKind == SfxCfgKind::FUNCTION_SCRIPT )
{
return pData->sHelpText;
}
}
}
return OUString();
}
OUString CuiConfigFunctionListBox::GetHelpText( bool bConsiderParent )
{
int nSelected = m_xTreeView->get_selected_index();
......@@ -377,6 +297,7 @@ OUString CuiConfigFunctionListBox::GetCurLabel()
CuiConfigFunctionListBox::CuiConfigFunctionListBox(std::unique_ptr<weld::TreeView> xTreeView)
: m_xTreeView(std::move(xTreeView))
, m_xScratchIter(m_xTreeView->make_iterator())
{
m_xTreeView->make_sorted();
m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 35, m_xTreeView->get_height_rows(9));
......@@ -599,7 +520,7 @@ void CuiConfigGroupListBox::InitModule()
}
void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand)
const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand)
{
try {
if ( xRootNode->hasChildNodes() )
......@@ -1046,7 +967,7 @@ void CuiConfigGroupListBox::GroupSelected()
/* Description
A basic or a library is opened.
*/
IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, weld::TreeIter&, rIter, bool)
IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, const weld::TreeIter&, rIter, bool)
{
SfxGroupInfo_Impl *pInfo = reinterpret_cast<SfxGroupInfo_Impl*>(m_xTreeView->get_id(rIter).toInt64());
switch ( pInfo->nKind )
......
......@@ -267,10 +267,10 @@ SvxScriptOrgDialog::getLangNodeFromRootNode( Reference< browse::XBrowseNode > co
return langNode;
}
void SvxScriptOrgDialog::RequestSubEntries(weld::TreeIter& rRootEntry, Reference< css::script::browse::XBrowseNode > const & node,
void SvxScriptOrgDialog::RequestSubEntries(const weld::TreeIter& rRootEntry, Reference< css::script::browse::XBrowseNode > const & node,
Reference< XModel >& model)
{
if (! node.is() )
if (!node.is())
{
return;
}
......@@ -300,7 +300,7 @@ void SvxScriptOrgDialog::RequestSubEntries(weld::TreeIter& rRootEntry, Reference
}
void SvxScriptOrgDialog::insertEntry(const OUString& rText, const OUString& rBitmap,
weld::TreeIter* pParent, bool bChildrenOnDemand, std::unique_ptr<SFEntry> && aUserData,
const weld::TreeIter* pParent, bool bChildrenOnDemand, std::unique_ptr<SFEntry> && aUserData,
const OUString& factoryURL, bool bSelect)
{
if (rBitmap == RID_CUIBMP_DOC && !factoryURL.isEmpty())
......@@ -313,7 +313,7 @@ void SvxScriptOrgDialog::insertEntry(const OUString& rText, const OUString& rBit
}
void SvxScriptOrgDialog::insertEntry(
const OUString& rText, const OUString& rBitmap, weld::TreeIter* pParent,
const OUString& rText, const OUString& rBitmap, const weld::TreeIter* pParent,
bool bChildrenOnDemand, std::unique_ptr<SFEntry> && aUserData, bool bSelect)
{
std::unique_ptr<weld::TreeIter> xRetIter;
......@@ -329,7 +329,7 @@ void SvxScriptOrgDialog::insertEntry(
}
}
IMPL_LINK(SvxScriptOrgDialog, ExpandingHdl, weld::TreeIter&, rIter, bool)
IMPL_LINK(SvxScriptOrgDialog, ExpandingHdl, const weld::TreeIter&, rIter, bool)
{
SFEntry* userData = reinterpret_cast<SFEntry*>(m_xScriptsBox->get_id(rIter).toInt64());
......
......@@ -23,7 +23,7 @@
#include <i18nutil/searchopt.hxx>
#include "cfgutil.hxx"
class CommandCategoryListBox : public ListBox
class CommandCategoryListBox
{
SfxGroupInfoArr_Impl m_aGroupInfo;
OUString m_sModuleLongName;
......@@ -39,10 +39,11 @@ class CommandCategoryListBox : public ListBox
SfxStylesInfo_Impl* pStylesInfo;
SfxStylesInfo_Impl m_aStylesInfo;
std::unique_ptr<weld::ComboBox> m_xControl;
public:
CommandCategoryListBox( vcl::Window* pParent );
virtual ~CommandCategoryListBox() override;
virtual void dispose() override;
CommandCategoryListBox(std::unique_ptr<weld::ComboBox> xControl);
~CommandCategoryListBox();
void ClearAll();
void Init(
......@@ -51,25 +52,27 @@ public:
const OUString& sModuleLongName);
void FillFunctionsList(
const css::uno::Sequence< css::frame::DispatchInformation >& xCommands,
const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox,
CuiConfigFunctionListBox* pFunctionListBox,
const OUString& filterTerm,
SaveInData *pCurrentSaveInData );
OUString getCommandName(const OUString& sCommand);
void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
/**
Signals that a command category has been selected.
And updates the functions list box to include
the commands in the selected category.
*/
void categorySelected( const VclPtr<SfxConfigFunctionListBox>& pFunctionListBox,
const OUString& filterTerm, SaveInData* pCurrentSaveInData = nullptr );
void categorySelected(CuiConfigFunctionListBox* pFunctionListBox,
const OUString& filterTerm, SaveInData* pCurrentSaveInData = nullptr);
void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
// Adds children of the given macro group to the functions list
void addChildren(
SvTreeListEntry* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode,
const VclPtr<SfxConfigFunctionListBox> &pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData );
weld::TreeIter* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode,
CuiConfigFunctionListBox* pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData );
};
#endif // INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX
......
......@@ -48,19 +48,24 @@ class SvxMenuConfigPage : public SvxConfigPage
{
private:
bool m_bIsMenuBar;
DECL_LINK( SelectMenu, ListBox&, void );
DECL_LINK( SelectMenuEntry, SvTreeListBox *, void );
DECL_LINK( GearHdl, MenuButton *, void );
DECL_LINK( SelectMenu, weld::ComboBox&, void );
DECL_LINK( SelectMenuEntry, weld::TreeView&, void );
DECL_LINK( SelectCategory, ListBox&, void );
DECL_LINK( GearHdl, const OString&, void );
DECL_LINK( AddCommandHdl, Button *, void );
DECL_LINK( RemoveCommandHdl, Button *, void );
DECL_LINK( SelectCategory, weld::ComboBox&, void );
DECL_LINK( InsertHdl, MenuButton *, void );
DECL_LINK( ModifyItemHdl, MenuButton *, void );
DECL_LINK( ResetMenuHdl, Button *, void );
DECL_LINK( AddCommandHdl, weld::Button&, void );
DECL_LINK( RemoveCommandHdl, weld::Button&, void );
DECL_LINK( InsertHdl, const OString&, void );
DECL_LINK( ModifyItemHdl, const OString&, void );
DECL_LINK( ResetMenuHdl, weld::Button&, void );
DECL_LINK( MenuEntriesSizeAllocHdl, const Size&, void );
DECL_LINK( ListModifiedHdl, weld::TreeView&, void );
void Init() override;
void UpdateButtonStates() override;
......@@ -68,8 +73,10 @@ private:
void DeleteSelectedContent() override;
void DeleteSelectedTopLevel() override;
virtual void SelectElement() override;
public:
SvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet, bool bIsMenuBar = true );
SvxMenuConfigPage(TabPageParent pParent, const SfxItemSet& rItemSet, bool bIsMenuBar = true);
virtual ~SvxMenuConfigPage() override;
virtual void dispose() override;
......
......@@ -48,34 +48,36 @@ class SvxToolbarConfigPage : public SvxConfigPage
{
private:
DECL_LINK( SelectToolbar, ListBox&, void );
DECL_LINK( SelectToolbarEntry, SvTreeListBox*, void );
DECL_LINK( MoveHdl, Button *, void );
DECL_LINK( SelectToolbar, weld::ComboBox&, void );
DECL_LINK( SelectToolbarEntry, weld::TreeView&, void );
DECL_LINK( MoveHdl, weld::Button&, void );
DECL_LINK( GearHdl, MenuButton *, void );
DECL_LINK( GearHdl, const OString&, void );
DECL_LINK( SelectCategory, ListBox&, void );
DECL_LINK( SelectCategory, weld::ComboBox&, void );
DECL_LINK( AddCommandHdl, Button *, void );
DECL_LINK( RemoveCommandHdl, Button *, void );
DECL_LINK( AddCommandHdl, weld::Button&, void );
DECL_LINK( RemoveCommandHdl, weld::Button&, void );
DECL_LINK( InsertHdl, MenuButton *, void );
DECL_LINK( ModifyItemHdl, MenuButton *, void );
DECL_LINK( ResetToolbarHdl, Button *, void );
DECL_LINK( InsertHdl, const OString&, void );
DECL_LINK( ModifyItemHdl, const OString&, void );
DECL_LINK( ResetToolbarHdl, weld::Button&, void );
DECL_LINK( ListModifiedHdl, weld::TreeView&, void );
void UpdateButtonStates() override;
short QueryReset() override;
void Init() override;
void DeleteSelectedContent() override;
void DeleteSelectedTopLevel() override;
virtual void SelectElement() override;
public:
SvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
SvxToolbarConfigPage(TabPageParent pParent, const SfxItemSet& rItemSet);
virtual ~SvxToolbarConfigPage() override;
virtual void dispose() override;
void AddFunction( SvTreeListEntry* pTarget = nullptr,
bool bFront = false );
void AddFunction(int nTarget = -1, bool bFront = false);
void MoveEntry( bool bMoveUp ) override;
......@@ -90,30 +92,16 @@ public:
class SvxToolbarEntriesListBox final : public SvxMenuEntriesListBox
{
std::unique_ptr<SvLBoxButtonData> m_pButtonData;
VclPtr<SvxConfigPage> pPage;
void ChangeVisibility( SvTreeListEntry* pEntry );
void ChangedVisibility(int nRow);
virtual void CheckButtonHdl() override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void BuildCheckBoxButtonImages( SvLBoxButtonData* );
Image GetSizedImage(
VirtualDevice& aDev, const Size& aNewSize, const Image& aImage );
typedef std::pair<int, int> row_col;
DECL_LINK(CheckButtonHdl, const row_col&, void);
DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
public:
SvxToolbarEntriesListBox(vcl::Window* pParent, SvxToolbarConfigPage* pPg);
SvxToolbarEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxToolbarConfigPage* pPg);
virtual ~SvxToolbarEntriesListBox() override;
virtual void dispose() override;
virtual TriState NotifyMoving(
SvTreeListEntry*, SvTreeListEntry*, SvTreeListEntry*&, sal_uLong& ) override;
virtual TriState NotifyCopying(
SvTreeListEntry*, SvTreeListEntry*, SvTreeListEntry*&, sal_uLong&) override;
void KeyInput( const KeyEvent& rKeyEvent ) override;
};
#endif // INCLUDED_CUI_SOURCE_INC_SVXTOOLBARCONFIGPAGE_HXX
......
......@@ -41,7 +41,7 @@
#include "cfgutil.hxx"
class SfxMacroInfoItem;
class SfxConfigFunctionListBox;
class CuiConfigFunctionListBox;
class SfxAcceleratorConfigPage;
class SfxStringItem;
......@@ -144,6 +144,7 @@ private:
DECL_LINK(Default, weld::Button&, void);
DECL_LINK(RadioHdl, weld::Button&, void);
DECL_LINK(ImplUpdateDataHdl, Timer*, void);
DECL_LINK(FocusOut_Impl, weld::Widget&, void);
DECL_LINK(TimeOut_Impl, Timer*, void);
DECL_LINK(LoadHdl, sfx2::FileDialogHelper *, void);
......
......@@ -166,7 +166,7 @@ public:
css::uno::Sequence
< css::beans::PropertyValue > m_aSeparatorSeq;
Image GetImage( const OUString& rCommandURL );
css::uno::Reference<css::graphic::XGraphic> GetImage(const OUString& rCommandURL);
virtual bool HasURL( const OUString& aURL ) = 0;
virtual bool HasSettings() = 0;
......@@ -331,90 +331,106 @@ public:
void SetStyle( sal_Int32 style ) { nStyle = style; }
};
class SvxMenuEntriesListBox : public SvTreeListBox
class SvxMenuEntriesListBox
{
private:
VclPtr<SvxConfigPage> pPage;
protected:
bool m_bIsInternalDrag;
std::unique_ptr<weld::TreeView> m_xControl;
ScopedVclPtr<VirtualDevice> m_xDropDown;
VclPtr<SvxConfigPage> pPage;
bool m_bIsInternalDrag;
public:
SvxMenuEntriesListBox(vcl::Window*, SvxConfigPage*);
virtual ~SvxMenuEntriesListBox() override;
virtual void dispose() override;
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
virtual bool NotifyAcceptDrop( SvTreeListEntry* pEntry ) override;
virtual TriState NotifyMoving( SvTreeListEntry*, SvTreeListEntry*,
SvTreeListEntry*&, sal_uLong& ) override;
virtual TriState NotifyCopying( SvTreeListEntry*, SvTreeListEntry*,
SvTreeListEntry*&, sal_uLong&) override;
SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPage);
virtual ~SvxMenuEntriesListBox();
int get_selected_index() const { return m_xControl->get_selected_index(); }
OUString get_id(int nPos) const { return m_xControl->get_id(nPos); }
void remove(int nPos) { m_xControl->remove(nPos); }
int n_children() const { return m_xControl->n_children(); }
void set_text(int row, const OUString& rText, int col) { m_xControl->set_text(row, rText, col); }
void set_image(int row, const css::uno::Reference<css::graphic::XGraphic>& rImage, int col) { m_xControl->set_image(row, rImage, col); }
void set_dropdown(int row, int col) { m_xControl->set_image(row, *m_xDropDown, col); }
void set_id(int row, const OUString& rId) { m_xControl->set_id(row, rId); }
void clear() { m_xControl->clear(); } //need frees ?
void set_toggle(int row, bool bOn, int col) { m_xControl->set_toggle(row, bOn, col); }
void scroll_to_row(int pos) { m_xControl->scroll_to_row(pos); }
void select(int pos) { m_xControl->select(pos); }
weld::TreeView& get_widget() { return *m_xControl; }
void insert(int pos, const OUString& rId)
{
m_xControl->insert(nullptr, pos, nullptr, &rId,
nullptr, nullptr, nullptr, false, nullptr);
}
virtual DragDropMode NotifyStartDrag(
TransferDataContainer&, SvTreeListEntry* ) override;
void insert(int pos, const OUString& rId, const OUString& rStr, const OUString* pImage = nullptr)
{
m_xControl->insert(pos, rStr, &rId, pImage, nullptr);
}
virtual void DragFinished( sal_Int8 ) override;
DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
void KeyInput( const KeyEvent& rKeyEvent ) override;
void CreateDropDown();
};
class SvxConfigPage : public SfxTabPage
{
private:
Timer m_aUpdateDataTimer;
bool bInitialised;
SaveInData* pCurrentSaveInData;
DECL_LINK( SelectSaveInLocation, ListBox&, void );
DECL_LINK( SearchUpdateHdl, Edit&, void );
DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
protected:
/// the ResourceURL to select when opening the dialog
OUString m_aURLToSelect;
css::uno::Reference< css::frame::XFrame > m_xFrame;
// Left side of the dialog where command categories and the available
// commands in them are displayed as a searchable list
VclPtr<Edit> m_pSearchEdit;
VclPtr<CommandCategoryListBox> m_pCommandCategoryListBox;
VclPtr<SfxConfigFunctionListBox> m_pFunctions;
std::unique_ptr<weld::Entry> m_xSearchEdit;
std::unique_ptr<CommandCategoryListBox> m_xCommandCategoryListBox;
std::unique_ptr<CuiConfigFunctionListBox> m_xFunctions;
VclPtr<FixedText> m_pDescriptionFieldLb;
VclPtr<VclMultiLineEdit> m_pDescriptionField;
std::unique_ptr<weld::Label> m_xDescriptionFieldLb;
std::unique_ptr<weld::TextView> m_xDescriptionField;
// Right side of the dialog where the contents of the selected
// menu or toolbar are displayed
VclPtr<ListBox> m_pTopLevelListBox;
std::unique_ptr<weld::ComboBox> m_xTopLevelListBox;
// Used to add and remove toolbars/menus
VclPtr<MenuButton> m_pGearBtn;
VclPtr<VclContainer> m_pEntries;
VclPtr<SvTreeListBox> m_pContentsListBox;
std::unique_ptr<weld::MenuButton> m_xGearBtn;
std::unique_ptr<SvxMenuEntriesListBox> m_xContentsListBox;
VclPtr<PushButton> m_pMoveUpButton;
VclPtr<PushButton> m_pMoveDownButton;
std::unique_ptr<weld::Button> m_xMoveUpButton;
std::unique_ptr<weld::Button> m_xMoveDownButton;
VclPtr<ListBox> m_pSaveInListBox;
std::unique_ptr<weld::ComboBox> m_xSaveInListBox;
VclPtr<MenuButton> m_pInsertBtn;
VclPtr<MenuButton> m_pModifyBtn;
std::unique_ptr<weld::MenuButton> m_xInsertBtn;
std::unique_ptr<weld::MenuButton> m_xModifyBtn;
// Used to reset the selected toolbar/menu/context menu
VclPtr<PushButton> m_pResetBtn;
std::unique_ptr<weld::Button> m_xResetBtn;
// Middle buttons
VclPtr<PushButton> m_pAddCommandButton;
VclPtr<PushButton> m_pRemoveCommandButton;
/// the ResourceURL to select when opening the dialog
OUString m_aURLToSelect;
std::unique_ptr<weld::Button> m_xAddCommandButton;
std::unique_ptr<weld::Button> m_xRemoveCommandButton;
css::uno::Reference< css::frame::XFrame > m_xFrame;
SvxConfigPage( vcl::Window*, const SfxItemSet& );
SvxConfigPage(TabPageParent, const SfxItemSet&);
DECL_LINK( MoveHdl, Button *, void );
DECL_LINK( SelectFunctionHdl, SvTreeListBox *, void );
DECL_LINK( FunctionDoubleClickHdl, SvTreeListBox *, bool );
DECL_LINK(MoveHdl, weld::Button&, void);
DECL_LINK(SelectFunctionHdl, weld::TreeView&, void);
DECL_LINK(FunctionDoubleClickHdl, weld::TreeView&, void);
DECL_LINK(SelectSaveInLocation, weld::ComboBox&, void);
DECL_LINK(SelectElementHdl, weld::ComboBox&, void);
DECL_LINK(ImplUpdateDataHdl, Timer*, void);
DECL_LINK(FocusOut_Impl, weld::Widget&, void);
virtual SaveInData* CreateSaveInData(
const css::uno::Reference< css::ui::XUIConfigurationManager >&,
......@@ -426,15 +442,17 @@ protected:
virtual void UpdateButtonStates() = 0;
virtual short QueryReset() = 0;
SvTreeListEntry* InsertEntry( SvxConfigEntry* pNewEntryData,
SvTreeListEntry* pTarget = nullptr,
bool bFront = false );
virtual void SelectElement() = 0;
int InsertEntry(SvxConfigEntry* pNewEntryData,
int nTarget,
bool bFront = false);
void AddSubMenusToUI( const OUString& rBaseTitle,
SvxConfigEntry const * pParentData );
SvTreeListEntry* InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
sal_uLong nPos = TREELIST_APPEND );
void InsertEntryIntoUI(SvxConfigEntry* pNewEntryData,
int nPos, int nStartCol);
SvxEntries* FindParentForChild( SvxEntries* pParentEntries,
SvxConfigEntry* pChildData );
......@@ -444,20 +462,18 @@ protected:
public:
virtual ~SvxConfigPage() override;
virtual void dispose() override;
static bool CanConfig( const OUString& rModuleId );
SaveInData* GetSaveInData() { return pCurrentSaveInData; }