summaryrefslogtreecommitdiff
path: root/cui/source/inc
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/inc')
-rw-r--r--cui/source/inc/SvxMenuConfigPage.hxx87
-rw-r--r--cui/source/inc/cfg.hxx90
2 files changed, 141 insertions, 36 deletions
diff --git a/cui/source/inc/SvxMenuConfigPage.hxx b/cui/source/inc/SvxMenuConfigPage.hxx
new file mode 100644
index 000000000000..7b3443bb4688
--- /dev/null
+++ b/cui/source/inc/SvxMenuConfigPage.hxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * 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_SVXMENUCONFIGPAGE_HXX
+#define INCLUDED_CUI_SOURCE_INC_SVXMENUCONFIGPAGE_HXX
+
+#endif // INCLUDED_CUI_SOURCE_INC_SVXMENUCONFIGPAGE_HXX
+
+#include <vcl/fixed.hxx>
+#include <vcl/group.hxx>
+#include <vcl/layout.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/menubtn.hxx>
+#include <vcl/toolbox.hxx>
+#include <svtools/treelistbox.hxx>
+#include <svtools/svmedit2.hxx>
+#include <svtools/svmedit.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/ui/XUIConfigurationListener.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XSingleComponentFactory.hpp>
+
+#include <sfx2/tabdlg.hxx>
+#include <memory>
+#include <vector>
+#include <vcl/msgbox.hxx>
+
+#include "cfgutil.hxx"
+#include "cfg.hxx" //for SvxConfigPage and SaveInData
+
+class SvxMenuConfigPage : public SvxConfigPage
+{
+private:
+ bool m_bIsMenuBar;
+ DECL_LINK( SelectMenu, ListBox&, void );
+ DECL_LINK( SelectMenuEntry, SvTreeListBox *, void );
+ DECL_LINK( NewMenuHdl, Button *, void );
+ DECL_LINK( MenuSelectHdl, MenuButton *, void );
+ DECL_LINK( EntrySelectHdl, MenuButton *, void );
+ DECL_LINK( AddCommandsHdl, Button *, void );
+ DECL_LINK( AddSeparatorHdl, Button *, void );
+ DECL_LINK( AddSubmenuHdl, Button *, void );
+ DECL_LINK( DeleteCommandHdl, Button *, void );
+ DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog&, void );
+
+ void Init() override;
+ void UpdateButtonStates() override;
+ short QueryReset() override;
+ void DeleteSelectedContent() override;
+ void DeleteSelectedTopLevel() override;
+
+public:
+ SvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet, bool bIsMenuBar = true );
+ virtual ~SvxMenuConfigPage() override;
+ virtual void dispose() override;
+
+ SaveInData* CreateSaveInData(
+ const css::uno::Reference <
+ css::ui::XUIConfigurationManager >&,
+ const css::uno::Reference <
+ css::ui::XUIConfigurationManager >&,
+ const OUString& aModuleId,
+ bool docConfig ) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index e141bc0b0eaf..564c150f53a2 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -48,7 +48,6 @@
class SvxConfigEntry;
class SvxConfigPage;
-class SvxMenuConfigPage;
class SvxToolbarConfigPage;
typedef std::vector< SvxConfigEntry* > SvxEntries;
@@ -473,41 +472,6 @@ public:
GetFrameWithDefaultAndIdentify( css::uno::Reference< css::frame::XFrame >& _inout_rxFrame );
};
-class SvxMenuConfigPage : public SvxConfigPage
-{
-private:
- bool m_bIsMenuBar;
- DECL_LINK( SelectMenu, ListBox&, void );
- DECL_LINK( SelectMenuEntry, SvTreeListBox *, void );
- DECL_LINK( NewMenuHdl, Button *, void );
- DECL_LINK( MenuSelectHdl, MenuButton *, void );
- DECL_LINK( EntrySelectHdl, MenuButton *, void );
- DECL_LINK( AddCommandsHdl, Button *, void );
- DECL_LINK( AddSeparatorHdl, Button *, void );
- DECL_LINK( AddSubmenuHdl, Button *, void );
- DECL_LINK( DeleteCommandHdl, Button *, void );
- DECL_LINK( AddFunctionHdl, SvxScriptSelectorDialog&, void );
-
- void Init() override;
- void UpdateButtonStates() override;
- short QueryReset() override;
- void DeleteSelectedContent() override;
- void DeleteSelectedTopLevel() override;
-
-public:
- SvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet, bool bIsMenuBar = true );
- virtual ~SvxMenuConfigPage() override;
- virtual void dispose() override;
-
- SaveInData* CreateSaveInData(
- const css::uno::Reference <
- css::ui::XUIConfigurationManager >&,
- const css::uno::Reference <
- css::ui::XUIConfigurationManager >&,
- const OUString& aModuleId,
- bool docConfig ) override;
-};
-
class SvxMainMenuOrganizerDialog : public ModalDialog
{
VclPtr<VclContainer> m_pMenuBox;
@@ -759,6 +723,60 @@ public:
virtual ~SvxIconChangeDialog() override;
virtual void dispose() override;
};
+
+namespace killmelater
+{
+//TODO:This is copy/pasted from cfg.cxx
+inline void RemoveEntry( SvxEntries* pEntries, SvxConfigEntry* pChildEntry )
+{
+ SvxEntries::iterator iter = pEntries->begin();
+
+ while ( iter != pEntries->end() )
+ {
+ if ( pChildEntry == *iter )
+ {
+ pEntries->erase( iter );
+ break;
+ }
+ ++iter;
+ }
+}
+
+//TODO:This is copy/pasted from cfg.cxx
+inline OUString replaceSaveInName(
+ const OUString& rMessage,
+ const OUString& rSaveInName )
+{
+ OUString name;
+ OUString placeholder("%SAVE IN SELECTION%" );
+
+ sal_Int32 pos = rMessage.indexOf( placeholder );
+
+ if ( pos != -1 )
+ {
+ name = rMessage.replaceAt(
+ pos, placeholder.getLength(), rSaveInName );
+ }
+
+ return name;
+}
+
+//TODO:This is copy/pasted from cfg.cxx
+inline OUString
+stripHotKey( const OUString& str )
+{
+ sal_Int32 index = str.indexOf( '~' );
+ if ( index == -1 )
+ {
+ return str;
+ }
+ else
+ {
+ return str.replaceAt( index, 1, OUString() );
+ }
+}
+}
+
#endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */