diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
commit | 267c6f2ac71f92999e969232431ba04678e7437e (patch) | |
tree | 358c9467650e1d0a1d7227a21dac2e3d08b622b2 /cui/source/inc | |
parent | Initial commit. (diff) | |
download | libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip |
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cui/source/inc')
92 files changed, 11398 insertions, 0 deletions
diff --git a/cui/source/inc/AdditionsDialog.hxx b/cui/source/inc/AdditionsDialog.hxx new file mode 100644 index 0000000000..559a4ca911 --- /dev/null +++ b/cui/source/inc/AdditionsDialog.hxx @@ -0,0 +1,179 @@ +/* -*- 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/. + * + */ + +#pragma once + +#include <salhelper/thread.hxx> +#include <rtl/ref.hxx> +#include <vcl/weld.hxx> + +// Detect changes on the UI +#include <vcl/timer.hxx> + +// Search and filter +#include <i18nutil/searchopt.hxx> + +// Extension Manager Connection +#include <com/sun/star/deployment/XExtensionManager.hpp> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/XProgressHandler.hpp> +#include <cppuhelper/implbase.hxx> + +#include <atomic> + +class AdditionsDialog; +class SearchAndParseThread; +class AdditionsItem; + +struct AdditionInfo +{ + OUString sExtensionID; + OUString sName; + OUString sAuthorName; + OUString sExtensionURL; + OUString sScreenshotURL; + OUString sIntroduction; + OUString sDescription; + OUString sCompatibleVersion; + OUString sReleaseVersion; + OUString sLicense; + OUString sCommentNumber; + OUString sCommentURL; + OUString sRating; + OUString sDownloadNumber; + OUString sDownloadURL; +}; + +class AdditionsDialog : public weld::GenericDialogController +{ +private: + Timer m_aSearchDataTimer; + + DECL_LINK(GearHdl, const OUString&, void); + DECL_LINK(SearchUpdateHdl, weld::Entry&, void); + DECL_LINK(ImplUpdateDataHdl, Timer*, void); + DECL_LINK(FocusOut_Impl, weld::Widget&, void); + DECL_LINK(CloseButtonHdl, weld::Button&, void); + +public: + css::uno::Reference<css::deployment::XExtensionManager> m_xExtensionManager; + std::unique_ptr<weld::Entry> m_xEntrySearch; + std::unique_ptr<weld::Button> m_xButtonClose; + std::vector<std::shared_ptr<AdditionsItem>> m_aAdditionsItems; // UI components + std::vector<AdditionInfo> m_aAllExtensionsVector; // Stores the all extensions' info + + std::unique_ptr<weld::ScrolledWindow> m_xContentWindow; + std::unique_ptr<weld::Container> m_xContentGrid; + + std::unique_ptr<weld::Label> m_xLabelProgress; + std::unique_ptr<weld::MenuButton> m_xGearBtn; + + ::rtl::Reference<SearchAndParseThread> m_pSearchThread; + + OUString m_sURL; + OUString m_sTag; + size_t + m_nMaxItemCount; // Max number of item which will appear on the list before the press to the show more button. + size_t m_nCurrentListItemCount; // Current number of item on the list + i18nutil::SearchOptions2 m_searchOptions; + + AdditionsDialog(weld::Window* pParent, const OUString& sAdditionsTag); + ~AdditionsDialog() override; + css::uno::Sequence<css::uno::Sequence<css::uno::Reference<css::deployment::XPackage>>> + getInstalledExtensions(); + void SetProgress(const OUString& rProgress); + void ClearList(); + void RefreshUI(); + + static bool sortByComment(const AdditionInfo& a, const AdditionInfo& b); + static bool sortByRating(const AdditionInfo& a, const AdditionInfo& b); + static bool sortByDownload(const AdditionInfo& a, const AdditionInfo& b); +}; + +class AdditionsItem +{ +public: + AdditionsItem(weld::Widget* pParent, AdditionsDialog* pParentDialog, + const AdditionInfo& additionInfo); + bool getExtensionFile(OUString& sExtensionFile); + + DECL_LINK(ShowMoreHdl, weld::Button&, void); + DECL_LINK(InstallHdl, weld::Button&, void); + + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Widget> m_xContainer; + std::unique_ptr<weld::Image> m_xImageScreenshot; + std::unique_ptr<weld::Button> m_xButtonInstall; + std::unique_ptr<weld::LinkButton> m_xLinkButtonWebsite; + std::unique_ptr<weld::Label> m_xLabelName; + std::unique_ptr<weld::Label> m_xLabelAuthor; + std::unique_ptr<weld::Label> m_xLabelDescription; + std::unique_ptr<weld::Label> m_xLabelLicense; + std::unique_ptr<weld::Label> m_xLabelVersion; + std::unique_ptr<weld::LinkButton> m_xLinkButtonComments; + std::unique_ptr<weld::Image> m_xImageVoting1; + std::unique_ptr<weld::Image> m_xImageVoting2; + std::unique_ptr<weld::Image> m_xImageVoting3; + std::unique_ptr<weld::Image> m_xImageVoting4; + std::unique_ptr<weld::Image> m_xImageVoting5; + std::unique_ptr<weld::Label> m_xLabelDownloadNumber; + std::unique_ptr<weld::Button> m_xButtonShowMore; + AdditionsDialog* m_pParentDialog; + OUString m_sDownloadURL; + OUString m_sExtensionID; +}; + +class SearchAndParseThread : public salhelper::Thread +{ +private: + AdditionsDialog* m_pAdditionsDialog; + std::atomic<bool> m_bExecute; + bool m_bIsFirstLoading; + bool m_bUITest; + + void Search(); + void Append(AdditionInfo& additionInfo); + void CheckInstalledExtensions(); + + virtual ~SearchAndParseThread() override; + virtual void execute() override; + +public: + SearchAndParseThread(AdditionsDialog* pDialog, bool bIsFirstLoading); + + void StopExecution() { m_bExecute = false; } +}; + +class TmpRepositoryCommandEnv + : public ::cppu::WeakImplHelper<css::ucb::XCommandEnvironment, css::task::XInteractionHandler, + css::ucb::XProgressHandler> +{ +public: + virtual ~TmpRepositoryCommandEnv() override; + TmpRepositoryCommandEnv(); + + // XCommandEnvironment + virtual css::uno::Reference<css::task::XInteractionHandler> + SAL_CALL getInteractionHandler() override; + virtual css::uno::Reference<css::ucb::XProgressHandler> SAL_CALL getProgressHandler() override; + + // XInteractionHandler + virtual void SAL_CALL + handle(css::uno::Reference<css::task::XInteractionRequest> const& xRequest) override; + + // XProgressHandler + virtual void SAL_CALL push(css::uno::Any const& Status) override; + virtual void SAL_CALL update(css::uno::Any const& Status) override; + virtual void SAL_CALL pop() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/CommandCategoryListBox.hxx b/cui/source/inc/CommandCategoryListBox.hxx new file mode 100644 index 0000000000..c4882ae174 --- /dev/null +++ b/cui/source/inc/CommandCategoryListBox.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 . + */ + +#pragma once + +#include <i18nutil/searchopt.hxx> +#include "cfgutil.hxx" + +class CommandCategoryListBox +{ + SfxGroupInfoArr_Impl m_aGroupInfo; + OUString m_sModuleLongName; + css::uno::Reference<css::uno::XComponentContext> m_xContext; + css::uno::Reference<css::frame::XFrame> m_xFrame; + css::uno::Reference<css::container::XNameAccess> m_xGlobalCategoryInfo; + css::uno::Reference<css::container::XNameAccess> m_xModuleCategoryInfo; + css::uno::Reference<css::container::XNameAccess> m_xUICmdDescription; + + // For search + i18nutil::SearchOptions2 m_searchOptions; + + SfxStylesInfo_Impl* pStylesInfo; + SfxStylesInfo_Impl m_aStylesInfo; + + std::unique_ptr<weld::ComboBox> m_xControl; + +public: + CommandCategoryListBox(std::unique_ptr<weld::ComboBox> xControl); + ~CommandCategoryListBox(); + void ClearAll(); + + void Init(const css::uno::Reference<css::uno::XComponentContext>& xContext, + const css::uno::Reference<css::frame::XFrame>& xFrame, + const OUString& sModuleLongName); + void FillFunctionsList(const css::uno::Sequence<css::frame::DispatchInformation>& xCommands, + 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(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(const weld::TreeIter* parentEntry, + const css::uno::Reference<com::sun::star::script::browse::XBrowseNode>& parentNode, + CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm, + SaveInData* pCurrentSaveInData, + std::vector<std::unique_ptr<weld::TreeIter>>& rNodesToExpand); + + void set_visible(bool bVisible) { m_xControl->set_visible(bVisible); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/CustomNotebookbarGenerator.hxx b/cui/source/inc/CustomNotebookbarGenerator.hxx new file mode 100644 index 0000000000..b06848dbb9 --- /dev/null +++ b/cui/source/inc/CustomNotebookbarGenerator.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Sequence.hxx> +#include <rtl/ustring.hxx> + +using namespace css::uno; + +class CustomNotebookbarGenerator +{ +public: + CustomNotebookbarGenerator(); + static OUString getCustomizedUIPath(); + static OUString getOriginalUIPath(); + static OString getSystemPath(OUString const& sURL); + static Sequence<OUString> getCustomizedUIItem(OUString sNotebookbarConfigType); + static void getFileNameAndAppName(OUString& sAppName, OUString& sNotebookbarUIFileName); + static void modifyCustomizedUIFile(const Sequence<OUString>& sUIItemProperties); + static void createCustomizedUIFile(); + static void setCustomizedUIItem(Sequence<OUString> sUIItemProperties, + OUString sNotebookbarConfigType); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/DiagramDialog.hxx b/cui/source/inc/DiagramDialog.hxx new file mode 100644 index 0000000000..a612e092a8 --- /dev/null +++ b/cui/source/inc/DiagramDialog.hxx @@ -0,0 +1,41 @@ +/* -*- 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/. +*/ + +#pragma once + +#include <tools/link.hxx> +#include <vcl/weld.hxx> + +class SdrObjGroup; + +/** Edit Diagram dialog */ +class DiagramDialog : public weld::GenericDialogController +{ +public: + DiagramDialog(weld::Window* pWindow, SdrObjGroup& rDiagram); + virtual ~DiagramDialog() override; + +private: + SdrObjGroup& m_rDiagram; + sal_uInt32 m_nUndos; + + std::unique_ptr<weld::Button> mpBtnCancel; + std::unique_ptr<weld::Button> mpBtnAdd; + std::unique_ptr<weld::Button> mpBtnRemove; + std::unique_ptr<weld::TreeView> mpTreeDiagram; + std::unique_ptr<weld::TextView> mpTextAdd; + + DECL_LINK(OnAddCancel, weld::Button&, void); + DECL_LINK(OnAddClick, weld::Button&, void); + DECL_LINK(OnRemoveClick, weld::Button&, void); + + void populateTree(const weld::TreeIter* pParent, const OUString& rParentId); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/FontFeatures.hxx b/cui/source/inc/FontFeatures.hxx new file mode 100644 index 0000000000..f16c116281 --- /dev/null +++ b/cui/source/inc/FontFeatures.hxx @@ -0,0 +1,17 @@ +/* -*- 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/. + * + */ +#pragma once + +#include <vector> +#include <vcl/font/Feature.hxx> +#include <vcl/virdev.hxx> + +std::vector<vcl::font::Feature> getFontFeatureList(OUString const& rFontName, VirtualDevice& rVDev); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx new file mode 100644 index 0000000000..93ba0cb9f8 --- /dev/null +++ b/cui/source/inc/FontFeaturesDialog.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/. + * + */ + +#pragma once + +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> +#include <vcl/font/Feature.hxx> +#include <svx/fntctrl.hxx> +#include <memory> + +namespace cui +{ +struct FontFeatureItem +{ + FontFeatureItem(weld::Widget* pParent) + : m_aFeatureCode(0) + , m_nDefault(-1) + , m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/fontfragment.ui")) + , m_xContainer(m_xBuilder->weld_widget("fontentry")) + , m_xText(m_xBuilder->weld_label("label")) + , m_xCombo(m_xBuilder->weld_combo_box("combo")) + , m_xCheck(m_xBuilder->weld_check_button("check")) + { + m_xCheck->connect_toggled(LINK(this, FontFeatureItem, CheckBoxToggledHdl)); + } + + sal_uInt32 m_aFeatureCode; + sal_Int32 m_nDefault; + weld::TriStateEnabled m_aTriStateEnabled; + Link<weld::Toggleable&, void> m_aToggleHdl; + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Widget> m_xContainer; + std::unique_ptr<weld::Label> m_xText; + std::unique_ptr<weld::ComboBox> m_xCombo; + std::unique_ptr<weld::CheckButton> m_xCheck; + +private: + DECL_LINK(CheckBoxToggledHdl, weld::Toggleable&, void); +}; + +class FontFeaturesDialog : public weld::GenericDialogController +{ +private: + std::vector<std::unique_ptr<FontFeatureItem>> m_aFeatureItems; + OUString m_sFontName; + OUString m_sResultFontName; + + SvxFontPrevWindow m_aPreviewWindow; + std::unique_ptr<weld::ScrolledWindow> m_xContentWindow; + std::unique_ptr<weld::Container> m_xContentBox; + std::unique_ptr<weld::Container> m_xContentGrid; + std::unique_ptr<weld::Container> m_xStylisticSetsBox; + std::unique_ptr<weld::Container> m_xStylisticSetsGrid; + std::unique_ptr<weld::Container> m_xCharacterVariantsBox; + std::unique_ptr<weld::Container> m_xCharacterVariantsGrid; + std::unique_ptr<weld::CustomWeld> m_xPreviewWindow; + + void initialize(); + OUString createFontNameWithFeatures(); + + // returns the max height of a row + int fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures); + + DECL_LINK(ComboBoxSelectedHdl, weld::ComboBox&, void); + DECL_LINK(CheckBoxToggledHdl, weld::Toggleable&, void); + +public: + FontFeaturesDialog(weld::Window* pParent, OUString aFontName); + ~FontFeaturesDialog() override; + virtual short run() override; + + OUString const& getResultFontName() const { return m_sResultFontName; } + + void updateFontPreview(); +}; + +} // end svx namespaces + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/GraphicsTestsDialog.hxx b/cui/source/inc/GraphicsTestsDialog.hxx new file mode 100644 index 0000000000..2bf18de5dd --- /dev/null +++ b/cui/source/inc/GraphicsTestsDialog.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include <vcl/bitmap.hxx> +#include <vcl/weld.hxx> +#include <tools/link.hxx> + +#include <vector> + +class GraphicTestEntry final +{ +private: + std::unique_ptr<weld::Builder> m_xBuilder; + std::unique_ptr<weld::Container> m_xContainer; + std::unique_ptr<weld::Label> m_xTestLabel; + std::unique_ptr<weld::Button> m_xTestButton; + + weld::Dialog* m_xParentDialog; + + Bitmap m_xResultBitmap; + +public: + DECL_LINK(HandleResultViewRequest, weld::Button&, void); + GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDialog, OUString aTestName, + OUString aTestStatus, Bitmap aTestBitmap); + weld::Widget* get_widget() const { return m_xContainer.get(); } +}; + +class GraphicsTestsDialog : public weld::GenericDialogController +{ + std::unique_ptr<weld::TextView> m_xResultLog; + std::unique_ptr<weld::Button> m_xDownloadResults; + std::unique_ptr<weld::Box> m_xContainerBox; + + std::vector<std::unique_ptr<GraphicTestEntry>> m_xGraphicTestEntries; + + OUString m_xZipFileUrl; + OUString m_xCreateFolderUrl; + + DECL_LINK(HandleDownloadRequest, weld::Button&, void); + DECL_LINK(HandleResultViewRequest, weld::Button&, void); + +public: + GraphicsTestsDialog(weld::Container* pParent); + ~GraphicsTestsDialog(); + virtual short run() override; +}; diff --git a/cui/source/inc/ImageViewerDialog.hxx b/cui/source/inc/ImageViewerDialog.hxx new file mode 100644 index 0000000000..884deb18d4 --- /dev/null +++ b/cui/source/inc/ImageViewerDialog.hxx @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include <vcl/bitmapex.hxx> +#include <vcl/weld.hxx> + +class ImageViewerDialog : public weld::GenericDialogController +{ + std::unique_ptr<weld::Image> m_xDisplayImage; + +public: + ImageViewerDialog(weld::Dialog* pParent, BitmapEx aBitmap, OUString atitle); +}; diff --git a/cui/source/inc/QrCodeGenDialog.hxx b/cui/source/inc/QrCodeGenDialog.hxx new file mode 100644 index 0000000000..02037ad4cd --- /dev/null +++ b/cui/source/inc/QrCodeGenDialog.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include <config_zxing.h> + +#include <vcl/weld.hxx> + +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/uno/Reference.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> + +class QrCodeGenDialog : public weld::GenericDialogController +{ +public: + QrCodeGenDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel, + bool bEditExisting); + + virtual short run() override; + static bool runAsync(const std::shared_ptr<QrCodeGenDialog>& rController, + const std::function<void(sal_Int32)>& rFunc); + + void Apply(); +#if ENABLE_ZXING + weld::Widget* GetParent() { return mpParent; } +#endif + +private: + css::uno::Reference<css::frame::XModel> m_xModel; + std::unique_ptr<weld::TextView> m_xEdittext; + std::unique_ptr<weld::RadioButton> m_xECC[4]; + std::unique_ptr<weld::SpinButton> m_xSpinBorder; + std::unique_ptr<weld::ComboBox> m_xComboType; + +#if ENABLE_ZXING + weld::Widget* mpParent; +#endif + + css::uno::Reference<css::beans::XPropertySet> m_xExistingShapeProperties; + + void GetErrorCorrection(tools::Long); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx new file mode 100644 index 0000000000..5abe1969e3 --- /dev/null +++ b/cui/source/inc/SignSignatureLineDialog.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include "SignatureLineDialogBase.hxx" + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/security/XCertificate.hpp> +#include <com/sun/star/uno/Reference.hxx> + +class SignSignatureLineDialog : public SignatureLineDialogBase +{ +public: + SignSignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel); + +private: + std::unique_ptr<weld::Entry> m_xEditName; + std::unique_ptr<weld::TextView> m_xEditComment; + std::unique_ptr<weld::Button> m_xBtnLoadImage; + std::unique_ptr<weld::Button> m_xBtnClearImage; + std::unique_ptr<weld::Button> m_xBtnChooseCertificate; + std::unique_ptr<weld::Button> m_xBtnSign; + std::unique_ptr<weld::Label> m_xLabelHint; + std::unique_ptr<weld::Label> m_xLabelHintText; + std::unique_ptr<weld::Label> m_xLabelAddComment; + + css::uno::Reference<css::beans::XPropertySet> m_xShapeProperties; + css::uno::Reference<css::security::XCertificate> m_xSelectedCertifate; + css::uno::Reference<css::graphic::XGraphic> m_xSignatureImage; + OUString m_aSignatureLineId; + OUString m_aSuggestedSignerName; + OUString m_aSuggestedSignerTitle; + bool m_bShowSignDate; + OUString m_sOriginalImageBtnLabel; + + void ValidateFields(); + css::uno::Reference<css::graphic::XGraphic> getSignedGraphic(bool bValid); + virtual void Apply() override; + + DECL_LINK(clearImage, weld::Button&, void); + DECL_LINK(loadImage, weld::Button&, void); + DECL_LINK(chooseCertificate, weld::Button&, void); + DECL_LINK(entryChanged, weld::Entry&, void); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/SignatureLineDialog.hxx b/cui/source/inc/SignatureLineDialog.hxx new file mode 100644 index 0000000000..73b093f601 --- /dev/null +++ b/cui/source/inc/SignatureLineDialog.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include "SignatureLineDialogBase.hxx" + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/uno/Reference.hxx> + +class SignatureLineDialog : public SignatureLineDialogBase +{ +public: + SignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel, + bool bEditExisting); + +private: + std::unique_ptr<weld::Entry> m_xEditName; + std::unique_ptr<weld::Entry> m_xEditTitle; + std::unique_ptr<weld::Entry> m_xEditEmail; + std::unique_ptr<weld::TextView> m_xEditInstructions; + std::unique_ptr<weld::CheckButton> m_xCheckboxCanAddComments; + std::unique_ptr<weld::CheckButton> m_xCheckboxShowSignDate; + + css::uno::Reference<css::beans::XPropertySet> m_xExistingShapeProperties; + OUString m_aSignatureLineId; + + virtual void Apply() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/SignatureLineDialogBase.hxx b/cui/source/inc/SignatureLineDialogBase.hxx new file mode 100644 index 0000000000..dd114d81ab --- /dev/null +++ b/cui/source/inc/SignatureLineDialogBase.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ +#pragma once + +#include <sal/config.h> + +#include <string_view> + +#include <vcl/weld.hxx> + +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/uno/Reference.hxx> + +class SignatureLineDialogBase : public weld::GenericDialogController +{ +public: + SignatureLineDialogBase(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel, + const OUString& rUIFile, const OUString& rDialogId); + + virtual short run() override; + +protected: + css::uno::Reference<css::frame::XModel> m_xModel; + virtual void Apply() = 0; + static OUString getCDataString(std::u16string_view rString); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx new file mode 100644 index 0000000000..fdf5e81bcd --- /dev/null +++ b/cui/source/inc/SpellDialog.hxx @@ -0,0 +1,235 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/basedlgs.hxx> +#include <com/sun/star/uno/Reference.hxx> + + +#include <svx/langbox.hxx> +#include <memory> +#include <svl/undo.hxx> +#include <vcl/customweld.hxx> +#include <svx/weldeditview.hxx> +#include <editeng/SpellPortions.hxx> + +#include <set> + +namespace svx{ class SpellUndoAction_Impl;} +class UndoChangeGroupGuard; + +// forward --------------------------------------------------------------- + +struct SpellDialog_Impl; +namespace com::sun::star::linguistic2 { class XSpellChecker1; } + +namespace svx{ +class SpellDialog; +struct SpellErrorDescription; + +class SentenceEditWindow_Impl : public WeldEditView +{ +private: + std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow; + std::set<sal_Int32> m_aIgnoreErrorsAt; + SpellDialog* m_pSpellDialog; + weld::Toolbar* m_pToolbar; + sal_Int32 m_nErrorStart; + sal_Int32 m_nErrorEnd; + bool m_bIsUndoEditMode; + + Link<LinkParamNone*,void> m_aModifyLink; + + void CallModifyLink() {m_aModifyLink.Call(nullptr); } + + SpellDialog* GetSpellDialog() const { return m_pSpellDialog; } + + bool GetErrorDescription(SpellErrorDescription& rSpellErrorDescription, sal_Int32 nPosition); + + DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void); + DECL_LINK(EditStatusHdl, EditStatus&, void); + DECL_LINK(ToolbarHdl, const OUString&, void); + + void DoScroll(); + void SetScrollBarRange(); + +protected: + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + +public: + SentenceEditWindow_Impl(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual void EditViewScrollStateChange() override; + void SetSpellDialog(SpellDialog* pDialog) { m_pSpellDialog = pDialog; } + virtual ~SentenceEditWindow_Impl() override; + + void Init(weld::Toolbar* pToolbar); + void SetModifyHdl(const Link<LinkParamNone*,void>& rLink) + { + m_aModifyLink = rLink; + m_xEditEngine->SetModifyHdl(m_aModifyLink); + } + + void SetAttrib(const SfxPoolItem& rItem, sal_Int32 nStart, sal_Int32 nEnd); + + void SetText(const OUString& rStr); + + bool MarkNextError( bool bIgnoreCurrentError, const css::uno::Reference<css::linguistic2::XSpellChecker1>& ); + int ChangeMarkedWord(const OUString& rNewWord, LanguageType eLanguage); + void MoveErrorMarkTo(sal_Int32 nErrorStart, sal_Int32 nErrorEnd, bool bGrammar); + OUString GetErrorText() const; + void RestoreCurrentError(); + + void SetAlternatives( + const css::uno::Reference<css::linguistic2::XSpellAlternatives>& ); + + bool GetAlternatives(SpellErrorDescription& rDesc); + + void ClearModifyFlag() { m_xEditEngine->ClearModifyFlag(); } + void ResetModified() { ClearModifyFlag(); m_bIsUndoEditMode = false;} + bool IsModified() const { return m_xEditEngine->IsModified(); } + + bool IsUndoEditMode() const { return m_bIsUndoEditMode;} + void SetUndoEditMode(bool bSet); + + svx::SpellPortions CreateSpellPortions() const; + + void ResetUndo(); + void Undo(); + void AddUndoAction( std::unique_ptr<SfxUndoAction> pAction ); + size_t GetUndoActionCount() const; + void UndoActionStart( sal_uInt16 nId ); + void UndoActionEnd(); + + void MoveErrorEnd(tools::Long nOffset); + + void ResetIgnoreErrorsAt() { m_aIgnoreErrorsAt.clear(); } +}; + +// class SvxSpellDialog --------------------------------------------- +class SpellDialogChildWindow; + +class SpellDialog : public SfxModelessDialogController +{ + friend class SentenceEditWindow_Impl; +private: + OUString m_sResumeST; + OUString m_sIgnoreOnceST; + OUString m_sNoSuggestionsST; + + OUString m_sTitleSpelling; + OUString m_sTitleSpellingGrammar; + + Link<SpellUndoAction_Impl&,void> aDialogUndoLink; + ImplSVEvent * m_pInitHdlEvent; + bool bFocusLocked; + + svx::SpellDialogChildWindow& rParent; + svx::SpellPortions m_aSavedSentence; + + std::unique_ptr<SpellDialog_Impl> pImpl; + css::uno::Reference< + css::linguistic2::XSpellChecker1 > xSpell; + + std::unique_ptr<weld::Label> m_xAltTitle; + std::unique_ptr<weld::Label> m_xResumeFT; + std::unique_ptr<weld::Label> m_xNoSuggestionsFT; + std::unique_ptr<weld::Label> m_xLanguageFT; + std::unique_ptr<SvxLanguageBox> m_xLanguageLB; + std::unique_ptr<weld::Label> m_xExplainFT; + std::unique_ptr<weld::LinkButton> m_xExplainLink; + std::unique_ptr<weld::Label> m_xNotInDictFT; + std::unique_ptr<SentenceEditWindow_Impl> m_xSentenceED; + std::unique_ptr<weld::Label> m_xSuggestionFT; + std::unique_ptr<weld::TreeView> m_xSuggestionLB; + std::unique_ptr<weld::Button> m_xIgnorePB; + std::unique_ptr<weld::Button> m_xIgnoreAllPB; + std::unique_ptr<weld::Button> m_xIgnoreRulePB; + std::unique_ptr<weld::Button> m_xAddToDictPB; + std::unique_ptr<weld::MenuButton> m_xAddToDictMB; + std::unique_ptr<weld::Button> m_xChangePB; + std::unique_ptr<weld::Button> m_xChangeAllPB; + std::unique_ptr<weld::Button> m_xAutoCorrPB; + std::unique_ptr<weld::CheckButton> m_xCheckGrammarCB; + std::unique_ptr<weld::Button> m_xOptionsPB; + std::unique_ptr<weld::Button> m_xUndoPB; + std::unique_ptr<weld::Button> m_xClosePB; + std::unique_ptr<weld::Toolbar> m_xToolbar; + std::unique_ptr<weld::CustomWeld> m_xSentenceEDWeld; + std::shared_ptr<SfxSingleTabDialogController> m_xOptionsDlg; + + DECL_LINK(ChangeHdl, weld::Button&, void); + DECL_LINK(DoubleClickChangeHdl, weld::TreeView&, bool); + DECL_LINK(ChangeAllHdl, weld::Button&, void); + DECL_LINK(IgnoreAllHdl, weld::Button&, void); + DECL_LINK(IgnoreHdl, weld::Button&, void); + DECL_LINK(CheckGrammarHdl, weld::Toggleable&, void); + DECL_LINK(ExtClickHdl, weld::Button&, void); + DECL_LINK(CancelHdl, weld::Button&, void); + DECL_LINK(ModifyHdl, LinkParamNone*, void); + DECL_LINK(UndoHdl, weld::Button&, void); + DECL_LINK(AddToDictSelectHdl, const OUString&, void); + DECL_LINK(AddToDictClickHdl, weld::Button&, void); + DECL_LINK(LanguageSelectHdl, weld::ComboBox&, void); + DECL_LINK(DialogUndoHdl, SpellUndoAction_Impl&, void); + + DECL_LINK(InitHdl, void*, void); + + void AddToDictionaryExecute(const OUString& rItemId); + void StartSpellOptDlg_Impl(); + int InitUserDicts(); + void UpdateBoxes_Impl(bool bCallFromSelectHdl = false); + void Init_Impl(); + void SpellContinue_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard = nullptr, bool UseSavedSentence = false, bool bIgnoreCurrentError = false ); + void LockFocusChanges( bool bLock ) {bFocusLocked = bLock;} + void ToplevelFocusChanged(); + void Impl_Restore(bool bUseSavedSentence); + + LanguageType GetSelectedLang_Impl() const; + + /** Retrieves the next sentence. + */ + bool GetNextSentence_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard, bool bUseSavedSentence, bool bRecheck /*for rechecking the current sentence*/); + /** Corrects all errors that have been selected to be changed always + */ + static bool ApplyChangeAllList_Impl(SpellPortions& rSentence, bool& bHasReplaced); + void SetTitle_Impl(LanguageType nLang); + +protected: + + OUString getReplacementString() const; + +public: + SpellDialog( + svx::SpellDialogChildWindow* pChildWindow, + weld::Window * pParent, + SfxBindings* pBindings); + virtual ~SpellDialog() override; + + virtual void Activate() override; + virtual void Deactivate() override; + + virtual void Close() override; + + void InvalidateDialog(); +}; + +} //namespace svx + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/SvxConfigPageHelper.hxx b/cui/source/inc/SvxConfigPageHelper.hxx new file mode 100644 index 0000000000..025c4aad18 --- /dev/null +++ b/cui/source/inc/SvxConfigPageHelper.hxx @@ -0,0 +1,76 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/frame/XModuleManager2.hpp> + +#include "cfg.hxx" + +class SvxConfigPageHelper +{ +public: + static void RemoveEntry(SvxEntries* pEntries, SvxConfigEntry const* pChildEntry); + + static OUString replaceSaveInName(const OUString& rMessage, std::u16string_view rSaveInName); + static OUString stripHotKey(const OUString& str); + static OUString replaceSixteen(const OUString& str, sal_Int32 nReplacement); + + static sal_Int16 GetImageType(); + static void InitImageType(); + static css::uno::Reference<css::graphic::XGraphic> + GetGraphic(const css::uno::Reference<css::ui::XImageManager>& xImageManager, + const OUString& rCommandURL); + + static OUString generateCustomName(const OUString& prefix, SvxEntries* entries, + sal_Int32 suffix = 1); + static OUString generateCustomMenuURL(SvxEntries* entries, sal_Int32 suffix = 1); + static sal_uInt32 generateRandomValue(); + /** + Generates a custom resource URL for a new toolbar. + Typically something like: private:resource/toolbar/custom_toolbar_######## + The last 8 letters are randomly generated alphanumeric characters. + */ + static OUString generateCustomURL(SvxEntries* entries); + + static OUString GetModuleName(std::u16string_view aModuleId); + static OUString + GetUIModuleName(const OUString& aModuleId, + const css::uno::Reference<css::frame::XModuleManager2>& rModuleManager); + + static bool + GetMenuItemData(const css::uno::Reference<css::container::XIndexAccess>& rItemContainer, + sal_Int32 nIndex, OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType, + sal_Int32& rStyle, css::uno::Reference<css::container::XIndexAccess>& rSubMenu); + static bool + GetToolbarItemData(const css::uno::Reference<css::container::XIndexAccess>& rItemContainer, + sal_Int32 nIndex, OUString& rCommandURL, OUString& rLabel, sal_uInt16& rType, + bool& rIsVisible, sal_Int32& rStyle); + + static css::uno::Sequence<css::beans::PropertyValue> + ConvertSvxConfigEntry(const SvxConfigEntry* pEntry); + static css::uno::Sequence<css::beans::PropertyValue> + ConvertToolbarEntry(const SvxConfigEntry* pEntry); + + static bool EntrySort(SvxConfigEntry const* a, SvxConfigEntry const* b); + + static bool SvxConfigEntryModified(SvxConfigEntry const* pEntry); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/SvxMenuConfigPage.hxx b/cui/source/inc/SvxMenuConfigPage.hxx new file mode 100644 index 0000000000..36fee041de --- /dev/null +++ b/cui/source/inc/SvxMenuConfigPage.hxx @@ -0,0 +1,69 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/weld.hxx> +#include <com/sun/star/ui/XUIConfigurationManager.hpp> + +#include "cfg.hxx" //for SvxConfigPage and SaveInData + +class SvxMenuConfigPage : public SvxConfigPage +{ +private: + bool m_bIsMenuBar; + + DECL_LINK(SelectMenuEntry, weld::TreeView&, void); + DECL_LINK(ContentContextMenuHdl, const CommandEvent&, bool); + DECL_LINK(FunctionContextMenuHdl, const CommandEvent&, bool); + + DECL_LINK(GearHdl, const OUString&, void); + + DECL_LINK(SelectCategory, weld::ComboBox&, void); + + DECL_LINK(AddCommandHdl, weld::Button&, void); + DECL_LINK(RemoveCommandHdl, weld::Button&, void); + + DECL_LINK(InsertHdl, const OUString&, void); + DECL_LINK(ModifyItemHdl, const OUString&, void); + DECL_LINK(ResetMenuHdl, weld::Button&, void); + + DECL_LINK(MenuEntriesSizeAllocHdl, const Size&, void); + + virtual void ListModified() override; + + void Init() override; + void UpdateButtonStates() override; + short QueryReset() override; + void DeleteSelectedContent() override; + void DeleteSelectedTopLevel() override; + + virtual void SelectElement() override; + +public: + SvxMenuConfigPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rItemSet, bool bIsMenuBar = true); + virtual ~SvxMenuConfigPage() 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/SvxNotebookbarConfigPage.hxx b/cui/source/inc/SvxNotebookbarConfigPage.hxx new file mode 100644 index 0000000000..672d2e8299 --- /dev/null +++ b/cui/source/inc/SvxNotebookbarConfigPage.hxx @@ -0,0 +1,92 @@ +/* -*- 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 . + */ + +#pragma once + +#include <libxml/parser.h> +#include <vcl/weld.hxx> +#include <com/sun/star/ui/XUIConfigurationManager.hpp> + +#include <memory> +#include <vector> + +#include "cfg.hxx" //for SvxConfigPage and SaveInData + +class SvxNotebookbarConfigPage : public SvxConfigPage +{ +private: + void UpdateButtonStates() override; + short QueryReset() override; + void Init() override; + void DeleteSelectedContent() override; + void DeleteSelectedTopLevel() override; + virtual void SelectElement() override; + void SetElement(); + +public: + struct NotebookbarEntries + { + OUString sUIItemId; + OUString sClassId; + OUString sActionName; + OUString sDisplayName; + OUString sVisibleValue; + }; + struct CategoriesEntries + { + OUString sDisplayName; + OUString sUIItemId; + OUString sClassType; + }; + SvxNotebookbarConfigPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rItemSet); + virtual ~SvxNotebookbarConfigPage() override; + SaveInData* CreateSaveInData(const css::uno::Reference<css::ui::XUIConfigurationManager>&, + const css::uno::Reference<css::ui::XUIConfigurationManager>&, + const OUString& aModuleId, bool docConfig) override; + static void FillFunctionsList(xmlNodePtr pRootNodePtr, + std::vector<NotebookbarEntries>& aEntries, + std::vector<CategoriesEntries>& aCategoryList, + OUString& sActiveCategory); + static void searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries, + std::vector<CategoriesEntries>& aCategoryList, + OUString& sActiveCategory, + CategoriesEntries& aCurCategoryEntry, xmlNode* pNodePtr, + bool isCategory); + static void getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries); +}; + +class SvxNotebookbarEntriesListBox final : public SvxMenuEntriesListBox +{ + typedef std::unordered_map<OUString, OUString> TooltipMap; + TooltipMap m_aTooltipMap; + + void ChangedVisibility(int nRow); + DECL_LINK(CheckButtonHdl, const weld::TreeView::iter_col&, void); + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(QueryTooltip, const weld::TreeIter& rIter, OUString); + +public: + SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPg); + virtual ~SvxNotebookbarEntriesListBox() override; + + TooltipMap& GetTooltipMap() { return m_aTooltipMap; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/SvxToolbarConfigPage.hxx b/cui/source/inc/SvxToolbarConfigPage.hxx new file mode 100644 index 0000000000..28fe658f2c --- /dev/null +++ b/cui/source/inc/SvxToolbarConfigPage.hxx @@ -0,0 +1,84 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/weld.hxx> +#include <com/sun/star/ui/XUIConfigurationManager.hpp> + +#include <memory> + +#include "cfg.hxx" //for SvxConfigPage and SaveInData + +class SvxToolbarConfigPage : public SvxConfigPage +{ +private: + DECL_LINK(SelectToolbarEntry, weld::TreeView&, void); + DECL_LINK(MoveHdl, weld::Button&, void); + + DECL_LINK(GearHdl, const OUString&, void); + + DECL_LINK(SelectCategory, weld::ComboBox&, void); + + DECL_LINK(ContentContextMenuHdl, const CommandEvent&, bool); + DECL_LINK(FunctionContextMenuHdl, const CommandEvent&, bool); + + DECL_LINK(AddCommandHdl, weld::Button&, void); + DECL_LINK(RemoveCommandHdl, weld::Button&, void); + + DECL_LINK(InsertHdl, const OUString&, void); + DECL_LINK(ModifyItemHdl, const OUString&, void); + DECL_LINK(ResetToolbarHdl, weld::Button&, void); + + virtual void ListModified() override; + + void UpdateButtonStates() override; + short QueryReset() override; + void Init() override; + void DeleteSelectedContent() override; + void DeleteSelectedTopLevel() override; + virtual void SelectElement() override; + +public: + SvxToolbarConfigPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rItemSet); + virtual ~SvxToolbarConfigPage() override; + + void AddFunction(int nTarget = -1); + + void MoveEntry(bool bMoveUp) override; + + SaveInData* CreateSaveInData(const css::uno::Reference<css::ui::XUIConfigurationManager>&, + const css::uno::Reference<css::ui::XUIConfigurationManager>&, + const OUString& aModuleId, bool docConfig) override; +}; + +class SvxToolbarEntriesListBox final : public SvxMenuEntriesListBox +{ + void ChangedVisibility(int nRow); + + DECL_LINK(CheckButtonHdl, const weld::TreeView::iter_col&, void); + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + +public: + SvxToolbarEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxToolbarConfigPage* pPg); + virtual ~SvxToolbarEntriesListBox() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/TextColumnsPage.hxx b/cui/source/inc/TextColumnsPage.hxx new file mode 100644 index 0000000000..af45c23c93 --- /dev/null +++ b/cui/source/inc/TextColumnsPage.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <sal/config.h> + +#include <sfx2/tabdlg.hxx> + +#include <memory> + +/// Tab page for EditEngine columns properties +class SvxTextColumnsPage : public SfxTabPage +{ +private: + static const WhichRangesContainer pRanges; + + std::unique_ptr<weld::SpinButton> m_xColumnsNumber; + std::unique_ptr<weld::MetricSpinButton> m_xColumnsSpacing; + +public: + SvxTextColumnsPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rInAttrs); + virtual ~SvxTextColumnsPage() override; + + static std::unique_ptr<SfxTabPage> + Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet*); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet(SfxItemSet*) override; + virtual void Reset(const SfxItemSet*) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx new file mode 100644 index 0000000000..42eae5467e --- /dev/null +++ b/cui/source/inc/about.hxx @@ -0,0 +1,58 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> + +class AboutDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::LinkButton> m_pCreditsButton; + std::unique_ptr<weld::LinkButton> m_pWebsiteButton; + std::unique_ptr<weld::LinkButton> m_pReleaseNotesButton; + std::unique_ptr<weld::Button> m_pCloseButton; + std::unique_ptr<weld::Button> m_pCopyButton; + + std::unique_ptr<weld::Image> m_pBrandImage; + std::unique_ptr<weld::Image> m_pAboutImage; + std::unique_ptr<weld::Label> m_pVersionLabel; + std::unique_ptr<weld::Label> m_pBuildCaption; + std::unique_ptr<weld::LinkButton> m_pBuildLabel; + std::unique_ptr<weld::Label> m_pEnvLabel; + std::unique_ptr<weld::Label> m_pUILabel; + std::unique_ptr<weld::Label> m_pLocaleLabel; + std::unique_ptr<weld::Label> m_pMiscLabel; + std::unique_ptr<weld::Label> m_pCopyrightLabel; + + static OUString GetVersionString(); + static OUString GetBuildString(); + static OUString GetLocaleString(bool bLocalized = true); + static OUString GetMiscString(); + + static OUString GetCopyrightString(); + static bool IsStringValidGitHash(std::u16string_view hash); + + DECL_LINK(HandleClick, weld::Button&, void); + +public: + AboutDialog(weld::Window* pParent); + virtual ~AboutDialog() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx new file mode 100644 index 0000000000..e9207d5a1a --- /dev/null +++ b/cui/source/inc/acccfg.hxx @@ -0,0 +1,160 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/ui/XAcceleratorConfiguration.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/frame/XFrame.hpp> + +#include <sfx2/tabdlg.hxx> +#include <vcl/idle.hxx> +#include <vcl/keycod.hxx> +#include <i18nutil/searchopt.hxx> +#include <config_features.h> +#include "cfgutil.hxx" + +#if HAVE_FEATURE_SCRIPTING +class SfxMacroInfoItem; +#endif +class CuiConfigFunctionListBox; +class SfxAcceleratorConfigPage; +class SfxStringItem; + +// class SfxAcceleratorConfigPage ---------------------------------------- + +struct TAccInfo +{ +public: + TAccInfo(sal_Int32 nKeyPos, sal_Int32 nListPos, const vcl::KeyCode& aKey) + : m_nKeyPos(nKeyPos) + , m_nListPos(nListPos) + , m_bIsConfigurable(true) /**< it's important to set true as default - + because only fix entries will be disabled later... */ + , m_sCommand() + , m_aKey(aKey) + { + } + + bool isConfigured() const + { + return (m_nKeyPos > -1 && m_nListPos > -1 && !m_sCommand.isEmpty()); + } + + sal_Int32 m_nKeyPos; + sal_Int32 m_nListPos; + bool m_bIsConfigurable; + OUString m_sCommand; + vcl::KeyCode m_aKey; +}; + +namespace sfx2 +{ +class FileDialogHelper; +} + +enum class StartFileDialogType +{ + Open, + SaveAs +}; + +class SfxAcceleratorConfigPage : public SfxTabPage +{ +private: +#if HAVE_FEATURE_SCRIPTING + const SfxMacroInfoItem* m_pMacroInfoItem; +#endif + std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg; + + OUString aLoadAccelConfigStr; + OUString aSaveAccelConfigStr; + OUString aFilterAllStr; + OUString aFilterCfgStr; + SfxStylesInfo_Impl m_aStylesInfo; + bool m_bStylesInfoInitialized; + + css::uno::Reference<css::uno::XComponentContext> m_xContext; + css::uno::Reference<css::ui::XAcceleratorConfiguration> m_xGlobal; + css::uno::Reference<css::ui::XAcceleratorConfiguration> m_xModule; + css::uno::Reference<css::ui::XAcceleratorConfiguration> m_xAct; + css::uno::Reference<css::container::XNameAccess> m_xUICmdDescription; + css::uno::Reference<css::frame::XFrame> m_xFrame; + + OUString m_sModuleLongName; + OUString m_sModuleUIName; + + // For search + Timer m_aUpdateDataTimer; + i18nutil::SearchOptions2 m_options; + + Idle m_aFillGroupIdle; + + std::unique_ptr<weld::TreeView> m_xEntriesBox; + std::unique_ptr<weld::RadioButton> m_xOfficeButton; + std::unique_ptr<weld::RadioButton> m_xModuleButton; + std::unique_ptr<weld::Button> m_xChangeButton; + std::unique_ptr<weld::Button> m_xRemoveButton; + std::unique_ptr<CuiConfigGroupListBox> m_xGroupLBox; + std::unique_ptr<CuiConfigFunctionListBox> m_xFunctionBox; + std::unique_ptr<weld::TreeView> m_xKeyBox; + std::unique_ptr<weld::Entry> m_xSearchEdit; + std::unique_ptr<weld::Button> m_xLoadButton; + std::unique_ptr<weld::Button> m_xSaveButton; + std::unique_ptr<weld::Button> m_xResetButton; + + DECL_LINK(ChangeHdl, weld::Button&, void); + DECL_LINK(RemoveHdl, weld::Button&, void); + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(SearchUpdateHdl, weld::Entry&, void); + DECL_LINK(Save, weld::Button&, void); + DECL_LINK(Load, weld::Button&, void); + DECL_LINK(Default, weld::Button&, void); + DECL_LINK(RadioHdl, weld::Toggleable&, void); + DECL_LINK(ImplUpdateDataHdl, Timer*, void); + DECL_LINK(FocusOut_Impl, weld::Widget&, void); + DECL_LINK(TimeOut_Impl, Timer*, void); + + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + + DECL_LINK(LoadHdl, sfx2::FileDialogHelper*, void); + DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void); + + OUString GetLabel4Command(const OUString& rCommand); + int applySearchFilter(OUString const& rSearchTerm); + void InitAccCfg(); + sal_Int32 MapKeyCodeToPos(const vcl::KeyCode& rCode) const; + void StartFileDialog(StartFileDialogType nType, const OUString& rTitle); + + void Init(const css::uno::Reference<css::ui::XAcceleratorConfiguration>& pAccMgr); + void ResetConfig(); + +public: + SfxAcceleratorConfigPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rItemSet); + virtual ~SfxAcceleratorConfigPage() override; + + virtual bool FillItemSet(SfxItemSet*) override; + virtual void Reset(const SfxItemSet*) override; + + void Apply(const css::uno::Reference<css::ui::XAcceleratorConfiguration>& pAccMgr); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx new file mode 100644 index 0000000000..caea33e421 --- /dev/null +++ b/cui/source/inc/align.hxx @@ -0,0 +1,120 @@ +/* -*- 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 . + */ +#pragma once + +// list box indexes +#define ALIGNDLG_HORALIGN_STD 0 +#define ALIGNDLG_HORALIGN_LEFT 1 +#define ALIGNDLG_HORALIGN_CENTER 2 +#define ALIGNDLG_HORALIGN_RIGHT 3 +#define ALIGNDLG_HORALIGN_BLOCK 4 +#define ALIGNDLG_HORALIGN_FILL 5 +#define ALIGNDLG_HORALIGN_DISTRIBUTED 6 + +#define ALIGNDLG_VERALIGN_STD 0 +#define ALIGNDLG_VERALIGN_TOP 1 +#define ALIGNDLG_VERALIGN_MID 2 +#define ALIGNDLG_VERALIGN_BOTTOM 3 +#define ALIGNDLG_VERALIGN_BLOCK 4 +#define ALIGNDLG_VERALIGN_DISTRIBUTED 5 + +#include <sfx2/tabdlg.hxx> +#include <svtools/valueset.hxx> +#include <svx/dialcontrol.hxx> +#include <svx/frmdirlbox.hxx> +#include <vcl/weld.hxx> + +class SfxEnumItemInterface; + +namespace svx { + + +class AlignmentTabPage : public SfxTabPage +{ + static const WhichRangesContainer s_pRanges; + +public: + virtual ~AlignmentTabPage() override; + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet ); + explicit AlignmentTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet); + + static WhichRangesContainer GetRanges() { return s_pRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +private: + void InitVsRefEgde(); + void UpdateEnableControls(); + + bool HasAlignmentChanged( const SfxItemSet& rNew, TypedWhichId<SfxEnumItemInterface> nWhich ) const; + + DECL_LINK(UpdateEnableHdl, weld::ComboBox&, void); + DECL_LINK(StackedClickHdl, weld::Toggleable&, void); + DECL_LINK(AsianModeClickHdl, weld::Toggleable&, void); + DECL_LINK(WrapClickHdl, weld::Toggleable&, void); + DECL_LINK(HyphenClickHdl, weld::Toggleable&, void); + DECL_LINK(ShrinkClickHdl, weld::Toggleable&, void); + +private: + weld::TriStateEnabled m_aStackedState; + weld::TriStateEnabled m_aAsianModeState; + weld::TriStateEnabled m_aWrapState; + weld::TriStateEnabled m_aHyphenState; + weld::TriStateEnabled m_aShrinkState; + + ValueSet m_aVsRefEdge; + + std::unique_ptr<weld::ComboBox> m_xLbHorAlign; + std::unique_ptr<weld::Label> m_xFtIndent; + std::unique_ptr<weld::MetricSpinButton> m_xEdIndent; + std::unique_ptr<weld::Label> m_xFtVerAlign; + std::unique_ptr<weld::ComboBox> m_xLbVerAlign; + + std::unique_ptr<weld::Label> m_xFtRotate; + std::unique_ptr<weld::MetricSpinButton> m_xNfRotate; + std::unique_ptr<weld::Label> m_xFtRefEdge; + std::unique_ptr<weld::CheckButton> m_xCbStacked; + std::unique_ptr<weld::CheckButton> m_xCbAsianMode; + + std::unique_ptr<weld::CheckButton> m_xBtnWrap; + std::unique_ptr<weld::CheckButton> m_xBtnHyphen; + std::unique_ptr<weld::CheckButton> m_xBtnShrink; + std::unique_ptr<svx::FrameDirectionListBox> m_xLbFrameDir; + + // hidden labels/string + std::unique_ptr<weld::Label> m_xFtBotLock; + std::unique_ptr<weld::Label> m_xFtTopLock; + std::unique_ptr<weld::Label> m_xFtCelLock; + std::unique_ptr<weld::Label> m_xFtABCD; + + std::unique_ptr<weld::Widget> m_xAlignmentFrame; + std::unique_ptr<weld::Widget> m_xOrientFrame; + std::unique_ptr<weld::Widget> m_xPropertiesFrame; + + std::unique_ptr<weld::CustomWeld> m_xVsRefEdge; + std::unique_ptr<DialControl> m_xCtrlDial; + std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin; +}; + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx new file mode 100644 index 0000000000..2677b8535e --- /dev/null +++ b/cui/source/inc/autocdlg.hxx @@ -0,0 +1,423 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/langbox.hxx> +#include <unotools/collatorwrapper.hxx> + +#include <map> +#include <set> +#include <utility> + +class CharClass; +class SmartTagMgr; + +namespace editeng { class SortedAutoCompleteStrings; } + +// class OfaAutoCorrDlg -------------------------------------------------- + +class OfaAutoCorrDlg : public SfxTabDialogController +{ + std::unique_ptr<weld::Widget> m_xLanguageBox; + std::unique_ptr<SvxLanguageBox> m_xLanguageLB; + + DECL_LINK(SelectLanguageHdl, weld::ComboBox&, void); +public: + + OfaAutoCorrDlg(weld::Window* pParent, const SfxItemSet *pSet); + virtual ~OfaAutoCorrDlg() override; + + void EnableLanguage(bool bEnable); +}; + +// class OfaAutocorrOptionsPage ------------------------------------------ + +class OfaAutocorrOptionsPage : public SfxTabPage +{ +private: + OUString m_sInput; + OUString m_sDoubleCaps; + OUString m_sStartCap; + OUString m_sBoldUnderline; + OUString m_sURL; + OUString m_sDOI; + OUString m_sNoDblSpaces; + OUString m_sDash; + OUString m_sAccidentalCaps; + + std::unique_ptr<weld::TreeView> m_xCheckLB; + + void InsertEntry(const OUString& rTxt); + +public: + OfaAutocorrOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~OfaAutocorrOptionsPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; + +}; + +// class OfaSwAutoFmtOptionsPage ---------------------------------------------------- + +class OfaSwAutoFmtOptionsPage : public SfxTabPage +{ + OUString sDeleteEmptyPara; + OUString sUseReplaceTbl; + OUString sCapitalStartWord; + OUString sCapitalStartSentence; + OUString sUserStyle; + OUString sBullet; + OUString sBoldUnder; + OUString sNoDblSpaces; + OUString sCorrectCapsLock; + OUString sDetectURL; + OUString sDetectDOI; + OUString sDash; + OUString sRightMargin; + OUString sNum; + OUString sBulletsAfterSpace; + OUString sBorder; + OUString sTable; + OUString sReplaceTemplates; + OUString sDelSpaceAtSttEnd; + OUString sDelSpaceBetweenLines; + + OUString sMargin; + OUString sBulletChar; + OUString sByInputBulletChar; + + vcl::Font aBulletFont; + vcl::Font aByInputBulletFont; + sal_uInt16 nPercent; + + std::unique_ptr<weld::TreeView> m_xCheckLB; + std::unique_ptr<weld::Button> m_xEditPB; + + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(EditHdl, weld::Button&, void); + DECL_LINK(DoubleClickEditHdl, weld::TreeView&, bool); + + void CreateEntry(const OUString& rTxt, sal_uInt16 nCol); + +public: + OfaSwAutoFmtOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + virtual ~OfaSwAutoFmtOptionsPage() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; +}; + +// class OfaAutocorrReplacePage ------------------------------------------ + +struct DoubleString +{ + OUString sShort; + OUString sLong; + void* pUserData; ///< CheckBox -> form. Text Bool -> selection text + DoubleString(OUString aShort, OUString aLong) + : sShort(std::move(aShort)) + , sLong(std::move(aLong)) + , pUserData(nullptr) + { + } +}; + +typedef std::vector<DoubleString> DoubleStringArray; + +struct StringChangeList +{ + DoubleStringArray aNewEntries; + DoubleStringArray aDeletedEntries; +}; + +typedef std::map<LanguageType, StringChangeList> StringChangeTable; + +class OfaAutocorrReplacePage : public SfxTabPage +{ +private: + + StringChangeTable aChangesTable; + + OUString sModify; + OUString sNew; + + std::set<OUString> aFormatText; + std::map<LanguageType, DoubleStringArray> + aDoubleStringTable; + CollatorWrapper maCompareClass; + std::unique_ptr<CharClass> pCharClass; + LanguageType eLang; + + bool bHasSelectionText; + bool bFirstSelect:1; + bool bReplaceEditChanged:1; + bool bSWriter:1; + + std::vector<int> m_aReplaceFixedWidths; + std::unique_ptr<weld::CheckButton> m_xTextOnlyCB; + std::unique_ptr<weld::Entry> m_xShortED; + std::unique_ptr<weld::Entry> m_xReplaceED; + std::unique_ptr<weld::TreeView> m_xReplaceTLB; + std::unique_ptr<weld::Button> m_xNewReplacePB; + std::unique_ptr<weld::Button> m_xReplacePB; + std::unique_ptr<weld::Button> m_xDeleteReplacePB; + std::unique_ptr<weld::Container> m_xButtonBox; + + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(NewDelButtonHdl, weld::Button&, void); + DECL_LINK(NewDelActionHdl, weld::Entry&, bool); + DECL_LINK(EntrySizeAllocHdl, const Size&, void); + DECL_LINK(ModifyHdl, weld::Entry&, void); + bool NewDelHdl(const weld::Widget*); + + void RefillReplaceBox( bool bFromReset, + LanguageType eOldLanguage, + LanguageType eNewLanguage); + +public: + OfaAutocorrReplacePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~OfaAutocorrReplacePage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetLanguage(LanguageType eSet); + void DeleteEntry(const OUString& sShort, const OUString& sLong); + void NewEntry(const OUString& sShort, const OUString& sLong, bool bKeepSourceFormatting); +}; + +// class OfaAutocorrExceptPage --------------------------------------------- + +struct StringsArrays +{ + std::vector<OUString> aAbbrevStrings; + std::vector<OUString> aDoubleCapsStrings; + + StringsArrays() { } +}; +typedef std::map<LanguageType, StringsArrays> StringsTable; + +class OfaAutocorrExceptPage : public SfxTabPage +{ +private: + StringsTable aStringsTable; + CollatorWrapper maCompareClass; + LanguageType eLang; + + std::unique_ptr<weld::Entry> m_xAbbrevED; + std::unique_ptr<weld::TreeView> m_xAbbrevLB; + std::unique_ptr<weld::Button> m_xNewAbbrevPB; + std::unique_ptr<weld::Button> m_xDelAbbrevPB; + std::unique_ptr<weld::CheckButton> m_xAutoAbbrevCB; + + std::unique_ptr<weld::Entry> m_xDoubleCapsED; + std::unique_ptr<weld::TreeView> m_xDoubleCapsLB; + std::unique_ptr<weld::Button> m_xNewDoublePB; + std::unique_ptr<weld::Button> m_xDelDoublePB; + std::unique_ptr<weld::CheckButton> m_xAutoCapsCB; + + DECL_LINK(NewDelButtonHdl, weld::Button&, void); + DECL_LINK(NewDelActionHdl, weld::Entry&, bool); + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(ModifyHdl, weld::Entry&, void); + bool NewDelHdl(const weld::Widget*); + /// Box filled with new language + void RefillReplaceBoxes(bool bFromReset, + LanguageType eOldLanguage, + LanguageType eNewLanguage); +public: + OfaAutocorrExceptPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~OfaAutocorrExceptPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + void SetLanguage(LanguageType eSet); + +}; + +// class OfaQuoteTabPage ------------------------------------------------- + +class OfaQuoteTabPage : public SfxTabPage +{ +private: + OUString sNonBrkSpace; + OUString sOrdinal; + OUString sTransliterateRTL; + OUString sAngleQuotes; + + sal_UCS4 cSglStartQuote; + sal_UCS4 cSglEndQuote; + + sal_UCS4 cStartQuote; + sal_UCS4 cEndQuote; + + std::unique_ptr<weld::CheckButton> m_xSingleTypoCB; + std::unique_ptr<weld::Button> m_xSglStartQuotePB; + std::unique_ptr<weld::Label> m_xSglStartExFT; + std::unique_ptr<weld::Button> m_xSglEndQuotePB; + std::unique_ptr<weld::Label> m_xSglEndExFT; + std::unique_ptr<weld::Button> m_xSglStandardPB; + std::unique_ptr<weld::CheckButton> m_xDoubleTypoCB; + std::unique_ptr<weld::Button> m_xDblStartQuotePB; + std::unique_ptr<weld::Label> m_xDblStartExFT; + std::unique_ptr<weld::Button> m_xDblEndQuotePB; + std::unique_ptr<weld::Label> m_xDblEndExFT; + std::unique_ptr<weld::Button> m_xDblStandardPB; + OUString m_sStandard; + /// For anything but writer + std::unique_ptr<weld::TreeView> m_xCheckLB; + /// Just for writer + std::unique_ptr<weld::TreeView> m_xSwCheckLB; + + + DECL_LINK(QuoteHdl, weld::Button&, void); + DECL_LINK(StdQuoteHdl, weld::Button&, void); + + OUString ChangeStringExt_Impl( sal_UCS4 ); + + static void CreateEntry(weld::TreeView& rLstBox, const OUString& rTxt, + sal_uInt16 nCol, sal_uInt16 nTextCol); + +public: + OfaQuoteTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + virtual ~OfaQuoteTabPage() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; +}; + +// class OfaAutoCompleteTabPage --------------------------------------------- + +class OfaAutoCompleteTabPage : public SfxTabPage +{ +private: + editeng::SortedAutoCompleteStrings* m_pAutoCompleteList; + sal_uInt16 m_nAutoCmpltListCnt; + + std::unique_ptr<weld::CheckButton> m_xCBActiv; ///<Enable word completion + std::unique_ptr<weld::CheckButton> m_xCBAppendSpace;///<Append space + std::unique_ptr<weld::CheckButton> m_xCBAsTip; ///<Show as tip + + std::unique_ptr<weld::CheckButton> m_xCBCollect;///<Collect words + std::unique_ptr<weld::CheckButton> m_xCBRemoveList;///<...save the list for later use... + + std::unique_ptr<weld::ComboBox> m_xDCBExpandKey; + std::unique_ptr<weld::SpinButton> m_xNFMinWordlen; + std::unique_ptr<weld::SpinButton> m_xNFMaxEntries; + std::unique_ptr<weld::TreeView> m_xLBEntries; + std::unique_ptr<weld::Button> m_xPBEntries; + + DECL_LINK(CheckHdl, weld::Toggleable&, void); + DECL_LINK(KeyReleaseHdl, const KeyEvent&, bool); + +public: + OfaAutoCompleteTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + virtual ~OfaAutoCompleteTabPage() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; + + void CopyToClipboard() const; + DECL_LINK(DeleteHdl, weld::Button&, void); +}; + +// class OfaSmartTagOptionsTabPage --------------------------------------------- + +/** Smart tag options tab page + + This tab page is used to enable/disable smart tag types +*/ +class OfaSmartTagOptionsTabPage : public SfxTabPage +{ +private: + + // controls + std::unique_ptr<weld::CheckButton> m_xMainCB; + std::unique_ptr<weld::TreeView> m_xSmartTagTypesLB; + std::unique_ptr<weld::Button> m_xPropertiesPB; + + /** Inserts items into m_aSmartTagTypesLB + + Reads out the smart tag types supported by the SmartTagMgr and + inserts the associated strings into the list box. + */ + void FillListBox( const SmartTagMgr& rSmartTagMgr ); + + /** Clears the m_aSmartTagTypesLB + */ + void ClearListBox(); + + /** Handler for the check box + + Enables/disables all controls in the tab page (except from the + check box. + */ + DECL_LINK(CheckHdl, weld::Toggleable&, void); + + /** Handler for the push button + + Calls the displayPropertyPage function of the smart tag recognizer + associated with the currently selected smart tag type. + */ + DECL_LINK(ClickHdl, weld::Button&, void); + + /** Handler for the list box + + Enables/disables the properties push button if selection in the + smart tag types list box changes. + */ + DECL_LINK(SelectHdl, weld::TreeView&, void); + +public: + /// construction via Create() + OfaSmartTagOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~OfaSmartTagOptionsTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ActivatePage( const SfxItemSet& ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx new file mode 100644 index 0000000000..3d50d69e95 --- /dev/null +++ b/cui/source/inc/backgrnd.hxx @@ -0,0 +1,72 @@ +/* -*- 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 . + */ +#pragma once + +#include <memory> + +#include "cuitabarea.hxx" + +class BackgroundPreviewImpl; +class SvxOpenGraphicDialog; +class SvxBrushItem; + +/** class SvxBackgroundTabPage -------------------------------------------- + + [Description] + With this TabPage a Brush (e. g. for a frame's background color) + can be set. + [Items] + <SvxBrushItem>: <SID_ATTR_BRUSH>; +*/ + +class SvxBkgTabPage : public SvxAreaTabPage +{ + static const WhichRangesContainer pBkgRanges; + + std::unique_ptr<weld::ComboBox> m_xTblLBox; + bool m_bHighlighting = false; + bool m_bCharBackColor = false; + + // m_aAttrSet is used to convert between SvxBrushItem and XFILL item attributes and also to + // allow for cell, row, and table backgrounds to be set in one Table dialog opening. + SfxItemSet m_aAttrSet; + + sal_Int32 m_nActPos = -1; + + DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void); + + void SetActiveTableDestinationBrushItem(); + +public: + SvxBkgTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxBkgTabPage() override; + + // returns the area of the which-values + static WhichRangesContainer GetRanges() { return pBkgRanges; } + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void ActivatePage( const SfxItemSet& ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + virtual void PageCreated( const SfxAllItemSet& aSet ) override; + virtual void Reset( const SfxItemSet * ) override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/bbdlg.hxx b/cui/source/inc/bbdlg.hxx new file mode 100644 index 0000000000..c18b5b3da4 --- /dev/null +++ b/cui/source/inc/bbdlg.hxx @@ -0,0 +1,41 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> + +/*-------------------------------------------------------------------- + Description: bunch the border background pages + --------------------------------------------------------------------*/ + +class SvxBorderBackgroundDlg: public SfxTabDialogController +{ +public: + SvxBorderBackgroundDlg(weld::Window *pParent, + const SfxItemSet& rCoreSet, + bool bEnableSelector, + bool bEnableDrawingLayerFillStyles); +protected: + virtual void PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) override; + +private: + bool mbEnableBackgroundSelector : 1; ///< for Border/Background +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx new file mode 100644 index 0000000000..accb555930 --- /dev/null +++ b/cui/source/inc/border.hxx @@ -0,0 +1,195 @@ +/* -*- 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 . + */ +#pragma once + +#include <editeng/shaditem.hxx> +#include <svtools/ctrlbox.hxx> +#include <vcl/weld.hxx> +#include <svtools/valueset.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/algitem.hxx> +#include <svx/colorbox.hxx> +#include <svx/frmsel.hxx> +#include <svx/flagsdef.hxx> +#include <unotools/resmgr.hxx> + +#include <set> + +// forward --------------------------------------------------------------- + +namespace editeng +{ + class SvxBorderLine; +} + +class ShadowControlsWrapper +{ +public: + explicit ShadowControlsWrapper(ValueSet& rVsPos, weld::MetricSpinButton& rMfSize, ColorListBox& rLbColor); + + SvxShadowItem GetControlValue(const SvxShadowItem& rItem) const; + void SetControlValue(const SvxShadowItem& rItem); + void SetControlDontKnow(); + + bool get_value_changed_from_saved() const; + +private: + ValueSet& mrVsPos; + weld::MetricSpinButton& mrMfSize; + ColorListBox& mrLbColor; +}; + +class MarginControlsWrapper +{ +public: + explicit MarginControlsWrapper(weld::MetricSpinButton& rMfLeft, weld::MetricSpinButton& rMfRight, + weld::MetricSpinButton& rMfTop, weld::MetricSpinButton& rMfBottom); + + SvxMarginItem GetControlValue(const SvxMarginItem& rItem) const; + void SetControlValue(const SvxMarginItem& rItem); + void SetControlDontKnow(); + + bool get_value_changed_from_saved() const; + +private: + weld::MetricSpinButton& mrLeftWrp; + weld::MetricSpinButton& mrRightWrp; + weld::MetricSpinButton& mrTopWrp; + weld::MetricSpinButton& mrBottomWrp; +}; + +class SvxBorderTabPage : public SfxTabPage +{ + static const WhichRangesContainer pRanges; + +public: + SvxBorderTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs); + virtual ~SvxBorderTabPage() override; + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* rCoreAttrs ) override; + virtual void Reset( const SfxItemSet* ) override; + virtual void ChangesApplied() override; + + void HideShadowControls(); + virtual void PageCreated(const SfxAllItemSet& aSet) override; + void SetTableMode(); +protected: + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +private: + std::vector<Image> m_aShadowImgVec; + std::vector<Image> m_aBorderImgVec; + + tools::Long nMinValue; ///< minimum distance + SwBorderModes nSWMode; ///< table, textframe, paragraph + sal_uInt16 mnBoxSlot; + sal_uInt16 mnShadowSlot; + + bool mbHorEnabled; ///< true = Inner horizontal border enabled. + bool mbVerEnabled; ///< true = Inner vertical border enabled. + bool mbTLBREnabled; ///< true = Top-left to bottom-right border enabled. + bool mbBLTREnabled; ///< true = Bottom-left to top-right border enabled. + bool mbUseMarginItem; + bool mbLeftModified; + bool mbRightModified; + bool mbTopModified; + bool mbBottomModified; + bool mbSync; + bool mbRemoveAdjacentCellBorders; + bool bIsCalcDoc; + + std::set<SvxBorderLineStyle> maUsedBorderStyles; + + // Controls + svx::FrameSelector m_aFrameSel; + std::unique_ptr<ValueSet> m_xWndPresets; + std::unique_ptr<weld::CustomWeld> m_xWndPresetsWin; + std::unique_ptr<weld::Label> m_xUserDefFT; + std::unique_ptr<weld::CustomWeld> m_xFrameSelWin; + + std::unique_ptr<SvtLineListBox> m_xLbLineStyle; + std::unique_ptr<ColorListBox> m_xLbLineColor; + std::unique_ptr<weld::ComboBox> m_xLineWidthLB; + std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF; + + std::unique_ptr<weld::Container> m_xSpacingFrame; + std::unique_ptr<weld::Label> m_xLeftFT; + std::unique_ptr<weld::MetricSpinButton> m_xLeftMF; + std::unique_ptr<weld::Label> m_xRightFT; + std::unique_ptr<weld::MetricSpinButton> m_xRightMF; + std::unique_ptr<weld::Label> m_xTopFT; + std::unique_ptr<weld::MetricSpinButton> m_xTopMF; + std::unique_ptr<weld::Label> m_xBottomFT; + std::unique_ptr<weld::MetricSpinButton> m_xBottomMF; + std::unique_ptr<weld::CheckButton> m_xSynchronizeCB; + + std::unique_ptr<weld::Container> m_xShadowFrame; + std::unique_ptr<ValueSet> m_xWndShadows; + std::unique_ptr<weld::CustomWeld> m_xWndShadowsWin; + std::unique_ptr<weld::Label> m_xFtShadowSize; + std::unique_ptr<weld::MetricSpinButton> m_xEdShadowSize; + std::unique_ptr<weld::Label> m_xFtShadowColor; + std::unique_ptr<ColorListBox> m_xLbShadowColor; + + std::unique_ptr<weld::Container> m_xPropertiesFrame;///< properties - "Merge with next paragraph" in Writer + std::unique_ptr<weld::CheckButton> m_xMergeWithNextCB; + // #i29550# + std::unique_ptr<weld::CheckButton> m_xMergeAdjacentBordersCB; + std::unique_ptr<weld::CheckButton> m_xRemoveAdjacentCellBordersCB; + std::unique_ptr<weld::Label> m_xRemoveAdjacentCellBordersFT; + std::unique_ptr<ShadowControlsWrapper> m_xShadowControls; + std::unique_ptr<MarginControlsWrapper> m_xMarginControls; + + // Handler + DECL_LINK(SelStyleHdl_Impl, SvtLineListBox&, void); + DECL_LINK(SelColHdl_Impl, ColorListBox&, void); + DECL_LINK(SelPreHdl_Impl, ValueSet*, void); + DECL_LINK(SelSdwHdl_Impl, ValueSet*, void); + DECL_LINK(LinesChanged_Impl, LinkParamNone*, void); + DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ModifyWidthLBHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ModifyWidthMFHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(SyncHdl_Impl, weld::Toggleable&, void); + DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::Toggleable&, void); + + sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const; + TranslateId GetPresetStringId(sal_uInt16 nValueSetIdx) const; + + void FillPresetVS(); + void FillShadowVS(); + void FillValueSets(); + void SetLineWidth(sal_Int64 nWidth, sal_Int32 nRemovedType = 0); + + // Filler + void FillLineListBox_Impl(); + + /// share for individual Frame-/Core-Line + void ResetFrameLine_Impl( svx::FrameBorderType eBorder, + const editeng::SvxBorderLine* pCurLine, + bool bValid ); + + bool IsBorderLineStyleAllowed( SvxBorderLineStyle nStyle ) const; + void UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset ); +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx new file mode 100644 index 0000000000..1ae5b23a29 --- /dev/null +++ b/cui/source/inc/cfg.hxx @@ -0,0 +1,677 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/timer.hxx> +#include <vcl/weld.hxx> +#include <vcl/weldutils.hxx> +#include <svtools/valueset.hxx> + +#include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/container/XNameAccess.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/lang/XSingleComponentFactory.hpp> + +#include <sfx2/tabdlg.hxx> +#include <memory> +#include <string_view> +#include <vector> + +#include "cfgutil.hxx" +#include "CommandCategoryListBox.hxx" + +inline constexpr OUString notebookbarTabScope = u"notebookbarTabScope"_ustr; + +inline constexpr OUString ITEM_DESCRIPTOR_COMMANDURL = u"CommandURL"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_CONTAINER = u"ItemDescriptorContainer"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_LABEL = u"Label"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_TYPE = u"Type"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_STYLE = u"Style"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_ISVISIBLE = u"IsVisible"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_RESOURCEURL = u"ResourceURL"_ustr; +inline constexpr OUString ITEM_DESCRIPTOR_UINAME = u"UIName"_ustr; + +inline constexpr OUString ITEM_MENUBAR_URL = u"private:resource/menubar/menubar"_ustr; +inline constexpr OUString ITEM_TOOLBAR_URL = u"private:resource/toolbar/"_ustr; +inline constexpr OUString ITEM_EVENT_URL = u"private:resource/event/"_ustr; + +inline constexpr OUString CUSTOM_TOOLBAR_STR = u"custom_toolbar_"_ustr; + +inline constexpr OUString aMenuSeparatorStr = u" | "_ustr; + +class SvxConfigEntry; +class SvxConfigPage; + +typedef std::vector< SvxConfigEntry* > SvxEntries; + +class SvxConfigDialog : public SfxTabDialogController +{ +private: + css::uno::Reference< css::frame::XFrame > m_xFrame; + + virtual void ActivatePage(const OUString& rPage) override; + +public: + SvxConfigDialog(weld::Window*, const SfxItemSet*); + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + void SetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame); +}; + +class SaveInData +{ +private: + + bool bModified; + + bool bDocConfig; + bool bReadOnly; + + css::uno::Reference + < css::ui::XUIConfigurationManager > m_xCfgMgr; + + css::uno::Reference + < css::ui::XUIConfigurationManager > m_xParentCfgMgr; + + css::uno::Reference + < css::ui::XImageManager > m_xImgMgr; + + css::uno::Reference + < css::ui::XImageManager > m_xParentImgMgr; + + static css::uno::Reference + < css::ui::XImageManager >* xDefaultImgMgr; + +protected: + + void ApplyMenu( + css::uno::Reference< css::container::XIndexContainer > const & rMenuBar, + css::uno::Reference< css::lang::XSingleComponentFactory >& rFactory, + SvxConfigEntry *pMenuData ); + + void LoadSubMenus( + const css::uno::Reference< css::container::XIndexAccess >& xMenuSettings, + const OUString& rBaseTitle, SvxConfigEntry const * pParentData, bool bContextMenu ); + +public: + + SaveInData( + css::uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr, + css::uno::Reference < css::ui::XUIConfigurationManager > xParentCfgMgr, + const OUString& aModuleId, + bool docConfig ); + + virtual ~SaveInData() {} + + bool PersistChanges( + const css::uno::Reference< css::uno::XInterface >& xManager ); + + void SetModified( bool bValue = true ) { bModified = bValue; } + bool IsModified( ) const { return bModified; } + + bool IsReadOnly( ) const { return bReadOnly; } + bool IsDocConfig( ) const { return bDocConfig; } + + const css::uno::Reference + < css::ui::XUIConfigurationManager >& + GetConfigManager() const { return m_xCfgMgr; }; + + const css::uno::Reference + < css::ui::XUIConfigurationManager >& + GetParentConfigManager() const { return m_xParentCfgMgr; }; + + const css::uno::Reference + < css::ui::XImageManager >& + GetImageManager() const { return m_xImgMgr; }; + + const css::uno::Reference + < css::ui::XImageManager >& + GetParentImageManager() const { return m_xParentImgMgr; }; + + css::uno::Reference + < css::container::XNameAccess > m_xCommandToLabelMap; + + css::uno::Sequence + < css::beans::PropertyValue > m_aSeparatorSeq; + + css::uno::Reference<css::graphic::XGraphic> GetImage(const OUString& rCommandURL); + + virtual bool HasURL( const OUString& aURL ) = 0; + virtual bool HasSettings() = 0; + virtual SvxEntries* GetEntries() = 0; + virtual void SetEntries( std::unique_ptr<SvxEntries> ) = 0; + virtual void Reset() = 0; + virtual bool Apply() = 0; +}; + +class MenuSaveInData : public SaveInData +{ +private: + + OUString m_aMenuResourceURL; + OUString m_aDescriptorContainer; + + css::uno::Reference + < css::container::XIndexAccess > m_xMenuSettings; + + std::unique_ptr<SvxConfigEntry> pRootEntry; + + + static MenuSaveInData* pDefaultData; ///< static holder of the default menu data + + static void SetDefaultData( MenuSaveInData* pData ) {pDefaultData = pData;} + static MenuSaveInData* GetDefaultData() { return pDefaultData; } + + void Apply( + css::uno::Reference< css::container::XIndexContainer > const & rNewMenuBar, + css::uno::Reference< css::lang::XSingleComponentFactory >& rFactory ); + +public: + + MenuSaveInData( + const css::uno::Reference< css::ui::XUIConfigurationManager >&, + const css::uno::Reference< css::ui::XUIConfigurationManager >&, + const OUString& aModuleId, + bool docConfig ); + + virtual ~MenuSaveInData() override; + + /// methods inherited from SaveInData + SvxEntries* GetEntries() override; + void SetEntries( std::unique_ptr<SvxEntries> ) override; + bool HasURL( const OUString& ) override { return false; } + bool HasSettings() override { return m_xMenuSettings.is(); } + void Reset() override; + bool Apply() override; +}; + +class ContextMenuSaveInData : public SaveInData +{ +private: + std::unique_ptr< SvxConfigEntry > m_pRootEntry; + css::uno::Reference< css::container::XNameAccess > m_xPersistentWindowState; + OUString GetUIName( const OUString& rResourceURL ); + +public: + ContextMenuSaveInData( + const css::uno::Reference< css::ui::XUIConfigurationManager >& xCfgMgr, + const css::uno::Reference< css::ui::XUIConfigurationManager >& xParentCfgMgr, + const OUString& aModuleId, bool bIsDocConfig ); + virtual ~ContextMenuSaveInData() override; + + SvxEntries* GetEntries() override; + void SetEntries( std::unique_ptr<SvxEntries> pNewEntries ) override; + bool HasSettings() override; + bool HasURL( const OUString& rURL ) override; + void Reset() override; + bool Apply() override; + + void ResetContextMenu( const SvxConfigEntry* pEntry ); +}; + +class SvxConfigEntry +{ +private: + + /// common properties + sal_uInt16 nId; + OUString aLabel; + OUString aCommand; + + bool bPopUp; + bool bStrEdited; + bool bIsUserDefined; + bool bIsMain; + bool bIsParentData; + bool bIsModified; + + /// toolbar specific properties + bool bIsVisible; + sal_Int32 nStyle; + + css::uno::Reference< + css::graphic::XGraphic > xBackupGraphic; + + std::unique_ptr<SvxEntries> mpEntries; + +public: + + SvxConfigEntry( OUString aDisplayName, + OUString aCommandURL, + bool bPopup, + bool bParentData ); + + SvxConfigEntry() + : + nId( 0 ), + bPopUp( false ), + bStrEdited( false ), + bIsUserDefined( false ), + bIsMain( false ), + bIsParentData( false ), + bIsModified( false ), + bIsVisible( true ), + nStyle( 0 ) + {} + + ~SvxConfigEntry(); + + const OUString& GetCommand() const { return aCommand; } + + const OUString& GetName() const { return aLabel; } + void SetName( const OUString& rStr ) { aLabel = rStr; bStrEdited = true; } + bool HasChangedName() const { return bStrEdited; } + + bool IsPopup() const { return bPopUp; } + + void SetUserDefined( bool bOn = true ) { bIsUserDefined = bOn; } + bool IsUserDefined() const { return bIsUserDefined; } + + bool IsBinding() const { return !bPopUp; } + bool IsSeparator() const { return nId == 0; } + + SvxEntries* GetEntries() const { return mpEntries.get(); } + void SetEntries( std::unique_ptr<SvxEntries> entries ) { mpEntries = std::move(entries); } + + void SetMain() { bIsMain = true; } + bool IsMain() const { return bIsMain; } + + void SetParentData( bool bValue = true ) { bIsParentData = bValue; } + bool IsParentData() const { return bIsParentData; } + + void SetModified( bool bValue = true ) { bIsModified = bValue; } + bool IsModified() const { return bIsModified; } + + bool IsMovable() const; + bool IsDeletable() const; + bool IsRenamable() const; + + void SetVisible( bool b ) { bIsVisible = b; } + bool IsVisible() const { return bIsVisible; } + + void SetBackupGraphic( css::uno::Reference< css::graphic::XGraphic > const & graphic ) + { xBackupGraphic = graphic; } + + const css::uno::Reference< css::graphic::XGraphic >& GetBackupGraphic() const + { return xBackupGraphic; } + + sal_Int32 GetStyle() const { return nStyle; } + void SetStyle( sal_Int32 style ) { nStyle = style; } +}; + +class SvxMenuEntriesListBox +{ +protected: + std::unique_ptr<weld::TreeView> m_xControl; + ScopedVclPtr<VirtualDevice> m_xDropDown; + SvxConfigPage* m_pPage; + +public: + SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPage); + virtual ~SvxMenuEntriesListBox(); + + VirtualDevice& get_dropdown_image() const { return *m_xDropDown; } + + 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 clear() { m_xControl->clear(); } //need frees ? + void set_toggle(int row, TriState eState) { m_xControl->set_toggle(row, eState); } + 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, false, nullptr); + } + + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + DECL_LINK(QueryTooltip, const weld::TreeIter& rIter, OUString); + + void CreateDropDown(); +}; + +class SvxConfigPageFunctionDropTarget : public weld::ReorderingDropTarget +{ +private: + SvxConfigPage& m_rPage; + + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; + +public: + SvxConfigPageFunctionDropTarget(SvxConfigPage&rPage, weld::TreeView& rTreeView); +}; + +class SvxConfigPage : public SfxTabPage +{ +private: + + Timer m_aUpdateDataTimer; + bool bInitialised; + SaveInData* pCurrentSaveInData; + + 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; + OUString m_aModuleId; + + // Left side of the dialog where command categories and the available + // commands in them are displayed as a searchable list + std::unique_ptr<CommandCategoryListBox> m_xCommandCategoryListBox; + std::unique_ptr<CuiConfigFunctionListBox> m_xFunctions; + + std::unique_ptr<weld::Label> m_xCategoryLabel; + std::unique_ptr<weld::Label> m_xDescriptionFieldLb; + std::unique_ptr<weld::TextView> m_xDescriptionField; + std::unique_ptr<weld::Label> m_xLeftFunctionLabel; + std::unique_ptr<weld::Entry> m_xSearchEdit; + std::unique_ptr<weld::Label> m_xSearchLabel; + + + // Right side of the dialog where the contents of the selected + // menu or toolbar are displayed + std::unique_ptr<weld::Label> m_xCustomizeLabel; + std::unique_ptr<weld::ComboBox> m_xTopLevelListBox; + // Used to add and remove toolbars/menus + std::unique_ptr<weld::MenuButton> m_xGearBtn; + std::unique_ptr<SvxMenuEntriesListBox> m_xContentsListBox; + std::unique_ptr<SvxConfigPageFunctionDropTarget> m_xDropTargetHelper; + + std::unique_ptr<weld::Button> m_xMoveUpButton; + std::unique_ptr<weld::Button> m_xMoveDownButton; + + std::unique_ptr<weld::ComboBox> m_xSaveInListBox; + + std::unique_ptr<weld::Widget> m_xCustomizeBox; + std::unique_ptr<weld::MenuButton> m_xInsertBtn; + std::unique_ptr<weld::MenuButton> m_xModifyBtn; + // Used to reset the selected toolbar/menu/context menu + std::unique_ptr<weld::Button> m_xResetBtn; + + // Middle buttons + std::unique_ptr<weld::Widget> m_xCommandButtons; + std::unique_ptr<weld::Button> m_xAddCommandButton; + std::unique_ptr<weld::Button> m_xRemoveCommandButton; + + OUString m_sAppName; + OUString m_sFileName; + + SvxConfigPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet&); + + DECL_LINK(MoveHdl, weld::Button&, void); + DECL_LINK(SelectFunctionHdl, weld::TreeView&, void); + DECL_LINK(FunctionDoubleClickHdl, weld::TreeView&, bool); + 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 >&, + const css::uno::Reference< css::ui::XUIConfigurationManager >&, + const OUString& aModuleId, + bool docConfig ) = 0; + + virtual void Init() = 0; + virtual void UpdateButtonStates() = 0; + virtual short QueryReset() = 0; + + virtual void SelectElement() = 0; + + int AppendEntry(SvxConfigEntry* pNewEntryData, + int nTarget); + + void AddSubMenusToUI( std::u16string_view rBaseTitle, + SvxConfigEntry const * pParentData ); + + void InsertEntryIntoUI(SvxConfigEntry* pNewEntryData, + weld::TreeView& rTreeView, int nPos, + bool bMenu = false); + void InsertEntryIntoUI(SvxConfigEntry* pNewEntryData, + weld::TreeView& rTreeView, weld::TreeIter& rIter, + bool bMenu = false); + + void InsertEntryIntoNotebookbarTabUI(std::u16string_view sClassId, const OUString& sUIItemId, + const OUString& sUIItemCommand, + weld::TreeView& rTreeView, const weld::TreeIter& rIter); + + SvxEntries* FindParentForChild( SvxEntries* pParentEntries, + SvxConfigEntry* pChildData ); + + void ReloadTopLevelListBox( SvxConfigEntry const * pSelection = nullptr ); + + static bool IsCommandInMenuList(const SvxConfigEntry *pEntryData, + const SvxEntries *pEntries); + + SvxConfigEntry *CreateCommandFromSelection(const OUString &aURL); + +public: + + virtual ~SvxConfigPage() override; + + static bool CanConfig( std::u16string_view rModuleId ); + + SaveInData* GetSaveInData() { return pCurrentSaveInData; } + const OUString& GetAppName() const { return m_sAppName; } + const OUString& GetFileName() const { return m_sFileName; } + + int AddFunction(int nTarget, + bool bAllowDuplicates); + + virtual void MoveEntry( bool bMoveUp ); + + bool MoveEntryData(int SourceEntry, int nTargetEntry); + + bool FillItemSet( SfxItemSet* ) override; + void Reset( const SfxItemSet* ) override; + + virtual void DeleteSelectedContent() = 0; + virtual void DeleteSelectedTopLevel() = 0; + + virtual void ListModified() {} + + SvxConfigEntry* GetTopLevelSelection() + { + return weld::fromId<SvxConfigEntry*>(m_xTopLevelListBox->get_active_id()); + } + + /** identifies the module in the given frame. If the frame is <NULL/>, a default + frame will be determined beforehand. + + If the given frame is <NULL/>, a default frame will be used: The method the active + frame of the desktop, then the current frame. If both are <NULL/>, + the SfxViewFrame::Current's XFrame is used. If this is <NULL/>, too, an empty string is returned. + + If the given frame is not <NULL/>, or a default frame could be successfully determined, then + the ModuleManager is asked for the module ID of the component in the frame. + */ + static OUString + GetFrameWithDefaultAndIdentify( css::uno::Reference< css::frame::XFrame >& _inout_rxFrame ); + + OUString GetScriptURL() const; + OUString GetSelectedDisplayName() const; +}; + +class SvxMainMenuOrganizerDialog : public weld::GenericDialogController +{ + std::unique_ptr<SvxEntries> mpEntries; + OUString m_sNewMenuEntryId; + + std::unique_ptr<weld::Widget> m_xMenuBox; + std::unique_ptr<weld::Entry> m_xMenuNameEdit; + std::unique_ptr<weld::TreeView> m_xMenuListBox; + std::unique_ptr<weld::Button> m_xMoveUpButton; + std::unique_ptr<weld::Button> m_xMoveDownButton; + + void UpdateButtonStates(); + + DECL_LINK(MoveHdl, weld::Button&, void); + DECL_LINK(ModifyHdl, weld::Entry&, void); + DECL_LINK(SelectHdl, weld::TreeView&, void); + +public: + SvxMainMenuOrganizerDialog( + weld::Window*, SvxEntries*, + SvxConfigEntry const *, bool bCreateMenu); + virtual ~SvxMainMenuOrganizerDialog() override; + + std::unique_ptr<SvxEntries> ReleaseEntries() { return std::move(mpEntries);} + SvxConfigEntry* GetSelectedEntry(); +}; + +class ToolbarSaveInData : public SaveInData +{ +private: + + std::unique_ptr<SvxConfigEntry> pRootEntry; + OUString m_aDescriptorContainer; + + css::uno::Reference + < css::container::XNameAccess > m_xPersistentWindowState; + + void LoadToolbar( + const css::uno::Reference< css::container::XIndexAccess >& xToolBarSettings, + SvxConfigEntry const * pParentData ); + + void ApplyToolbar( + css::uno::Reference< css::container::XIndexContainer > const & rNewToolbarBar, + css::uno::Reference< css::lang::XSingleComponentFactory >& rFactory, + SvxConfigEntry const *pToolbar ); + +public: + + ToolbarSaveInData( + const css::uno::Reference< css::ui::XUIConfigurationManager >&, + const css::uno::Reference< css::ui::XUIConfigurationManager >&, + const OUString& aModuleId, + bool docConfig ); + + virtual ~ToolbarSaveInData() override; + + void CreateToolbar( SvxConfigEntry* pToolbar ); + void RestoreToolbar( SvxConfigEntry* pToolbar ); + void RemoveToolbar( SvxConfigEntry* pToolbar ); + void ApplyToolbar( SvxConfigEntry* pToolbar ); + + OUString GetSystemUIName( const OUString& rResourceURL ); + + sal_Int32 GetSystemStyle( const OUString& rResourceURL ); + + void SetSystemStyle( const OUString& rResourceURL, sal_Int32 nStyle ); + + void SetSystemStyle( + const css::uno::Reference< css::frame::XFrame >& xFrame, + const OUString& rResourceURL, sal_Int32 nStyle ); + + SvxEntries* GetEntries() override; + void SetEntries( std::unique_ptr<SvxEntries> ) override; + bool HasSettings() override; + bool HasURL( const OUString& rURL ) override; + void Reset() override; + bool Apply() override; +}; + +class SvxNewToolbarDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Entry> m_xEdtName; +public: + std::unique_ptr<weld::ComboBox> m_xSaveInListBox; + + SvxNewToolbarDialog(weld::Window* pWindow, const OUString& rName); + virtual ~SvxNewToolbarDialog() override; + + OUString GetName() const + { + return m_xEdtName->get_text(); + } +}; + +class SvxIconSelectorDialog : public weld::GenericDialogController +{ +private: + sal_Int32 m_nExpectedSize; + + css::uno::Reference< + css::ui::XImageManager > m_xImageManager; + + css::uno::Reference< + css::ui::XImageManager > m_xParentImageManager; + + css::uno::Reference< + css::ui::XImageManager > m_xImportedImageManager; + + css::uno::Reference< + css::graphic::XGraphicProvider > m_xGraphProvider; + + std::vector<css::uno::Reference<css::graphic::XGraphic>> m_aGraphics; + + std::unique_ptr<ValueSet> m_xTbSymbol; + std::unique_ptr<weld::CustomWeld> m_xTbSymbolWin; + std::unique_ptr<weld::Label> m_xFtNote; + std::unique_ptr<weld::Button> m_xBtnImport; + std::unique_ptr<weld::Button> m_xBtnDelete; + + bool ReplaceGraphicItem( const OUString& aURL ); + + bool ImportGraphic( const OUString& aURL ); + + void ImportGraphics( const css::uno::Sequence< OUString >& aURLs ); + +public: + + SvxIconSelectorDialog( + weld::Window *pWindow, + css::uno::Reference< css::ui::XImageManager > xImageManager, + css::uno::Reference< css::ui::XImageManager > xParentImageManager); + + virtual ~SvxIconSelectorDialog() override; + + css::uno::Reference< css::graphic::XGraphic > + GetSelectedIcon(); + + DECL_LINK(SelectHdl, ValueSet*, void); + DECL_LINK(ImportHdl, weld::Button&, void); + DECL_LINK(DeleteHdl, weld::Button&, void); +}; + +//added for issue83555 +class SvxIconChangeDialog : public weld::MessageDialogController +{ +private: + std::unique_ptr<weld::TextView> m_xLineEditDescription; +public: + SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx new file mode 100644 index 0000000000..b1f22e4065 --- /dev/null +++ b/cui/source/inc/cfgutil.hxx @@ -0,0 +1,270 @@ +/* -*- 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 . + */ +#pragma once + +#include <vector> +#include <memory> +#include <string_view> + +#include <rtl/ustring.hxx> + +#include <com/sun/star/frame/DispatchInformation.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#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 +{ + OUString sFamily; + OUString sStyle; + OUString sCommand; + OUString sLabel; + + SfxStyleInfo_Impl() + {} + + SfxStyleInfo_Impl(const SfxStyleInfo_Impl& rCopy) + { + sFamily = rCopy.sFamily; + sStyle = rCopy.sStyle; + sCommand = rCopy.sCommand; + sLabel = rCopy.sLabel; + } +}; + +struct SfxStylesInfo_Impl +{ +private: + OUString m_aModuleName; + css::uno::Reference< css::frame::XModel > m_xDoc; + +public: + + SfxStylesInfo_Impl(); + void init(const OUString& rModuleName, const css::uno::Reference< css::frame::XModel >& xModel); + + static bool parseStyleCommand(SfxStyleInfo_Impl& aStyle); + void getLabel4Style(SfxStyleInfo_Impl& aStyle); + + std::vector< SfxStyleInfo_Impl > getStyleFamilies() const; + std::vector< SfxStyleInfo_Impl > getStyles(const OUString& sFamily); + + static OUString generateCommand(std::u16string_view sFamily, std::u16string_view sStyle); +}; + +enum class SfxCfgKind +{ + GROUP_FUNCTION = 1, + FUNCTION_SLOT = 2, + GROUP_SCRIPTCONTAINER = 3, + FUNCTION_SCRIPT = 4, + GROUP_STYLES = 5, + GROUP_ALLFUNCTIONS = 6, + GROUP_SIDEBARDECKS = 7 +}; + +struct SfxGroupInfo_Impl +{ + SfxCfgKind nKind; + sal_uInt16 nUniqueID; + void* pObject; + OUString sCommand; + OUString sLabel; + OUString sHelpText; + OUString sTooltip; + + SfxGroupInfo_Impl( SfxCfgKind n, sal_uInt16 nr, void* pObj = nullptr ) : + nKind( n ), nUniqueID( nr ), pObject( pObj ) {} +}; + +typedef std::vector<std::unique_ptr<SfxGroupInfo_Impl> > SfxGroupInfoArr_Impl; + +class CuiConfigFunctionListBox +{ + friend class CuiConfigGroupListBox; + SfxGroupInfoArr_Impl aArr; + + std::unique_ptr<weld::TreeView> m_xTreeView; + std::unique_ptr<weld::TreeIter> m_xScratchIter; + +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(); } + void append(const OUString& rId, const OUString& rStr, const weld::TreeIter* pParent = nullptr) + { + m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, false, nullptr); + } + std::unique_ptr<weld::TreeIter> tree_append(const OUString& rId, const OUString& rStr, const weld::TreeIter* pParent = nullptr) + { + std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator()); + m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, false, xIter.get()); + return xIter; + } + void append(const OUString& rId, const OUString& rStr, const OUString& rImage, const weld::TreeIter* pParent = nullptr) + { + m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, false, m_xScratchIter.get()); + m_xTreeView->set_image(*m_xScratchIter, rImage); + } + void append(const OUString& rId, const OUString& rStr, const css::uno::Reference<css::graphic::XGraphic>& rImage, const weld::TreeIter* pParent = nullptr) + { + m_xTreeView->insert(pParent, -1, &rStr, &rId, nullptr, nullptr, false, m_xScratchIter.get()); + m_xTreeView->set_image(*m_xScratchIter, rImage, -1); + } + void remove(int nPos) { m_xTreeView->remove(nPos); } + void scroll_to_row(int pos) { m_xTreeView->scroll_to_row(pos); } + void remove(const weld::TreeIter& rIter) { m_xTreeView->remove(rIter); } + 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 iter_has_child(const weld::TreeIter& rIter) const { return m_xTreeView->iter_has_child(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); } + bool get_selected(weld::TreeIter* pIter) const { return m_xTreeView->get_selected(pIter); } + OUString get_selected_text() const + { + if (!m_xTreeView->get_selected(m_xScratchIter.get())) + return OUString(); + return m_xTreeView->get_text(*m_xScratchIter); + } + OUString get_selected_id() const + { + if (!m_xTreeView->get_selected(m_xScratchIter.get())) + return OUString(); + return m_xTreeView->get_id(*m_xScratchIter); + } + 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(); } + weld::TreeView& get_widget() { return *m_xTreeView; } + + ~CuiConfigFunctionListBox(); + + void ClearAll(); + OUString GetSelectedScriptURI() const; + OUString GetHelpText( bool bConsiderParent = true ); + OUString GetCurCommand() const; + OUString GetCurLabel() const; + + DECL_LINK(QueryTooltip, const weld::TreeIter& rIter, OUString); +}; + +struct SvxConfigGroupBoxResource_Impl; +class CuiConfigGroupListBox +{ + std::unique_ptr<SvxConfigGroupBoxResource_Impl> xImp; + CuiConfigFunctionListBox* m_pFunctionListBox; + SfxGroupInfoArr_Impl aArr; + OUString m_sModuleLongName; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + css::uno::Reference< css::frame::XFrame > m_xFrame; + css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo; + css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo; + css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription; + SfxStylesInfo_Impl* m_pStylesInfo; + std::unique_ptr<weld::TreeView> m_xTreeView; + std::unique_ptr<weld::TreeIter> m_xScratchIter; + + static OUString GetImage( + const css::uno::Reference< css::script::browse::XBrowseNode >& node, + css::uno::Reference< css::uno::XComponentContext > const & xCtx, + bool bIsRootNode); + + static css::uno::Reference< css::uno::XInterface > getDocumentModel( + css::uno::Reference< css::uno::XComponentContext > const & xCtx, + std::u16string_view docName); + + sal_Int32 InitModule(); + void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode, + const weld::TreeIter* pParentEntry); + void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation >& xCommands); + OUString MapCommand2UIName(const OUString& sCommand); + + DECL_LINK(ExpandingHdl, const weld::TreeIter&, bool); + +public: + CuiConfigGroupListBox(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 set_size_request(int nWidth, int nHeight) { m_xTreeView->set_size_request(nWidth, nHeight); } + weld::TreeView& get_widget() { return *m_xTreeView; } + ~CuiConfigGroupListBox(); + void ClearAll(); + + void Init(const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::frame::XFrame >& xFrame, + const OUString& sModuleLongName, + bool bEventMode); + void SetFunctionListBox( CuiConfigFunctionListBox *pBox ) + { m_pFunctionListBox = pBox; } + void GroupSelected(); +#if HAVE_FEATURE_SCRIPTING + void SelectMacro(const SfxMacroInfoItem*); +#endif + void SetStylesInfo(SfxStylesInfo_Impl* pStyles); +}; + +class SvxScriptSelectorDialog : public weld::GenericDialogController +{ + OUString m_sDefaultDesc; + SfxStylesInfo_Impl m_aStylesInfo; + + std::unique_ptr<weld::Label> m_xDialogDescription; + 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_xMacronameFT; + 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(); + +public: + SvxScriptSelectorDialog(weld::Window* pParent, + const css::uno::Reference< css::frame::XFrame >& xFrame); + virtual ~SvxScriptSelectorDialog() override; + + OUString GetScriptURL() const; + void SetRunLabel(); + void SaveLastUsedMacro(); + void LoadLastUsedMacro(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx new file mode 100644 index 0000000000..6d6bf958c2 --- /dev/null +++ b/cui/source/inc/chardlg.hxx @@ -0,0 +1,340 @@ +/* -*- 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 . + */ +#pragma once + +#include <svtools/ctrlbox.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/fntctrl.hxx> +#include <svx/colorbox.hxx> +#include <svx/langbox.hxx> +#include <vcl/weld.hxx> +#include <memory> + +// forward --------------------------------------------------------------- + +class SvxFontListItem; +class FontList; + +class SvxCharBasePage : public SfxTabPage +{ +protected: + SvxFontPrevWindow m_aPreviewWin; + std::unique_ptr<weld::CustomWeld> m_xPreviewWin; + + bool m_bPreviewBackgroundToCharacter; + + SvxCharBasePage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet& rAttrSet); + + void SetPrevFontWidthScale( const SfxItemSet& rSet ); + void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); + + inline SvxFont& GetPreviewFont(); + inline SvxFont& GetPreviewCJKFont(); + inline SvxFont& GetPreviewCTLFont(); + +public: + virtual ~SvxCharBasePage() override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; +}; + +// class SvxCharNamePage ------------------------------------------------- + +struct SvxCharNamePage_Impl; + +class SvxCharNamePage : public SvxCharBasePage +{ +private: + static const WhichRangesContainer pNameRanges; + + std::unique_ptr<SvxCharNamePage_Impl> m_pImpl; + + std::unique_ptr<weld::Notebook> m_xWestern; + std::unique_ptr<weld::Label> m_xWestFontNameFT; + std::unique_ptr<weld::ComboBox> m_xWestFontNameLB; + std::unique_ptr<weld::Label> m_xWestFontStyleFT; + std::unique_ptr<FontStyleBox> m_xWestFontStyleLB; + std::unique_ptr<weld::Label> m_xWestFontSizeFT; + std::unique_ptr<FontSizeBox> m_xWestFontSizeLB; + std::unique_ptr<weld::Label> m_xWestFontLanguageFT; + std::unique_ptr<SvxLanguageBox> m_xWestFontLanguageLB; + std::unique_ptr<weld::Button> m_xWestFontFeaturesButton; + std::unique_ptr<weld::Label> m_xWestFontTypeFT; + + std::unique_ptr<weld::Notebook> m_xCJK_CTL; + std::unique_ptr<weld::Label> m_xEastFontNameFT; + std::unique_ptr<weld::ComboBox> m_xEastFontNameLB; + std::unique_ptr<weld::Label> m_xEastFontStyleFT; + std::unique_ptr<FontStyleBox> m_xEastFontStyleLB; + std::unique_ptr<weld::Label> m_xEastFontSizeFT; + std::unique_ptr<FontSizeBox> m_xEastFontSizeLB; + std::unique_ptr<weld::Label> m_xEastFontLanguageFT; + std::unique_ptr<SvxLanguageBox> m_xEastFontLanguageLB; + std::unique_ptr<weld::Button> m_xEastFontFeaturesButton; + std::unique_ptr<weld::Label> m_xEastFontTypeFT; + + std::unique_ptr<weld::Label> m_xCTLFontNameFT; + std::unique_ptr<weld::ComboBox> m_xCTLFontNameLB; + std::unique_ptr<weld::Label> m_xCTLFontStyleFT; + std::unique_ptr<FontStyleBox> m_xCTLFontStyleLB; + std::unique_ptr<weld::Label> m_xCTLFontSizeFT; + std::unique_ptr<FontSizeBox> m_xCTLFontSizeLB; + std::unique_ptr<weld::Label> m_xCTLFontLanguageFT; + std::unique_ptr<SvxLanguageBox> m_xCTLFontLanguageLB; + std::unique_ptr<weld::Button> m_xCTLFontFeaturesButton; + std::unique_ptr<weld::Label> m_xCTLFontTypeFT; + + //for getting FontFeatures + ScopedVclPtrInstance<VirtualDevice> m_xVDev; + + void Initialize(); + const FontList* GetFontList() const; + void UpdatePreview_Impl(); + void FillStyleBox_Impl(const weld::Widget& rBox); + void FillSizeBox_Impl(const weld::Widget& rBox); + void EnableFeatureButton(const weld::Widget& rNameBox); + + enum LanguageGroup + { + /** Language for western text. + */ + Western = 0, + + /** Language for asian text. + */ + Asian, + + /** Language for ctl text. + */ + Ctl + }; + + void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp ); + bool FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp ); + + DECL_LINK(UpdateHdl_Impl, Timer *, void ); + DECL_LINK(FontModifyComboBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(FontFeatureButtonClicked, weld::Button&, void); + + void FontModifyHdl_Impl(const weld::Widget&); + +public: + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + SvxCharNamePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxCharNamePage() override; + + static WhichRangesContainer GetRanges() { return pNameRanges; } + + virtual void Reset( const SfxItemSet* rSet ) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + + void SetFontList( const SvxFontListItem& rItem ); + void EnableRelativeMode(); + void EnableSearchMode(); + + void DisableControls( sal_uInt16 nDisable ); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +// class SvxCharEffectsPage ---------------------------------------------- + +class SvxCharEffectsPage : public SvxCharBasePage +{ +private: + static const WhichRangesContainer pEffectsRanges; + bool m_bOrigFontColor; + bool m_bNewFontColor; + bool m_bEnableNoneFontColor; + Color m_aOrigFontColor; + + weld::TriStateEnabled m_aOutlineState; + weld::TriStateEnabled m_aShadowState; + weld::TriStateEnabled m_aHiddenState; + weld::TriStateEnabled m_aIndividualWordsState; + + std::unique_ptr<weld::Label> m_xFontColorFT; + std::unique_ptr<ColorListBox> m_xFontColorLB; + std::unique_ptr<weld::Label> m_xFontTransparencyFT; + std::unique_ptr<weld::MetricSpinButton> m_xFontTransparencyMtr; + std::unique_ptr<weld::Label> m_xEffectsFT; + std::unique_ptr<weld::ComboBox> m_xEffectsLB; + std::unique_ptr<weld::Label> m_xReliefFT; + std::unique_ptr<weld::ComboBox> m_xReliefLB; + std::unique_ptr<weld::CheckButton> m_xOutlineBtn; + std::unique_ptr<weld::CheckButton> m_xShadowBtn; + std::unique_ptr<weld::CheckButton> m_xHiddenBtn; + std::unique_ptr<weld::ComboBox> m_xOverlineLB; + std::unique_ptr<weld::Label> m_xOverlineColorFT; + std::unique_ptr<ColorListBox> m_xOverlineColorLB; + std::unique_ptr<weld::ComboBox> m_xStrikeoutLB; + std::unique_ptr<weld::ComboBox> m_xUnderlineLB; + std::unique_ptr<weld::Label> m_xUnderlineColorFT; + std::unique_ptr<ColorListBox> m_xUnderlineColorLB; + std::unique_ptr<weld::CheckButton> m_xIndividualWordsBtn; + std::unique_ptr<weld::Label> m_xEmphasisFT; + std::unique_ptr<weld::ComboBox> m_xEmphasisLB; + std::unique_ptr<weld::Label> m_xPositionFT; + std::unique_ptr<weld::ComboBox> m_xPositionLB; + std::unique_ptr<weld::Label> m_xA11yWarningFT; + + void Initialize(); + void UpdatePreview_Impl(); + void SetCaseMap_Impl( SvxCaseMap eCaseMap ); + void ResetColor_Impl( const SfxItemSet& rSet ); + bool FillItemSetColor_Impl( SfxItemSet& rSet ); + void EnableNoneFontColor(); + + void SelectHdl_Impl(const weld::ComboBox*); + DECL_LINK(SelectListBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(OutlineBtnClickHdl, weld::Toggleable&, void); + DECL_LINK(ShadowBtnClickHdl, weld::Toggleable&, void); + DECL_LINK(HiddenBtnClickHdl, weld::Toggleable&, void); + DECL_LINK(CbClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ColorBoxSelectHdl_Impl, ColorListBox&, void); + DECL_LINK(ModifyFontTransparencyHdl_Impl, weld::MetricSpinButton&, void); + +public: + SvxCharEffectsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxCharEffectsPage() override; + + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + static WhichRangesContainer GetRanges() { return pEffectsRanges; } + + virtual void Reset( const SfxItemSet* rSet ) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + + void DisableControls( sal_uInt16 nDisable ); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +// class SvxCharPositionPage --------------------------------------------- +class SvxCharPositionPage : public SvxCharBasePage +{ + static const WhichRangesContainer pPositionRanges; + +private: + short m_nSuperEsc; + short m_nSubEsc; + + sal_uInt16 m_nScaleWidthItemSetVal; + sal_uInt16 m_nScaleWidthInitialVal; + + sal_uInt8 m_nSuperProp; + sal_uInt8 m_nSubProp; + + std::unique_ptr<weld::RadioButton> m_xHighPosBtn; + std::unique_ptr<weld::RadioButton> m_xNormalPosBtn; + std::unique_ptr<weld::RadioButton> m_xLowPosBtn; + std::unique_ptr<weld::Label> m_xHighLowFT; + std::unique_ptr<weld::MetricSpinButton> m_xHighLowMF; + std::unique_ptr<weld::CheckButton> m_xHighLowRB; + std::unique_ptr<weld::Label> m_xFontSizeFT; + std::unique_ptr<weld::MetricSpinButton> m_xFontSizeMF; + + std::unique_ptr<weld::Widget> m_xRotationContainer; + + std::unique_ptr<weld::Label> m_xScalingFT; + std::unique_ptr<weld::Label> m_xScalingAndRotationFT; + std::unique_ptr<weld::RadioButton> m_x0degRB; + std::unique_ptr<weld::RadioButton> m_x90degRB; + std::unique_ptr<weld::RadioButton> m_x270degRB; + std::unique_ptr<weld::CheckButton> m_xFitToLineCB; + + std::unique_ptr<weld::MetricSpinButton> m_xScaleWidthMF; + + std::unique_ptr<weld::MetricSpinButton> m_xKerningMF; + std::unique_ptr<weld::CheckButton> m_xPairKerningBtn; + + void Initialize(); + void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); + void SetEscapement_Impl( SvxEscapement nEsc ); + + DECL_LINK(PositionHdl_Impl, weld::Toggleable&, void); + DECL_LINK(RotationHdl_Impl, weld::Toggleable&, void); + DECL_LINK(AutoPositionHdl_Impl, weld::Toggleable&, void); + DECL_LINK(FitToLineHdl_Impl, weld::Toggleable&, void); + DECL_LINK(KerningModifyHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ValueChangedHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ScaleWidthModifyHdl_Impl, weld::MetricSpinButton&, void); + void FontModifyHdl_Impl(); + +public: + SvxCharPositionPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxCharPositionPage() override; + + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + static WhichRangesContainer GetRanges() { return pPositionRanges; } + + virtual void Reset( const SfxItemSet* rSet ) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + virtual void FillUserData() override; + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +// class SvxCharTwoLinesPage --------------------------------------------- + +class SvxCharTwoLinesPage : public SvxCharBasePage +{ +private: + static const WhichRangesContainer pTwoLinesRanges; + sal_uInt16 m_nStartBracketPosition; + sal_uInt16 m_nEndBracketPosition; + + std::unique_ptr<weld::CheckButton> m_xTwoLinesBtn; + std::unique_ptr<weld::Widget> m_xEnclosingFrame; + std::unique_ptr<weld::TreeView> m_xStartBracketLB; + std::unique_ptr<weld::TreeView> m_xEndBracketLB; + + void UpdatePreview_Impl(); + void Initialize(); + void SelectCharacter(weld::TreeView* pBox); + void SetBracket(sal_Unicode cBracket, bool bStart); + + DECL_LINK(TwoLinesHdl_Impl, weld::Toggleable&, void); + DECL_LINK(CharacterMapHdl_Impl, weld::TreeView&, void); + +public: + SvxCharTwoLinesPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxCharTwoLinesPage() override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + static WhichRangesContainer GetRanges() { return pTwoLinesRanges; } + + virtual void Reset( const SfxItemSet* rSet ) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx new file mode 100644 index 0000000000..73891d0ff8 --- /dev/null +++ b/cui/source/inc/connect.hxx @@ -0,0 +1,85 @@ +/* -*- 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 . + */ +#pragma once + +#include <svx/connctrl.hxx> +#include <sfx2/tabdlg.hxx> +#include <vcl/customweld.hxx> +#include <vcl/weld.hxx> +#include <sfx2/basedlgs.hxx> + +class SdrView; + +/// Dialog for changing connectors. +class SvxConnectionPage : public SfxTabPage +{ +private: + static const WhichRangesContainer pRanges; + const SfxItemSet& rOutAttrs; + SfxItemSet aAttrSet; + const SdrView* pView; + MapUnit eUnit; + + SvxXConnectionPreview m_aCtlPreview; + std::unique_ptr<weld::ComboBox> m_xLbType; + std::unique_ptr<weld::Label> m_xFtLine1; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldLine1; + std::unique_ptr<weld::Label> m_xFtLine2; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldLine2; + std::unique_ptr<weld::Label> m_xFtLine3; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldLine3; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHorz1; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldVert1; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHorz2; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldVert2; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + void FillTypeLB(); + + DECL_LINK(ChangeAttrEditHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void); + + template<class T> + void SetMetricValueAndSave(const SfxItemSet *rAttrs, weld::MetricSpinButton &rField, TypedWhichId<T> nWhich); +public: + + SvxConnectionPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxConnectionPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + void Construct(); + void SetView( const SdrView* pSdrView ) { pView = pSdrView; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* Derived from SfxSingleTabDialogController, in order to be informed about + virtual methods by the control. */ +class SvxConnectionDialog : public SfxSingleTabDialogController +{ +public: + SvxConnectionDialog(weld::Window* pParent, const SfxItemSet& rAttr, + const SdrView* pView); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx new file mode 100644 index 0000000000..29484ef8f6 --- /dev/null +++ b/cui/source/inc/cuifmsearch.hxx @@ -0,0 +1,180 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/sdbc/XResultSet.hpp> + +#include <svx/fmsearch.hxx> +#include <vcl/weld.hxx> +#include <tools/link.hxx> +#include <rtl/ustring.hxx> + +namespace svxform +{ +class FmSearchConfigItem; +} + +struct FmSearchProgress; + +class FmSearchEngine; + +/// Dialog for searching in Forms/Tables +class FmSearchDialog final : public weld::GenericDialogController +{ + friend class FmSearchEngine; + + OUString m_sSearch; + OUString m_sCancel; + + Link<FmFoundRecordInformation&, void> m_lnkFoundHandler; ///< Handler for "found" + Link<FmFoundRecordInformation&, void> + m_lnkCanceledNotFoundHdl; ///< Handler for Positioning the Cursors + + Link<FmSearchContext&, sal_uInt32> m_lnkContextSupplier; ///< for search in contexts + + /// memorize the currently selected field for every context + std::vector<OUString> m_arrContextFields; + + std::unique_ptr<FmSearchEngine> m_pSearchEngine; + + // see EnableSearchUI + std::unique_ptr<::svxform::FmSearchConfigItem> m_pConfig; + + // my all Controls + std::unique_ptr<weld::RadioButton> m_prbSearchForText; + std::unique_ptr<weld::RadioButton> m_prbSearchForNull; + std::unique_ptr<weld::RadioButton> m_prbSearchForNotNull; + std::unique_ptr<weld::ComboBox> m_pcmbSearchText; + std::unique_ptr<weld::Label> m_pftForm; + std::unique_ptr<weld::ComboBox> m_plbForm; + std::unique_ptr<weld::RadioButton> m_prbAllFields; + std::unique_ptr<weld::RadioButton> m_prbSingleField; + std::unique_ptr<weld::ComboBox> m_plbField; + std::unique_ptr<weld::Label> m_pftPosition; + std::unique_ptr<weld::ComboBox> m_plbPosition; + std::unique_ptr<weld::CheckButton> m_pcbUseFormat; + std::unique_ptr<weld::CheckButton> m_pcbCase; + std::unique_ptr<weld::CheckButton> m_pcbBackwards; + std::unique_ptr<weld::CheckButton> m_pcbStartOver; + std::unique_ptr<weld::CheckButton> m_pcbWildCard; + std::unique_ptr<weld::CheckButton> m_pcbRegular; + std::unique_ptr<weld::CheckButton> m_pcbApprox; + std::unique_ptr<weld::Button> m_ppbApproxSettings; + std::unique_ptr<weld::CheckButton> m_pHalfFullFormsCJK; + std::unique_ptr<weld::CheckButton> m_pSoundsLikeCJK; + std::unique_ptr<weld::Button> m_pSoundsLikeCJKSettings; + std::unique_ptr<weld::Label> m_pftRecord; + std::unique_ptr<weld::Label> m_pftHint; + std::unique_ptr<weld::Button> m_pbSearchAgain; + std::unique_ptr<weld::Button> m_pbClose; + +public: + /** This can search in different sets of fields. There is a number of contexts; their names are in strContexts (separated + by ';'), the user can choose one of them. + When the user chooses a context, lnkContextSupplier is called, it gets a pointer on a FmSearchContext-structure, + that has to be filled. + The following counts for the search : + a) in case of formatted search the iterator itself is used (like in the first constructor) + b) in case of formatted search NOT the FormatKey at the fields of the iterator is used, but the respective TextComponent + is asked (that's why the original iterator is used; by its move the controls behind the TextComponent-interface are + updated hopefully) + c) in case of not-formatted search a clone of the iterator is used (because the TextComponent-interfaces don't need to + be asked) + (of course needed : the string number i in strUsedFields of a context must correspond with the interface number i in the + arrFields of the context) + */ + FmSearchDialog(weld::Window* pParent, const OUString& strInitialText, + const std::vector<OUString>& _rContexts, sal_Int16 nInitialContext, + const Link<FmSearchContext&, sal_uInt32>& lnkContextSupplier); + + virtual short run() override; + + virtual ~FmSearchDialog() override; + + /** The found-handler gets in the 'found'-case a pointer on a FmFoundRecordInformation-structure + (which is only valid in the handler; so if one needs to memorize the data, don't copy the pointer but + the structure). + This handler MUST be set. + Furthermore, it should be considered, that during the handler the search-dialog is still modal. + */ + void SetFoundHandler(const Link<FmFoundRecordInformation&, void>& lnk) + { + m_lnkFoundHandler = lnk; + } + /** + If the search has been cancelled or has been finished without success, the current data set is always displayed in the + search dialog. This handler exists to make this synchronous with the possible display of the caller (it does not + necessarily need to be set). + The pointer that is passed to the handler points to a FmFoundRecordInformation-structure, for which aPosition and + possibly (in a search with contexts) nContext are valid. + */ + void SetCanceledNotFoundHdl(const Link<FmFoundRecordInformation&, void>& lnk) + { + m_lnkCanceledNotFoundHdl = lnk; + } + + inline void SetActiveField(const OUString& strField); + +private: + void Init(std::u16string_view strVisibleFields, const OUString& strInitialText); + // only to be used out of the constructors + + void OnFound(const css::uno::Any& aCursorPos, sal_Int16 nFieldPos); + + void EnableSearchUI(bool bEnable); + + void EnableSearchForDependees(bool bEnable); + + void InitContext(sal_Int16 nContext); + + void LoadParams(); + void SaveParams() const; + + // Handler for the Controls + DECL_LINK(OnToggledSearchRadio, weld::Toggleable&, void); + DECL_LINK(OnToggledFieldRadios, weld::Toggleable&, void); + DECL_LINK(OnClickedSearchAgain, weld::Button&, void); + DECL_LINK(OnClickedSpecialSettings, weld::Button&, void); + + DECL_LINK(OnSearchTextModified, weld::ComboBox&, void); + + DECL_LINK(OnPositionSelected, weld::ComboBox&, void); + DECL_LINK(OnFieldSelected, weld::ComboBox&, void); + + DECL_LINK(OnFocusGrabbed, weld::Widget&, void); + DECL_LINK(OnCheckBoxToggled, weld::Toggleable&, void); + + DECL_LINK(OnContextSelection, weld::ComboBox&, void); + + DECL_LINK(OnSearchProgress, const FmSearchProgress*, void); + + void initCommon(const css::uno::Reference<css::sdbc::XResultSet>& _rxCursor); +}; + +inline void FmSearchDialog::SetActiveField(const OUString& strField) +{ + int nInitialField = m_plbField->find_text(strField); + if (nInitialField == -1) + nInitialField = 0; + m_plbField->set_active(nInitialField); + OnFieldSelected(*m_plbField); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx new file mode 100644 index 0000000000..cac63d8a6b --- /dev/null +++ b/cui/source/inc/cuigaldlg.hxx @@ -0,0 +1,276 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/config.h> + +#include <salhelper/thread.hxx> +#include <tools/urlobj.hxx> +#include <vcl/idle.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/galctrl.hxx> +#include <svx/galmisc.hxx> +#include <com/sun/star/media/XPlayer.hpp> +#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp> +#include <svtools/dialogclosedlistener.hxx> + +#include <string_view> +#include <vector> + +class GalleryTheme; +class SearchProgress; +class TakeProgress; +class TPGalleryThemeProperties; + +typedef std::vector< sal_Int32 > TokenList_impl; + +struct FilterEntry +{ + OUString aFilterName; +}; + +class SearchThread: public salhelper::Thread +{ +private: + + SearchProgress* mpProgress; + TPGalleryThemeProperties* mpBrowser; + INetURLObject maStartURL; + + void ImplSearch( const INetURLObject& rStartURL, + const std::vector< OUString >& rFormats, + bool bRecursive ); + + virtual ~SearchThread() override; + virtual void execute() override; + +public: + + SearchThread(SearchProgress* pProgress, + TPGalleryThemeProperties* pBrowser, + INetURLObject aStartURL); +}; + +class SearchProgress : public weld::GenericDialogController +{ +private: + INetURLObject startUrl_; + TPGalleryThemeProperties* m_pTabPage; + rtl::Reference< SearchThread > m_aSearchThread; + std::unique_ptr<weld::Label> m_xFtSearchDir; + std::unique_ptr<weld::Label> m_xFtSearchType; + std::unique_ptr<weld::Button> m_xBtnCancel; + + DECL_LINK(ClickCancelBtn, weld::Button&, void); + +public: + SearchProgress(weld::Window* pParent, TPGalleryThemeProperties* pTabPage, INetURLObject aStartURL); + void LaunchThread(); + virtual ~SearchProgress() override; + + DECL_LINK( CleanUpHdl, void*, void ); + + void SetFileType( const OUString& rType ) { m_xFtSearchType->set_label(rType); } + void SetDirectory( const INetURLObject& rURL ) { m_xFtSearchDir->set_label(GetReducedString(rURL, 30)); } +}; + +class TakeThread: public salhelper::Thread +{ +private: + + TakeProgress* mpProgress; + TPGalleryThemeProperties* mpBrowser; + TokenList_impl& mrTakenList; + + virtual ~TakeThread() override; + virtual void execute() override; + +public: + + TakeThread( + TakeProgress* pProgress, + TPGalleryThemeProperties* pBrowser, + TokenList_impl& rTakenList + ); +}; + +class TakeProgress : public weld::GenericDialogController +{ +private: + weld::Window* m_pParent; + TPGalleryThemeProperties* m_pTabPage; + rtl::Reference< TakeThread > maTakeThread; + TokenList_impl maTakenList; + std::unique_ptr<weld::Label> m_xFtTakeFile; + std::unique_ptr<weld::Button> m_xBtnCancel; + + DECL_LINK(ClickCancelBtn, weld::Button&, void); + +public: + + TakeProgress(weld::Window* pParent, TPGalleryThemeProperties* pTabPage); + void LaunchThread(); + virtual ~TakeProgress() override; + + DECL_LINK( CleanUpHdl, void*, void ); + + void SetFile( const INetURLObject& rURL ) { m_xFtTakeFile->set_label(GetReducedString(rURL, 30)); } +}; + +class ActualizeProgress : public weld::GenericDialogController +{ +private: + Idle* pIdle; + GalleryTheme* pTheme; + GalleryProgress aStatusProgress; + std::unique_ptr<weld::Label> m_xFtActualizeFile; + std::unique_ptr<weld::Button> m_xBtnCancel; + + DECL_LINK(ClickCancelBtn, weld::Button&, void); + DECL_LINK(TimeoutHdl, Timer*, void); + DECL_LINK(ActualizeHdl, const INetURLObject&, void); + +public: + ActualizeProgress(weld::Widget* pWindow, GalleryTheme* pThm); + virtual ~ActualizeProgress() override; + + virtual short run() override; +}; + +class TitleDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Entry> m_xEdit; +public: + TitleDialog(weld::Widget* pParent, const OUString& rOldText); + virtual ~TitleDialog() override; + OUString GetTitle() const { return m_xEdit->get_text(); } +}; + +class GalleryIdDialog : public weld::GenericDialogController +{ +private: + GalleryTheme* m_pThm; + std::unique_ptr<weld::Button> m_xBtnOk; + std::unique_ptr<weld::ComboBox> m_xLbResName; + + DECL_LINK(ClickOkHdl, weld::Button&, void); +public: + GalleryIdDialog(weld::Widget* pParent, GalleryTheme* pThm); + virtual ~GalleryIdDialog() override; + sal_uInt32 GetId() const { return m_xLbResName->get_active(); } +}; + +class GalleryThemeProperties : public SfxTabDialogController +{ + ExchangeData* pData; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +public: + GalleryThemeProperties(weld::Widget* pParent, ExchangeData* pData, SfxItemSet const * pItemSet); +}; + +class TPGalleryThemeGeneral : public SfxTabPage +{ +private: + ExchangeData* pData; + + std::unique_ptr<weld::Image> m_xFiMSImage; + std::unique_ptr<weld::Entry> m_xEdtMSName; + std::unique_ptr<weld::Label> m_xFtMSShowType; + std::unique_ptr<weld::Label> m_xFtMSShowPath; + std::unique_ptr<weld::Label> m_xFtMSShowContent; + std::unique_ptr<weld::Label> m_xFtMSShowChangeDate; + + virtual void Reset( const SfxItemSet* ) override {} + virtual bool FillItemSet( SfxItemSet* rSet ) override; + +public: + TPGalleryThemeGeneral(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + void SetXChgData( ExchangeData* pData ); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); +}; + +class TPGalleryThemeProperties : public SfxTabPage +{ + friend class SearchThread; + friend class TakeProgress; + friend class TakeThread; + + ExchangeData* pData; + std::vector<OUString> aFoundList; + std::vector< std::unique_ptr<FilterEntry> > + aFilterEntryList; + Timer aPreviewTimer; + OUString aLastFilterName; + OUString aPreviewString; + INetURLObject aURL; + bool bEntriesFound; + bool bInputAllowed; + bool bTakeAll; + bool bSearchRecursive; + + rtl::Reference< ::svt::DialogClosedListener > xDialogListener; + css::uno::Reference< css::media::XPlayer > xMediaPlayer; + css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker; + + DialogGalleryPreview m_aWndPreview; + std::unique_ptr<weld::ComboBox> m_xCbbFileType; + std::unique_ptr<weld::TreeView> m_xLbxFound; + std::unique_ptr<weld::Button> m_xBtnSearch; + std::unique_ptr<weld::Button> m_xBtnTake; + std::unique_ptr<weld::Button> m_xBtnTakeAll; + std::unique_ptr<weld::CheckButton> m_xCbxPreview; + std::unique_ptr<weld::CustomWeld> m_xWndPreview; + + virtual void Reset( const SfxItemSet* /*rSet*/ ) override {} + virtual bool FillItemSet( SfxItemSet* /*rSet*/ ) override { return true; } + static OUString addExtension( const OUString&, std::u16string_view ); + void FillFilterList(); + + void SearchFiles(); + void TakeFiles(); + void DoPreview(); + void EndSearchProgressHdl(sal_Int32 nResult); + + DECL_LINK(ClickPreviewHdl, weld::Toggleable&, void); + DECL_LINK(ClickSearchHdl, weld::Button&, void); + DECL_LINK(ClickTakeHdl, weld::Button&, void); + DECL_LINK(ClickTakeAllHdl, weld::Button&, void); + DECL_LINK(SelectFoundHdl, weld::TreeView&, void); + DECL_LINK(SelectFileTypeHdl, weld::ComboBox&, void); + DECL_LINK(DClickFoundHdl, weld::TreeView&, bool); + DECL_LINK(PreviewTimerHdl, Timer*, void); + DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void); + +public: + TPGalleryThemeProperties(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~TPGalleryThemeProperties() override; + + void SetXChgData( ExchangeData* pData ); + const ExchangeData* GetXChgData() const { return pData; } + + void StartSearchFiles( std::u16string_view _rFolderURL, short _nDlgResult ); + + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx new file mode 100644 index 0000000000..075c74c29f --- /dev/null +++ b/cui/source/inc/cuigrfflt.hxx @@ -0,0 +1,180 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/timer.hxx> +#include <svx/dlgctrl.hxx> +#include <svx/rectenum.hxx> + +class CuiGraphicPreviewWindow : public weld::CustomWidgetController +{ +private: + const Graphic* mpOrigGraphic; + Size maOrigGraphicSizePixel; + Size maOutputSizePixel; + Link<LinkParamNone*,void> maModifyHdl; + Graphic maScaledOrig; + Graphic maPreview; + double mfScaleX; + double mfScaleY; + + virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override; + virtual void Resize() override; + + void ScaleImageToFit(); + +public: + CuiGraphicPreviewWindow(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + void init(const Graphic* pOrigGraphic, const Link<LinkParamNone*,void>& rLink) + { + mpOrigGraphic = pOrigGraphic; + maModifyHdl = rLink; + maOrigGraphicSizePixel = GetDrawingArea()->get_ref_device().LogicToPixel(mpOrigGraphic->GetPrefSize(), + mpOrigGraphic->GetPrefMapMode()); + ScaleImageToFit(); + } + + void SetPreview(const Graphic& rGraphic); + const Graphic& GetScaledOriginal() const { return maScaledOrig; } + double GetScaleX() const { return mfScaleX; } + double GetScaleY() const { return mfScaleY; } + const Size& GetGraphicSizePixel() const { return maOrigGraphicSizePixel; } +}; + +class GraphicFilterDialog : public weld::GenericDialogController +{ +private: + + Timer maTimer; + Link<LinkParamNone*,void> maModifyHdl; + bool bIsBitmap; + + DECL_LINK( ImplPreviewTimeoutHdl, Timer *, void ); + DECL_LINK( ImplModifyHdl, LinkParamNone*, void); + + CuiGraphicPreviewWindow maPreview; + std::unique_ptr<weld::CustomWeld> mxPreview; + +protected: + const Link<LinkParamNone*,void>& GetModifyHdl() const { return maModifyHdl; } + const Size& GetGraphicSizePixel() const { return maPreview.GetGraphicSizePixel(); } + +public: + + GraphicFilterDialog(weld::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID, const Graphic& rGraphic); + virtual Graphic GetFilteredGraphic(const Graphic& rGraphic, double fScaleX, double fScaleY) = 0; +}; + +class GraphicFilterSmooth : public GraphicFilterDialog +{ +private: + std::unique_ptr<weld::SpinButton> mxMtrRadius; + DECL_LINK(EditModifyHdl, weld::SpinButton&, void); + +public: + + GraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius); + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; +}; + +class GraphicFilterMosaic : public GraphicFilterDialog +{ +private: + std::unique_ptr<weld::MetricSpinButton> mxMtrWidth; + std::unique_ptr<weld::MetricSpinButton> mxMtrHeight; + std::unique_ptr<weld::CheckButton> mxCbxEdges; + DECL_LINK(CheckBoxModifyHdl, weld::Toggleable&, void); + DECL_LINK(EditModifyHdl, weld::MetricSpinButton&, void); +public: + + GraphicFilterMosaic(weld::Window* pParent, const Graphic& rGraphic, + sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, bool bEnhanceEdges); + + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; + bool IsEnhanceEdges() const { return mxCbxEdges->get_active(); } +}; + +class GraphicFilterSolarize : public GraphicFilterDialog +{ +private: + std::unique_ptr<weld::MetricSpinButton> mxMtrThreshold; + std::unique_ptr<weld::CheckButton> mxCbxInvert; + DECL_LINK(CheckBoxModifyHdl, weld::Toggleable&, void); + DECL_LINK(EditModifyHdl, weld::MetricSpinButton&, void); + +public: + GraphicFilterSolarize(weld::Window* pParent, const Graphic& rGraphic, + sal_uInt8 nGreyThreshold, bool bInvert); + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; + bool IsInvert() const { return mxCbxInvert->get_active(); } +}; + +class GraphicFilterSepia : public GraphicFilterDialog +{ +private: + std::unique_ptr<weld::MetricSpinButton> mxMtrSepia; + DECL_LINK(EditModifyHdl, weld::MetricSpinButton&, void); +public: + GraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic, + sal_uInt16 nSepiaPercent); + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; +}; + +class GraphicFilterPoster : public GraphicFilterDialog +{ +private: + std::unique_ptr<weld::SpinButton> mxNumPoster; + DECL_LINK(EditModifyHdl, weld::SpinButton&, void); +public: + GraphicFilterPoster(weld::Window* pParent, const Graphic& rGraphic, + sal_uInt16 nPosterColorCount); + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; +}; + +class EmbossControl : public SvxRectCtl +{ +private: + Link<LinkParamNone*, void> maModifyHdl; + virtual bool MouseButtonDown( const MouseEvent& rEvt ) override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; +public: + EmbossControl() + : SvxRectCtl(nullptr) + { + } + + void SetModifyHdl( const Link<LinkParamNone*,void>& rHdl ) { maModifyHdl = rHdl; } +}; + +class GraphicFilterEmboss : public GraphicFilterDialog +{ +private: + EmbossControl maCtlLight; + std::unique_ptr<weld::CustomWeld> mxCtlLight; +public: + GraphicFilterEmboss(weld::Window* pParent, const Graphic& rGraphic, + RectPoint eLightSource); + virtual ~GraphicFilterEmboss() override; + + virtual Graphic GetFilteredGraphic(const Graphic& rGraphic, double fScaleX, double fScaleY) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx new file mode 100644 index 0000000000..8423d8c497 --- /dev/null +++ b/cui/source/inc/cuihyperdlg.hxx @@ -0,0 +1,141 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/config.h> + +#include <memory> +#include <string_view> + +#include <svx/hlnkitem.hxx> +#include <sfx2/childwin.hxx> +#include <sfx2/ctrlitem.hxx> +#include <sfx2/bindings.hxx> + +#include "iconcdlg.hxx" + +/************************************************************************* +|* +|* Hyperlink-Dialog +|* +\************************************************************************/ + +class SvxHpLinkDlg; +class SvxHlinkCtrl : public SfxControllerItem +{ +private: + SvxHpLinkDlg* pParent; + + SfxStatusForwarder aRdOnlyForwarder; + +public: + SvxHlinkCtrl( sal_uInt16 nId, SfxBindings & rBindings, SvxHpLinkDlg* pDlg); + virtual void dispose() override; + + virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; +}; + + +/************************************************************************* +|* +|* Hyperlink-Dialog +|* +\************************************************************************/ + +class SvxHpLinkDlg : public SfxModelessDialogController +{ +private: + friend class IconChoicePage; + + std::vector< std::unique_ptr<IconChoicePageData> > maPageList; + + OUString msCurrentPageId; + // tdf#90496 - remember last used view in hyperlink dialog + static OUString msRememberedPageId; + + const SfxItemSet* pSet; + std::unique_ptr<SfxItemSet> pOutSet; + std::unique_ptr<SfxItemSet> pExampleSet; + WhichRangesContainer pRanges; + + SvxHlinkCtrl maCtrl; ///< Controller + std::unique_ptr<SfxItemSet> mpItemSet; + + bool mbGrabFocus : 1; + bool mbIsHTMLDoc : 1; + + std::unique_ptr<weld::Notebook> m_xIconCtrl; + std::unique_ptr<weld::Button> m_xOKBtn; + std::unique_ptr<weld::Button> m_xApplyBtn; + std::unique_ptr<weld::Button> m_xCancelBtn; + std::unique_ptr<weld::Button> m_xHelpBtn; + std::unique_ptr<weld::Button> m_xResetBtn; + + DECL_LINK( ChosePageHdl_Impl, const OUString&, void ); + + IconChoicePageData* GetPageData ( std::u16string_view rId ); + + void SwitchPage( const OUString& rId ); + + DECL_LINK( ResetHdl, weld::Button&, void) ; + DECL_LINK (ClickOkHdl_Impl, weld::Button&, void ); + DECL_LINK (ClickApplyHdl_Impl, weld::Button&, void ); + + IconChoicePage* GetTabPage( std::u16string_view rPageId ) + { return GetPageData(rPageId)->xPage.get(); } + + void ActivatePageImpl (); + void DeActivatePageImpl (); + void ResetPageImpl (); + + void Activate() override; + virtual void Close() override; + void Apply(); + +public: + SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld::Window* pParent); + virtual ~SvxHpLinkDlg () override; + + // interface + void AddTabPage(const OUString &rId, CreatePage pCreateFunc /* != NULL */); + + void SetCurPageId( const OUString& rId ) { msCurrentPageId = rId; SwitchPage(rId ); } + const OUString& GetCurPageId() const { return msCurrentPageId; } + void ShowPage( const OUString& rId ); + + /// gives via map converted local slots if applicable + WhichRangesContainer GetInputRanges( const SfxItemPool& ); + void SetInputSet( const SfxItemSet* pInSet ); + + void Start(); + bool QueryClose(); + + void PageCreated(IconChoicePage& rPage); + + void SetPage( SvxHyperlinkItem const * pItem ); + void SetReadOnlyMode( bool bReadOnly ); + bool IsHTMLDoc() const { return mbIsHTMLDoc; } + + SfxDispatcher* GetDispatcher() const { return GetBindings().GetDispatcher(); } +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuiimapwnd.hxx b/cui/source/inc/cuiimapwnd.hxx new file mode 100644 index 0000000000..ccb65bd487 --- /dev/null +++ b/cui/source/inc/cuiimapwnd.hxx @@ -0,0 +1,47 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> +#include <sfx2/frame.hxx> + +class URLDlg : public weld::GenericDialogController +{ + std::unique_ptr<weld::Entry> m_xEdtURL; + std::unique_ptr<weld::ComboBox> m_xCbbTargets; + std::unique_ptr<weld::Entry> m_xEdtName; + std::unique_ptr<weld::Entry> m_xEdtAlternativeText; + std::unique_ptr<weld::TextView> m_xEdtDescription; + +public: + + URLDlg(weld::Widget* pWindow, + const OUString& rURL, const OUString& rAlternativeText, const OUString& rDescription, + const OUString& rTarget, const OUString& rName, + TargetList& rTargetList); + virtual ~URLDlg() override; + + OUString GetURL() const { return m_xEdtURL->get_text(); } + OUString GetAltText() const { return m_xEdtAlternativeText->get_text(); } + OUString GetDesc() const { return m_xEdtDescription->get_text(); } + OUString GetTarget() const { return m_xCbbTargets->get_active_text(); } + OUString GetName() const { return m_xEdtName->get_text(); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx new file mode 100644 index 0000000000..0ee8cacb6c --- /dev/null +++ b/cui/source/inc/cuioptgenrl.hxx @@ -0,0 +1,80 @@ +/* -*- 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 . + */ +#pragma once + +// include --------------------------------------------------------------- + +#include <sfx2/tabdlg.hxx> +#include <vcl/weld.hxx> + +#include <vector> + +// class SvxGeneralTabPage ----------------------------------------------- + +class SvxGeneralTabPage : public SfxTabPage +{ +private: + // the "Use data for document properties" checkbox + std::unique_ptr<weld::CheckButton> m_xUseDataCB; + std::unique_ptr<weld::Widget> m_xUseDataImg; + std::unique_ptr<weld::Widget> m_xCryptoFrame; + std::unique_ptr<weld::ComboBox> m_xSigningKeyLB; + std::unique_ptr<weld::Label> m_xSigningKeyFT; + std::unique_ptr<weld::Widget> m_xSigningKeyImg; + std::unique_ptr<weld::ComboBox> m_xEncryptionKeyLB; + std::unique_ptr<weld::Label> m_xEncryptionKeyFT; + std::unique_ptr<weld::Widget> m_xEncryptionKeyImg; + std::unique_ptr<weld::CheckButton> m_xEncryptToSelfCB; + std::unique_ptr<weld::Widget> m_xEncryptToSelfImg; + // rows + struct Row; + std::vector<std::shared_ptr<Row> > vRows; + // fields + struct Field; + std::vector<std::shared_ptr<Field> > vFields; + // "name" fields + unsigned nNameRow; + unsigned nShortNameField; + + DECL_LINK( ModifyHdl_Impl, weld::Entry&, void ); + + bool GetData_Impl(); + void SetData_Impl(); + + void InitControls (); + void InitCryptography(); + void SetLinks (); + +protected: + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + SvxGeneralTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxGeneralTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet ); + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx new file mode 100644 index 0000000000..b22b341029 --- /dev/null +++ b/cui/source/inc/cuisrchdlg.hxx @@ -0,0 +1,41 @@ +/* -*- 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 . + */ +#pragma once + +#include <i18nutil/transliteration.hxx> +#include <sfx2/basedlgs.hxx> + +class SvxJSearchOptionsPage; + +class SvxJSearchOptionsDialog : public SfxSingleTabDialogController +{ + SvxJSearchOptionsPage* m_pPage; + + SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) = delete; + SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & ) = delete; + +public: + SvxJSearchOptionsDialog(weld::Window *pParent, + const SfxItemSet& rOptionsSet, TransliterationFlags nInitialFlags); + virtual ~SvxJSearchOptionsDialog() override; + + TransliterationFlags GetTransliterationFlags() const; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx new file mode 100644 index 0000000000..3e810c5b0d --- /dev/null +++ b/cui/source/inc/cuitabarea.hxx @@ -0,0 +1,753 @@ +/* -*- 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 . + */ +#pragma once + +#include <svtools/valueset.hxx> +#include <svx/dlgctrl.hxx> +#include <svx/xflasit.hxx> +#include <svx/tabarea.hxx> +#include <svx/hexcolorcontrol.hxx> +#include <svx/SvxColorValueSet.hxx> +#include <svx/SvxPresetListBox.hxx> +#include <svx/PaletteManager.hxx> +#include <svx/svdview.hxx> + +#define NO_BUTTON_SELECTED -1 + +class ColorListBox; +class SdrModel; +class SvxBitmapCtl; + +/************************************************************************/ +class ButtonBox +{ + private: + sal_Int32 mnCurrentButton; + std::vector<weld::Toggleable*> maButtonList; + std::map<weld::Toggleable*, sal_Int32 > maButtonToPos; + void SelectButtonImpl( sal_Int32 nPos ) + { + if(mnCurrentButton != NO_BUTTON_SELECTED) + { + maButtonList[mnCurrentButton]->set_active(false); + } + mnCurrentButton = nPos; + maButtonList[mnCurrentButton]->set_active(true); + }; + public: + ButtonBox() + { + mnCurrentButton = NO_BUTTON_SELECTED; + }; + void AddButton(weld::Toggleable* pButton) + { + maButtonList.push_back(pButton); + maButtonToPos.insert( std::make_pair(pButton, maButtonList.size() - 1) ); + } + sal_Int32 GetCurrentButtonPos() const { return mnCurrentButton; } + sal_Int32 GetButtonPos(weld::Toggleable* pButton) + { + std::map<weld::Toggleable*, sal_Int32>::const_iterator aBtnPos = maButtonToPos.find(pButton); + if(aBtnPos != maButtonToPos.end()) + return aBtnPos->second; + else + return -1; + } + void SelectButton(weld::Toggleable* pButton) + { + sal_Int32 nPos = GetButtonPos(pButton); + if(nPos != -1) + SelectButtonImpl(nPos); + } +}; + +enum class PageType +{ + Area, + Gradient, + Hatch, + Bitmap, + Shadow, + Transparence, +}; + +class SvxAreaTabDialog final : public SfxTabDialogController +{ + SdrModel* mpDrawModel; + + XColorListRef mpColorList; + XColorListRef mpNewColorList; + XGradientListRef mpGradientList; + XGradientListRef mpNewGradientList; + XHatchListRef mpHatchingList; + XHatchListRef mpNewHatchingList; + XBitmapListRef mpBitmapList; + XBitmapListRef mpNewBitmapList; + XPatternListRef mpPatternList; + XPatternListRef mpNewPatternList; + + ChangeType mnColorListState; + ChangeType mnBitmapListState; + ChangeType mnPatternListState; + ChangeType mnGradientListState; + ChangeType mnHatchingListState; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + + virtual short Ok() override; + DECL_LINK(CancelHdlImpl, weld::Button&, void); + void SavePalettes(); + +public: + SvxAreaTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow, + bool bSlideBackground); + + void SetNewColorList( XColorListRef const & pColorList ) + { mpNewColorList = pColorList; } + const XColorListRef& GetNewColorList() const { return mpNewColorList; } +}; + +/************************************************************************/ + +class SvxTransparenceTabPage : public SfxTabPage +{ + static const WhichRangesContainer pTransparenceRanges; + + const SfxItemSet& rOutAttrs; + + PageType nPageType; + sal_uInt16 nDlgType; + + bool bBitmap; + + XFillAttrSetItem aXFillAttr; + SfxItemSet& rXFSet; + + SvxXRectPreview m_aCtlBitmapPreview; + SvxXRectPreview m_aCtlXRectPreview; + + // main selection + std::unique_ptr<weld::RadioButton> m_xRbtTransOff; + std::unique_ptr<weld::RadioButton> m_xRbtTransLinear; + std::unique_ptr<weld::RadioButton> m_xRbtTransGradient; + + /// linear transparency + std::unique_ptr<weld::MetricSpinButton> m_xMtrTransparent; + + // gradient transparency + std::unique_ptr<weld::Widget> m_xGridGradient; + std::unique_ptr<weld::ComboBox> m_xLbTrgrGradientType; + std::unique_ptr<weld::Label> m_xFtTrgrCenterX; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrCenterX; + std::unique_ptr<weld::Label> m_xFtTrgrCenterY; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrCenterY; + std::unique_ptr<weld::Label> m_xFtTrgrAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrBorder; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrStartValue; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTrgrEndValue; + std::unique_ptr<weld::Widget> m_xCtlBitmapBorder; + std::unique_ptr<weld::Widget> m_xCtlXRectBorder; + + // preview + std::unique_ptr<weld::CustomWeld> m_xCtlBitmapPreview; + std::unique_ptr<weld::CustomWeld> m_xCtlXRectPreview; + + // MCGR: Preserve ColorStops until we have a UI to edit these + basegfx::BColorStops maColorStops; + + DECL_LINK(ClickTransOffHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ClickTransLinearHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ClickTransGradientHdl_Impl, weld::Toggleable&, void ); + DECL_LINK(ModifyTransparentHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ModifiedTrgrEditHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ModifiedTrgrListBoxHdl_Impl, weld::ComboBox&, void); + void ModifiedTrgrHdl_Impl(const weld::ComboBox*); + + void ActivateLinear(bool bActivate); + void ActivateGradient(bool bActivate); + void SetControlState_Impl(css::awt::GradientStyle eXGS); + + bool InitPreview ( const SfxItemSet& rSet ); + void InvalidatePreview (bool bEnable = true ); + + // MCGR: Preserve ColorStops until we have a UI to edit these + basegfx::BColorStops createColorStops(); + +public: + SvxTransparenceTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxTransparenceTabPage() override; + + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet*); + static WhichRangesContainer GetRanges() { return pTransparenceRanges; } + + virtual bool FillItemSet(SfxItemSet*) override; + virtual void Reset(const SfxItemSet*) override; + virtual void ChangesApplied() override; + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; + + void SetPageType(PageType nInType) { nPageType = nInType; } + void SetDlgType(sal_uInt16 nInType) { nDlgType = nInType; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/************************************************************************/ + +class SvxAreaTabPage : public SfxTabPage +{ + static const WhichRangesContainer pAreaRanges; +private: + std::unique_ptr<SfxTabPage> m_xFillTabPage; + ButtonBox maBox; + + XColorListRef m_pColorList; + XGradientListRef m_pGradientList; + XHatchListRef m_pHatchingList; + XBitmapListRef m_pBitmapList; + XPatternListRef m_pPatternList; + + // Placeholders for pointer-based entries; these will be inited + // to point to these so that the page is usable without that + // SvxAreaTabDialog has to call the setter methods (e.g. SetColorChgd). + // Without that the pages used in SvxAreaTabDialog are not usable + ChangeType maFixed_ChangeType; + + ChangeType* m_pnColorListState; + ChangeType* m_pnBitmapListState; + ChangeType* m_pnPatternListState; + ChangeType* m_pnGradientListState; + ChangeType* m_pnHatchingListState; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + + bool m_bBtnClicked = false; + +protected: + std::unique_ptr<weld::Container> m_xFillTab; + std::unique_ptr<weld::Toggleable> m_xBtnNone; + std::unique_ptr<weld::Toggleable> m_xBtnColor; + std::unique_ptr<weld::Toggleable> m_xBtnGradient; + std::unique_ptr<weld::Toggleable> m_xBtnHatch; + std::unique_ptr<weld::Toggleable> m_xBtnBitmap; + std::unique_ptr<weld::Toggleable> m_xBtnPattern; + std::unique_ptr<weld::Toggleable> m_xBtnUseBackground; + + void SetOptimalSize(weld::DialogController* pController); + + void SelectFillType( weld::Toggleable& rButton, const SfxItemSet* _pSet = nullptr ); + + bool IsBtnClicked() const { return m_bBtnClicked; } + +private: + DECL_LINK(SelectFillTypeHdl_Impl, weld::Toggleable&, void); + + template< typename TabPage > + bool FillItemSet_Impl( SfxItemSet* ); + template< typename TabPage > + void Reset_Impl( const SfxItemSet* ); + template< typename TabPage > + DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet ); + +public: + SvxAreaTabPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rInAttrs, bool bSlideBackground = false); + virtual ~SvxAreaTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> + CreateWithSlideBackground(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet*); + static WhichRangesContainer GetRanges() { return pAreaRanges; } + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; } + void SetGradientList( XGradientListRef const & pGrdLst) + { m_pGradientList = pGrdLst; } + void SetHatchingList( XHatchListRef const & pHtchLst) + { m_pHatchingList = pHtchLst; } + void SetBitmapList( XBitmapListRef const & pBmpLst) { m_pBitmapList = pBmpLst; } + void SetPatternList( XPatternListRef const &pPtrnLst ) { m_pPatternList = pPtrnLst; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; + void CreatePage(sal_Int32 nId, SfxTabPage& rTab); + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } + void SetGrdChgd( ChangeType* pIn ) { m_pnGradientListState = pIn; } + void SetHtchChgd( ChangeType* pIn ) { m_pnHatchingListState = pIn; } + void SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; } + void SetPtrnChgd( ChangeType* pIn ) { m_pnPatternListState = pIn; } +}; + + +class SvxShadowTabPage : public SvxTabPage +{ + static const WhichRangesContainer pShadowRanges; + +private: + const SfxItemSet& m_rOutAttrs; + + XColorListRef m_pColorList; + ChangeType* m_pnColorListState; + PageType m_nPageType; + sal_uInt16 m_nDlgType; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + MapUnit m_ePoolUnit; + + SvxRectCtl m_aCtlPosition; + SvxXShadowPreview m_aCtlXRectPreview; + std::unique_ptr<weld::CheckButton> m_xTsbShowShadow; + std::unique_ptr<weld::Widget> m_xGridShadow; + std::unique_ptr<weld::MetricSpinButton> m_xMtrDistance; + std::unique_ptr<ColorListBox> m_xLbShadowColor; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTransparent; + std::unique_ptr<weld::MetricSpinButton> m_xLbShadowBlurMetric; + std::unique_ptr<weld::CustomWeld> m_xCtlPosition; + std::unique_ptr<weld::CustomWeld> m_xCtlXRectPreview; + + DECL_LINK(ClickShadowHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ModifyShadowHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(SelectShadowHdl_Impl, ColorListBox&, void); + +public: + SvxShadowTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxShadowTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pShadowRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + virtual void PointChanged( weld::DrawingArea* pWindow, RectPoint eRP ) override; + + void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; } + void SetPageType( PageType nInType ) { m_nPageType = nInType; } + void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; } + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/************************************************************************/ + +class SvxGradientTabPage : public SfxTabPage +{ +private: + const SfxItemSet& m_rOutAttrs; + + XColorListRef m_pColorList; + XGradientListRef m_pGradientList; + + ChangeType* m_pnGradientListState; + ChangeType* m_pnColorListState; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + + // MCGR: Preserve ColorStops until we have a UI to edit these + basegfx::BColorStops m_aColorStops; + + SvxXRectPreview m_aCtlPreview; + std::unique_ptr<weld::ComboBox> m_xLbGradientType; + std::unique_ptr<weld::Label> m_xFtCenter; + std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterX; + std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterY; + std::unique_ptr<weld::Label> m_xFtAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle; + std::unique_ptr<weld::Scale> m_xSliderAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrBorder; + std::unique_ptr<weld::Scale> m_xSliderBorder; + std::unique_ptr<ColorListBox> m_xLbColorFrom; + std::unique_ptr<weld::MetricSpinButton> m_xMtrColorFrom; + std::unique_ptr<ColorListBox> m_xLbColorTo; + std::unique_ptr<weld::MetricSpinButton> m_xMtrColorTo; + std::unique_ptr<SvxPresetListBox> m_xGradientLB; + std::unique_ptr<weld::SpinButton> m_xMtrIncrement; + std::unique_ptr<weld::CheckButton> m_xCbIncrement; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + std::unique_ptr<weld::CustomWeld> m_xGradientLBWin; + + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ChangeGradientHdl, ValueSet*, void ); + void ChangeGradientHdl_Impl(); + DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK( ModifiedEditHdl_Impl, weld::SpinButton&, void ); + DECL_LINK( ModifiedMetricHdl_Impl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void ); + DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( ChangeAutoStepHdl_Impl, weld::Toggleable&, void ); + DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void ); + void ModifiedHdl_Impl(void const *); + + void SetControlState_Impl( css::awt::GradientStyle eXGS ); + sal_Int32 SearchGradientList(std::u16string_view rGradientName); + + // MCGR: Preserve ColorStops until we have a UI to edit these + basegfx::BColorStops createColorStops(); + +public: + SvxGradientTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxGradientTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; } + void SetGradientList( XGradientListRef const & pGrdLst) + { m_pGradientList = pGrdLst; } + void SetGrdChgd( ChangeType* pIn ) { m_pnGradientListState = pIn; } + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } +}; + +/************************************************************************/ + +class SvxHatchTabPage : public SfxTabPage +{ +private: + const SfxItemSet& m_rOutAttrs; + + XColorListRef m_pColorList; + XHatchListRef m_pHatchingList; + + ChangeType* m_pnHatchingListState; + ChangeType* m_pnColorListState; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + + MapUnit m_ePoolUnit; + + SvxXRectPreview m_aCtlPreview; + std::unique_ptr<weld::MetricSpinButton> m_xMtrDistance; + std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle; + std::unique_ptr<weld::Scale> m_xSliderAngle; + std::unique_ptr<weld::ComboBox> m_xLbLineType; + std::unique_ptr<ColorListBox> m_xLbLineColor; + std::unique_ptr<weld::CheckButton> m_xCbBackgroundColor; + std::unique_ptr<ColorListBox> m_xLbBackgroundColor; + std::unique_ptr<SvxPresetListBox> m_xHatchLB; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xHatchLBWin; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + DECL_LINK(ChangeHatchHdl, ValueSet*, void); + void ChangeHatchHdl_Impl(); + DECL_LINK( ModifiedEditHdl_Impl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void ); + DECL_LINK( ToggleHatchBackgroundColor_Impl, weld::Toggleable&, void ); + DECL_LINK( ModifiedBackgroundHdl_Impl, ColorListBox&, void ); + DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void ); + void ModifiedHdl_Impl(void const *); + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); + + sal_Int32 SearchHatchList(std::u16string_view rHatchName); + +public: + SvxHatchTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxHatchTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; } + void SetHatchingList( XHatchListRef const & pHtchLst) + { m_pHatchingList = pHtchLst; } + + void SetHtchChgd( ChangeType* pIn ) { m_pnHatchingListState = pIn; } + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } +}; + +/************************************************************************/ + +class SvxBitmapTabPage : public SfxTabPage +{ +private: + + const SfxItemSet& m_rOutAttrs; + + XBitmapListRef m_pBitmapList; + ChangeType* m_pnBitmapListState; + + double m_fObjectWidth; + double m_fObjectHeight; + bool m_bLogicalSize; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + const SdrView* mpView; + MapUnit mePoolUnit; + FieldUnit meFieldUnit; + Size rBitmapSize; + Size rFilledSize; + Size rZoomedSize; + + SvxXRectPreview m_aCtlBitmapPreview; + std::unique_ptr<SvxPresetListBox> m_xBitmapLB; + std::unique_ptr<weld::ComboBox> m_xBitmapStyleLB; + std::unique_ptr<weld::Container> m_xSizeBox; + std::unique_ptr<weld::CheckButton> m_xTsbScale; + std::unique_ptr<weld::MetricSpinButton> m_xBitmapWidth; + std::unique_ptr<weld::MetricSpinButton> m_xBitmapHeight; + std::unique_ptr<weld::Container> m_xPositionBox; + std::unique_ptr<weld::ComboBox> m_xPositionLB; + std::unique_ptr<weld::Container> m_xPositionOffBox; + std::unique_ptr<weld::MetricSpinButton> m_xPositionOffX; + std::unique_ptr<weld::MetricSpinButton> m_xPositionOffY; + std::unique_ptr<weld::Container> m_xTileOffBox; + std::unique_ptr<weld::ComboBox> m_xTileOffLB; + std::unique_ptr<weld::MetricSpinButton> m_xTileOffset; + std::unique_ptr<weld::Button> m_xBtnImport; + std::unique_ptr<weld::CustomWeld> m_xCtlBitmapPreview; + std::unique_ptr<weld::CustomWeld> m_xBitmapLBWin; + + DECL_LINK( ModifyBitmapHdl, ValueSet*, void ); + DECL_LINK( ClickScaleHdl, weld::Toggleable&, void ); + DECL_LINK( ModifyBitmapStyleHdl, weld::ComboBox&, void ); + DECL_LINK( ModifyBitmapSizeHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifyBitmapPositionHdl, weld::ComboBox&, void ); + DECL_LINK( ModifyPositionOffsetHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifyTileOffsetHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ClickRenameHdl, SvxPresetListBox*, void ); + DECL_LINK( ClickDeleteHdl, SvxPresetListBox*, void ); + DECL_LINK( ClickImportHdl, weld::Button&, void ); + void ClickBitmapHdl_Impl(); + void CalculateBitmapPresetSize(); + sal_Int32 SearchBitmapList(std::u16string_view rBitmapName); + sal_Int32 SearchBitmapList(const GraphicObject& rGraphicObject); + +public: + SvxBitmapTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxBitmapTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetBitmapList( const XBitmapListRef& pBmpLst) { m_pBitmapList = pBmpLst; } + void SetBmpChgd( ChangeType* pIn ) { m_pnBitmapListState = pIn; } +}; + +/************************************************************************/ + +class SvxPatternTabPage : public SvxTabPage +{ +private: + const SfxItemSet& m_rOutAttrs; + + XColorListRef m_pColorList; + XPatternListRef m_pPatternList; + + ChangeType* m_pnPatternListState; + ChangeType* m_pnColorListState; + + XFillAttrSetItem m_aXFillAttr; + SfxItemSet& m_rXFSet; + + SvxXRectPreview m_aCtlPreview; + std::unique_ptr<SvxPixelCtl> m_xCtlPixel; + std::unique_ptr<ColorListBox> m_xLbColor; + std::unique_ptr<ColorListBox> m_xLbBackgroundColor; + std::unique_ptr<SvxPresetListBox> m_xPatternLB; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::CustomWeld> m_xCtlPixelWin; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + std::unique_ptr<weld::CustomWeld> m_xPatternLBWin; + std::unique_ptr<SvxBitmapCtl> m_xBitmapCtl; + + DECL_LINK( ClickAddHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void ); + DECL_LINK( ChangePatternHdl_Impl, ValueSet*, void ); + DECL_LINK( ChangeColorHdl_Impl, ColorListBox&, void ); + DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void ); + DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void ); + + sal_Int32 SearchPatternList(std::u16string_view rPatternName); + +public: + SvxPatternTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxPatternTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + virtual void PointChanged( weld::DrawingArea*, RectPoint eRP ) override; + + void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; } + void SetPatternList( XPatternListRef const & pPatternList) { m_pPatternList = pPatternList; } + void SetPtrnChgd( ChangeType* pIn ) { m_pnPatternListState = pIn; } + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } + void ChangeColor_Impl(); +}; + +/************************************************************************/ + +enum class ColorModel +{ + RGB, + CMYK +}; + +class SvxColorTabPage : public SfxTabPage +{ +private: + const SfxItemSet& rOutAttrs; + + XColorListRef pColorList; + + ChangeType* pnColorListState; + + XFillAttrSetItem aXFillAttr; + SfxItemSet& rXFSet; + + ColorModel eCM; + + Color m_aPreviousColor; + NamedColor m_aCurrentColor; + + PaletteManager maPaletteManager; + SvxXRectPreview m_aCtlPreviewOld; + SvxXRectPreview m_aCtlPreviewNew; + std::unique_ptr<SvxColorValueSet> m_xValSetColorList; + std::unique_ptr<SvxColorValueSet> m_xValSetRecentList; + std::unique_ptr<weld::ComboBox> m_xSelectPalette; + std::unique_ptr<weld::RadioButton> m_xRbRGB; + std::unique_ptr<weld::RadioButton> m_xRbCMYK; + std::unique_ptr<weld::Widget> m_xRGBcustom; + std::unique_ptr<weld::Widget> m_xRGBpreset; + std::unique_ptr<weld::Entry> m_xRpreset; + std::unique_ptr<weld::Entry> m_xGpreset; + std::unique_ptr<weld::Entry> m_xBpreset; + std::unique_ptr<weld::SpinButton> m_xRcustom; + std::unique_ptr<weld::SpinButton> m_xGcustom; + std::unique_ptr<weld::SpinButton> m_xBcustom; + std::unique_ptr<weld::HexColorControl> m_xHexpreset; + std::unique_ptr<weld::HexColorControl> m_xHexcustom; + std::unique_ptr<weld::Widget> m_xCMYKcustom; + std::unique_ptr<weld::Widget> m_xCMYKpreset; + std::unique_ptr<weld::Entry> m_xCpreset; + std::unique_ptr<weld::Entry> m_xYpreset; + std::unique_ptr<weld::Entry> m_xMpreset; + std::unique_ptr<weld::Entry> m_xKpreset; + std::unique_ptr<weld::MetricSpinButton> m_xCcustom; + std::unique_ptr<weld::MetricSpinButton> m_xYcustom; + std::unique_ptr<weld::MetricSpinButton> m_xMcustom; + std::unique_ptr<weld::MetricSpinButton> m_xKcustom; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnDelete; + std::unique_ptr<weld::Button> m_xBtnWorkOn; + std::unique_ptr<weld::Button> m_xMoreColors; + std::unique_ptr<weld::CustomWeld> m_xCtlPreviewOld; + std::unique_ptr<weld::CustomWeld> m_xCtlPreviewNew; + std::unique_ptr<weld::CustomWeld> m_xValSetColorListWin; + std::unique_ptr<weld::CustomWeld> m_xValSetRecentListWin; + + static void ConvertColorValues (Color& rColor, ColorModel eModell); + static void RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK ); + static void CmykToRgb_Impl( Color& rColor, const sal_uInt16 nKey ); + sal_uInt16 ColorToPercent_Impl( sal_uInt16 nColor ); + sal_uInt16 PercentToColor_Impl( sal_uInt16 nPercent ); + + void ImpColorCountChanged(); + void FillPaletteLB(); + + DECL_LINK(ClickAddHdl_Impl, weld::Button&, void); + DECL_LINK(ClickWorkOnHdl_Impl, weld::Button&, void); + DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void); + DECL_STATIC_LINK(SvxColorTabPage, OnMoreColorsClick, weld::Button&, void); + + DECL_LINK(SelectPaletteLBHdl, weld::ComboBox&, void); + DECL_LINK( SelectValSetHdl_Impl, ValueSet*, void ); + DECL_LINK( SelectColorModeHdl_Impl, weld::Toggleable&, void ); + void ChangeColor(const NamedColor &rNewColor, bool bUpdatePreset = true); + void SetColorModel(ColorModel eModel); + void ChangeColorModel(); + void UpdateColorValues( bool bUpdatePreset = true ); + DECL_LINK(SpinValueHdl_Impl, weld::SpinButton&, void); + DECL_LINK(MetricSpinValueHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ModifiedHdl_Impl, weld::Entry&, void); + + void UpdateModified(); + + static sal_Int32 FindInCustomColors( std::u16string_view aColorName ); + sal_Int32 FindInPalette( const Color& rColor ); + +public: + SvxColorTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxColorTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef ); + void SetColorList( const XColorListRef& pColList ); + + + void SetColorChgd( ChangeType* pIn ) { pnColorListState = pIn; } + + virtual void FillUserData() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx new file mode 100644 index 0000000000..1122a2017f --- /dev/null +++ b/cui/source/inc/cuitabline.hxx @@ -0,0 +1,376 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> +#include <vector> +#include <editeng/brushitem.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/svdpage.hxx> +#include <svx/tabarea.hxx> +#include <svx/xlnasit.hxx> +#include <svx/xtable.hxx> +#include <svx/dlgctrl.hxx> +#include <vcl/customweld.hxx> + +enum class PageType; +class ColorListBox; + +class SvxLineTabDialog final : public SfxTabDialogController +{ + SdrModel* pDrawModel; + const SdrObject* pObj; + + XColorListRef pColorList; + XColorListRef mpNewColorList; + XDashListRef pDashList; + XDashListRef pNewDashList; + XLineEndListRef pLineEndList; + XLineEndListRef pNewLineEndList; + bool bObjSelected; + + ChangeType nLineEndListState; + ChangeType nDashListState; + ChangeType mnColorListState; + + PageType nPageType; + sal_Int32 nPosDashLb; + sal_Int32 nPosLineEndLb; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + + virtual short Ok() override; + DECL_LINK(CancelHdlImpl, weld::Button&, void); + void SavePalettes(); + +public: + SvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, + SdrModel* pModel, const SdrObject* pObj, + bool bHasObj); + + void SetNewDashList( XDashListRef const & pInLst) + { pNewDashList = pInLst; } + const XDashListRef& GetNewDashList() const { return pNewDashList; } + + void SetNewLineEndList( XLineEndListRef const & pInLst) + { pNewLineEndList = pInLst; } + const XLineEndListRef& GetNewLineEndList() const { return pNewLineEndList; } + + void SetNewColorList( XColorListRef const & pColTab ) { mpNewColorList = pColTab; } + const XColorListRef& GetNewColorList() const { return mpNewColorList; } +}; + +/*************************************************************************/ + +struct SvxBmpItemInfo +{ + std::unique_ptr<SvxBrushItem> pBrushItem; + OUString sItemId; +}; + +class SvxLineTabPage : public SfxTabPage +{ + static const WhichRangesContainer pLineRanges; +private: + //#58425# symbols on a line (e. g. StarChart) -> + /** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview. + The list position is to be used cyclic. */ + SdrObjList* m_pSymbolList; + bool m_bNewSize; + /// a graphic to be displayed in the preview in case that an automatic symbol is chosen + Graphic m_aAutoSymbolGraphic; + sal_Int32 m_nSymbolType; + /// attributes for the shown symbols; only necessary if not equal to line properties + std::unique_ptr<SfxItemSet> m_xSymbolAttr; + + std::vector<OUString> m_aGrfNames; + std::vector< std::unique_ptr<SvxBmpItemInfo> > + m_aGalleryBrushItems; + std::vector< std::unique_ptr<SvxBmpItemInfo> > + m_aSymbolBrushItems; + bool m_bLastWidthModified; + Size m_aSymbolLastSize; + Graphic m_aSymbolGraphic; + Size m_aSymbolSize; + bool m_bSymbols; + + const SfxItemSet& m_rOutAttrs; + bool m_bObjSelected; + + XLineAttrSetItem m_aXLineAttr; + SfxItemSet& m_rXLSet; + + XDashListRef m_pDashList; + XLineEndListRef m_pLineEndList; + + ChangeType* m_pnLineEndListState; + ChangeType* m_pnDashListState; + ChangeType* m_pnColorListState; + PageType m_nPageType; + sal_uInt16 m_nDlgType; + sal_Int32* m_pPosDashLb; + sal_Int32* m_pPosLineEndLb; + + MapUnit m_ePoolUnit; + + sal_Int32 m_nActLineWidth; + + SvxXLinePreview m_aCtlPreview; + std::unique_ptr<weld::Widget> m_xBoxColor; + std::unique_ptr<SvxLineLB> m_xLbLineStyle; + std::unique_ptr<ColorListBox> m_xLbColor; + std::unique_ptr<weld::Widget> m_xBoxWidth; + std::unique_ptr<weld::MetricSpinButton> m_xMtrLineWidth; + std::unique_ptr<weld::Widget> m_xBoxTransparency; + std::unique_ptr<weld::MetricSpinButton> m_xMtrTransparent; + std::unique_ptr<weld::Widget> m_xFlLineEnds; + std::unique_ptr<weld::Widget> m_xBoxArrowStyles; + std::unique_ptr<SvxLineEndLB> m_xLbStartStyle; + std::unique_ptr<weld::Widget> m_xBoxStart; + std::unique_ptr<weld::MetricSpinButton> m_xMtrStartWidth; + std::unique_ptr<weld::CheckButton> m_xTsbCenterStart; + std::unique_ptr<weld::Widget> m_xBoxEnd; + std::unique_ptr<SvxLineEndLB> m_xLbEndStyle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrEndWidth; + std::unique_ptr<weld::CheckButton> m_xTsbCenterEnd; + std::unique_ptr<weld::CheckButton> m_xCbxSynchronize; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + std::unique_ptr<weld::Widget> m_xFLEdgeStyle; + std::unique_ptr<weld::Widget> m_xGridEdgeCaps; + std::unique_ptr<weld::ComboBox> m_xLBEdgeStyle; + + // LineCaps + std::unique_ptr<weld::ComboBox> m_xLBCapStyle; + + std::unique_ptr<weld::Widget> m_xFlSymbol; + std::unique_ptr<weld::Widget> m_xGridIconSize; + std::unique_ptr<weld::MenuButton> m_xSymbolMB; + std::unique_ptr<weld::Menu> m_xSymbolsMenu; + std::unique_ptr<weld::Menu> m_xGalleryMenu; + std::unique_ptr<weld::MetricSpinButton> m_xSymbolWidthMF; + std::unique_ptr<weld::MetricSpinButton> m_xSymbolHeightMF; + std::unique_ptr<weld::CheckButton> m_xSymbolRatioCB; + + // handler for gallery popup menu button + size + DECL_LINK(GraphicHdl_Impl, const OUString&, void); + DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(MenuCreateHdl_Impl, weld::Toggleable&, void); + DECL_LINK(RatioHdl_Impl, weld::Toggleable&, void); + + DECL_LINK(ClickInvisibleHdl_Impl, weld::ComboBox&, void); + void ClickInvisibleHdl_Impl(); + DECL_LINK(ChangeStartClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ChangeStartListBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ChangeStartModifyHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeEndListBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ChangeEndModifyHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeEndClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ChangePreviewListBoxHdl_Impl, ColorListBox&, void); + DECL_LINK(ChangePreviewModifyHdl_Impl, weld::MetricSpinButton&, void); + void ChangePreviewHdl_Impl(const weld::MetricSpinButton*); + DECL_LINK(ChangeTransparentHdl_Impl, weld::MetricSpinButton&, void); + + DECL_LINK(ChangeEdgeStyleHdl_Impl, weld::ComboBox&, void); + + // LineCaps + DECL_LINK(ChangeCapStyleHdl_Impl, weld::ComboBox&, void); + + void FillXLSet_Impl(); + + void FillListboxes(); +public: + + void ShowSymbolControls(bool bOn); + + SvxLineTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxLineTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pLineRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet* ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + virtual void FillUserData() override; + + void SetDashList( XDashListRef const & pDshLst ) { m_pDashList = pDshLst; } + void SetLineEndList( XLineEndListRef const & pLneEndLst) { m_pLineEndList = pLneEndLst; } + void SetObjSelected( bool bHasObj ) { m_bObjSelected = bHasObj; } + + void SetPageType( PageType nInType ) { m_nPageType = nInType; } + void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; } + void SetPosDashLb( sal_Int32* pInPos ) { m_pPosDashLb = pInPos; } + void SetPosLineEndLb( sal_Int32* pInPos ) { m_pPosLineEndLb = pInPos; } + + void SetLineEndChgd( ChangeType* pIn ) { m_pnLineEndListState = pIn; } + void SetDashChgd( ChangeType* pIn ) { m_pnDashListState = pIn; } + void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } + + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/*************************************************************************/ + +class SvxLineDefTabPage : public SfxTabPage +{ +private: + const SfxItemSet& rOutAttrs; + XDash aDash; + + XLineAttrSetItem aXLineAttr; + SfxItemSet& rXLSet; + + XDashListRef pDashList; + + ChangeType* pnDashListState; + PageType* pPageType; + sal_uInt16 nDlgType; + sal_Int32* pPosDashLb; + + MapUnit ePoolUnit; + FieldUnit eFUnit; + + SvxXLinePreview m_aCtlPreview; + std::unique_ptr<SvxLineLB> m_xLbLineStyles; + std::unique_ptr<weld::ComboBox> m_xLbType1; + std::unique_ptr<weld::ComboBox> m_xLbType2; + std::unique_ptr<weld::SpinButton> m_xNumFldNumber1; + std::unique_ptr<weld::SpinButton> m_xNumFldNumber2; + std::unique_ptr<weld::MetricSpinButton> m_xMtrLength1; + std::unique_ptr<weld::MetricSpinButton> m_xMtrLength2; + std::unique_ptr<weld::MetricSpinButton> m_xMtrDistance; + std::unique_ptr<weld::CheckButton> m_xCbxSynchronize; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::Button> m_xBtnDelete; + std::unique_ptr<weld::Button> m_xBtnLoad; + std::unique_ptr<weld::Button> m_xBtnSave; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + void FillDash_Impl(); + void FillDialog_Impl(); + + DECL_LINK(ClickAddHdl_Impl, weld::Button&, void); + DECL_LINK(ClickModifyHdl_Impl, weld::Button&, void); + DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void); + DECL_LINK(SelectLinestyleListBoxHdl_Impl, weld::ComboBox&, void); + void SelectLinestyleHdl_Impl(const weld::ComboBox*); + DECL_LINK(ChangePreviewHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeNumber1Hdl_Impl, weld::SpinButton&, void); + DECL_LINK(ChangeNumber2Hdl_Impl, weld::SpinButton&, void); + DECL_LINK(ClickLoadHdl_Impl, weld::Button&, void); + DECL_LINK(ClickSaveHdl_Impl, weld::Button&, void); + DECL_LINK(ChangeMetricHdl_Impl, weld::Toggleable&, void); + DECL_LINK(SelectTypeListBoxHdl_Impl, weld::ComboBox&, void); + void SelectTypeHdl_Impl(const weld::ComboBox*); + void ChangeMetricHdl_Impl(const weld::Toggleable*); + + void CheckChanges_Impl(); + +public: + SvxLineDefTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxLineDefTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetDashList( XDashListRef const & pDshLst ) { pDashList = pDshLst; } + + void SetPageType( PageType* pInType ) { pPageType = pInType; } + void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; } + void SetPosDashLb( sal_Int32* pInPos ) { pPosDashLb = pInPos; } + + void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; } +}; + +/*************************************************************************/ + +class SvxLineEndDefTabPage : public SfxTabPage +{ +private: + const SfxItemSet& rOutAttrs; + const SdrObject* pPolyObj; + + XLineAttrSetItem aXLineAttr; + SfxItemSet& rXLSet; + + XLineEndListRef pLineEndList; + + ChangeType* pnLineEndListState; + PageType* pPageType; + sal_uInt16 nDlgType; + sal_Int32* pPosLineEndLb; + + SvxXLinePreview m_aCtlPreview; + std::unique_ptr<weld::Entry> m_xEdtName; + std::unique_ptr<SvxLineEndLB> m_xLbLineEnds; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnModify; + std::unique_ptr<weld::Button> m_xBtnDelete; + std::unique_ptr<weld::Button> m_xBtnLoad; + std::unique_ptr<weld::Button> m_xBtnSave; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + DECL_LINK(ClickAddHdl_Impl, weld::Button&, void); + DECL_LINK(ClickModifyHdl_Impl, weld::Button&, void); + DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void); + DECL_LINK(ClickLoadHdl_Impl, weld::Button&, void); + DECL_LINK(ClickSaveHdl_Impl, weld::Button&, void); + DECL_LINK(SelectLineEndHdl_Impl, weld::ComboBox&, void); + + void SelectLineEndHdl_Impl(); + void CheckChanges_Impl(); + +public: + SvxLineEndDefTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxLineEndDefTabPage() override; + + void Construct(); + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void SetLineEndList( XLineEndListRef const & pInList ) { pLineEndList = pInList; } + void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; } + + void SetPageType( PageType* pInType ) { pPageType = pInType; } + void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; } + void SetPosLineEndLb( sal_Int32* pInPos ) { pPosLineEndLb = pInPos; } + + void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cuitbxform.hxx b/cui/source/inc/cuitbxform.hxx new file mode 100644 index 0000000000..f5546f1cdb --- /dev/null +++ b/cui/source/inc/cuitbxform.hxx @@ -0,0 +1,35 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> + +class FmInputRecordNoDialog : public weld::GenericDialogController +{ + std::unique_ptr<weld::SpinButton> m_xRecordNo; + +public: + FmInputRecordNoDialog(weld::Window* pParent); + virtual ~FmInputRecordNoDialog() override; + + void SetValue(int dNew) { m_xRecordNo->set_value(dNew); } + int GetValue() const { return m_xRecordNo->get_value(); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx new file mode 100644 index 0000000000..3b26e5190c --- /dev/null +++ b/cui/source/inc/dbregister.hxx @@ -0,0 +1,112 @@ +/* -*- 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 . + */ + +#pragma once + +#include <rtl/ustring.hxx> +#include <tools/solar.h> +#include <sfx2/basedlgs.hxx> +#include <sfx2/tabdlg.hxx> + +namespace svx +{ + + class DbRegistrationOptionsPage : public SfxTabPage + { + private: + size_t m_nOldCount; + bool m_bModified; + + std::unique_ptr<weld::Button> m_xNew; + std::unique_ptr<weld::Button> m_xEdit; + std::unique_ptr<weld::Button> m_xDelete; + std::unique_ptr<weld::TreeView> m_xPathBox; + std::unique_ptr<weld::TreeIter> m_xIter; + + DECL_LINK( NewHdl, weld::Button&, void ); + DECL_LINK( EditHdl, weld::Button&, void ); + DECL_LINK( DeleteHdl, weld::Button&, void ); + DECL_LINK( PathBoxDoubleClickHdl, weld::TreeView&, bool); + + DECL_LINK( PathSelect_Impl, weld::TreeView&, void); + + DECL_LINK( HeaderSelect_Impl, int, void ); + DECL_LINK( NameValidator, const OUString&, bool); + + /** inserts a new entry in the tablistbox + @param _sName + The name of the entry. + @param _sLocation + The location of the file. + */ + void insertNewEntry( const OUString& _sName,const OUString& _sLocation, const bool bReadOnly ); + + /** opens the LinkDialog to create a register pair + @param sOldName + The old name of the entry may be empty. + @param sOldLocation + The old location of the entry may be empty. + @param nEntry + The entry to remove if the entry will be changed + */ + void openLinkDialog(const OUString& sOldName, const OUString& sOldLocation, int nEntry = -1); + + public: + DbRegistrationOptionsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~DbRegistrationOptionsPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void FillUserData() override; + }; + + /** helper for DatabaseRegistrationDialog + + Necessary so that DatabaseRegistrationDialog is self-contained, i.e. always reflects + the current registration state. + */ + class RegistrationItemSetHolder + { + private: + SfxItemSet m_aRegistrationItems; + + protected: + RegistrationItemSetHolder( SfxItemSet _aMasterSet ); + ~RegistrationItemSetHolder(); + + protected: + const SfxItemSet& getRegistrationItems() const { return m_aRegistrationItems; } + }; + + class DatabaseRegistrationDialog :public RegistrationItemSetHolder + ,public SfxSingleTabDialogController + { + public: + DatabaseRegistrationDialog(weld::Window* pParent, const SfxItemSet& rAttr); + + virtual short run() override; + }; +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/defdlgname.hxx b/cui/source/inc/defdlgname.hxx new file mode 100644 index 0000000000..1927e0a7f3 --- /dev/null +++ b/cui/source/inc/defdlgname.hxx @@ -0,0 +1,27 @@ +/* -*- 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 . + */ +#pragma once + + +// const ----------------------------------------------------------------- + +const short RET_BTN_1 = 100; +const short RET_BTN_2 = 101; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/dialmgr.hxx b/cui/source/inc/dialmgr.hxx new file mode 100644 index 0000000000..a26c0b25d3 --- /dev/null +++ b/cui/source/inc/dialmgr.hxx @@ -0,0 +1,27 @@ +/* -*- 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 . + */ + +#pragma once + +#include <rtl/ustring.hxx> +#include <unotools/resmgr.hxx> + +OUString CuiResId(TranslateId aKey); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/fileextcheckdlg.hxx b/cui/source/inc/fileextcheckdlg.hxx new file mode 100644 index 0000000000..968deae771 --- /dev/null +++ b/cui/source/inc/fileextcheckdlg.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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 . + */ +#pragma once + +#include <sal/config.h> + +#include <vcl/weld.hxx> + +class FileExtCheckDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Label> m_pText; + std::unique_ptr<weld::CheckButton> m_pPerformCheck; + std::unique_ptr<weld::Button> m_pOk; + + DECL_LINK(OnOkClick, weld::Button&, void); + +public: + FileExtCheckDialog(weld::Window* pWindow, const OUString& sTitle, const OUString& sMsg); + virtual ~FileExtCheckDialog() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx new file mode 100644 index 0000000000..673062b759 --- /dev/null +++ b/cui/source/inc/grfpage.hxx @@ -0,0 +1,110 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/customweld.hxx> +#include <vcl/graph.hxx> +#include <sfx2/tabdlg.hxx> + +class SvxCropExample : public weld::CustomWidgetController +{ + MapMode m_aMapMode; + Size m_aFrameSize; + Point m_aTopLeft, m_aBottomRight; + Graphic m_aGrf; + +public: + SvxCropExample(); + + virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override; + virtual void Resize() override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + + void SetTop( tools::Long nVal ) { m_aTopLeft.setX(nVal); } + void SetBottom( tools::Long nVal ) { m_aBottomRight.setX(nVal); } + void SetLeft( tools::Long nVal ) { m_aTopLeft.setY(nVal); } + void SetRight( tools::Long nVal) { m_aBottomRight.setY(nVal); } + void SetFrameSize( const Size& rSz ); + void SetGraphic( const Graphic& rGrf ) { m_aGrf = rGrf; } +}; + +class SvxGrfCropPage : public SfxTabPage +{ + friend class VclPtr<SvxGrfCropPage>; + + OUString m_aGraphicName; + Size m_aOrigSize; + Size m_aOrigPixelSize; + Size m_aPageSize; + tools::Long m_nOldWidth; + tools::Long m_nOldHeight; + bool m_bSetOrigSize; + sal_Int32 m_aPreferredDPI; + + SvxCropExample m_aExampleWN; + + std::unique_ptr<weld::Widget> m_xCropFrame; + std::unique_ptr<weld::RadioButton> m_xZoomConstRB; + std::unique_ptr<weld::RadioButton> m_xSizeConstRB; + std::unique_ptr<weld::MetricSpinButton> m_xLeftMF; + std::unique_ptr<weld::MetricSpinButton> m_xRightMF; + std::unique_ptr<weld::MetricSpinButton> m_xTopMF; + std::unique_ptr<weld::MetricSpinButton> m_xBottomMF; + + std::unique_ptr<weld::Widget> m_xScaleFrame; + std::unique_ptr<weld::MetricSpinButton> m_xWidthZoomMF; + std::unique_ptr<weld::MetricSpinButton> m_xHeightZoomMF; + + std::unique_ptr<weld::Widget> m_xSizeFrame; + std::unique_ptr<weld::MetricSpinButton> m_xWidthMF; + std::unique_ptr<weld::MetricSpinButton> m_xHeightMF; + + std::unique_ptr<weld::Widget> m_xOrigSizeGrid; + std::unique_ptr<weld::Label> m_xOrigSizeFT; + std::unique_ptr<weld::Button> m_xOrigSizePB; + + std::unique_ptr<weld::Button> m_xUncropPB; + + // Example + std::unique_ptr<weld::CustomWeld> m_xExampleWN; + + DECL_LINK(ZoomHdl, weld::MetricSpinButton&, void); + DECL_LINK(SizeHdl, weld::MetricSpinButton&, void); + DECL_LINK(CropModifyHdl, weld::MetricSpinButton&, void); + DECL_LINK(OrigSizeHdl, weld::Button&, void); + DECL_LINK(UncropHdl, weld::Button&, void); + + void CalcZoom(); + void CalcMinMaxBorder(); + void GraphicHasChanged(bool bFound); + virtual void ActivatePage(const SfxItemSet& rSet) override; + + Size GetGrfOrigSize(const Graphic& rGraphic); +public: + SvxGrfCropPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet ); + virtual ~SvxGrfCropPage() override; + + virtual bool FillItemSet( SfxItemSet *rSet ) override; + virtual void Reset( const SfxItemSet *rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet *pSet ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx new file mode 100644 index 0000000000..57c3284d61 --- /dev/null +++ b/cui/source/inc/hangulhanjadlg.hxx @@ -0,0 +1,301 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/customweld.hxx> +#include <vcl/event.hxx> +#include <vcl/weld.hxx> +#include <editeng/hangulhanja.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/linguistic2/XConversionDictionaryList.hpp> +#include <svtools/valueset.hxx> + +#include <vector> +#include <memory> + +namespace svx +{ + + class SuggestionSet : public ValueSet + { + public: + SuggestionSet(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow); + + virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; + }; + + class SuggestionDisplay + { + public: + SuggestionDisplay(weld::Builder& rBuilder); + + void DisplayListBox( bool bDisplayListBox ); + + void SetSelectHdl( const Link<SuggestionDisplay&,void>& rLink ); + + void Clear(); + void InsertEntry( const OUString& rStr ); + void SelectEntryPos( sal_uInt16 nPos ); + + sal_uInt16 GetEntryCount() const; + + OUString GetEntry( sal_uInt16 nPos ) const; + OUString GetSelectedEntry() const; + + DECL_LINK( SelectSuggestionListBoxHdl, weld::TreeView&, void ); + DECL_LINK( SelectSuggestionValueSetHdl, ValueSet*, void ); + void SelectSuggestionHdl(bool bListBox); + + void SetHelpIds(); + + void set_size_request(int nWidth, int nHeight) + { + m_xValueSetWin->set_size_request(nWidth, nHeight); + m_xListBox->set_size_request(nWidth, nHeight); + } + + private: + void implUpdateDisplay(); + weld::Widget& implGetCurrentControl(); + + private: + bool m_bDisplayListBox; //otherwise ValueSet + bool m_bInSelectionUpdate; + Link<SuggestionDisplay&,void> m_aSelectLink; + + std::unique_ptr<SuggestionSet> m_xValueSet; + std::unique_ptr<weld::CustomWeld> m_xValueSetWin; + std::unique_ptr<weld::TreeView> m_xListBox; + }; + + class RubyRadioButton; + + class HangulHanjaConversionDialog : public weld::GenericDialogController + { + private: + /** are we working for a document? This is normally true, but in case + the user uses the "find" functionality, we switch to working + with what the user entered, which then does not have any relation to + the document anymore. Some functionality must be disabled then */ + bool m_bDocumentMode; + + Link<LinkParamNone*,void> m_aOptionsChangedLink; + Link<weld::Toggleable&,void> m_aClickByCharacterLink; + + std::unique_ptr<weld::Button> m_xFind; + std::unique_ptr<weld::Button> m_xIgnore; + std::unique_ptr<weld::Button> m_xIgnoreAll; + std::unique_ptr<weld::Button> m_xReplace; + std::unique_ptr<weld::Button> m_xReplaceAll; + std::unique_ptr<weld::Button> m_xOptions; + std::unique_ptr<SuggestionDisplay> m_xSuggestions; + std::unique_ptr<weld::RadioButton> m_xSimpleConversion; + std::unique_ptr<weld::RadioButton> m_xHangulBracketed; + std::unique_ptr<weld::RadioButton> m_xHanjaBracketed; + std::unique_ptr<weld::Entry> m_xWordInput; + std::unique_ptr<weld::Label> m_xOriginalWord; + std::unique_ptr<RubyRadioButton> m_xHanjaAbove; + std::unique_ptr<RubyRadioButton> m_xHanjaBelow; + std::unique_ptr<RubyRadioButton> m_xHangulAbove; + std::unique_ptr<RubyRadioButton> m_xHangulBelow; + std::unique_ptr<weld::CheckButton> m_xHangulOnly; + std::unique_ptr<weld::CheckButton> m_xHanjaOnly; + std::unique_ptr<weld::CheckButton> m_xReplaceByChar; + public: + HangulHanjaConversionDialog(weld::Widget* pParent); + virtual ~HangulHanjaConversionDialog() override; + + public: + void SetOptionsChangedHdl( const Link<LinkParamNone*,void>& _rHdl ); + void SetIgnoreHdl( const Link<weld::Button&,void>& _rHdl ); + void SetIgnoreAllHdl( const Link<weld::Button&,void>& _rHdl ); + void SetChangeHdl( const Link<weld::Button&,void>& _rHdl ); + void SetChangeAllHdl( const Link<weld::Button&,void>& _rHdl ); + + void SetClickByCharacterHdl( const Link<weld::Toggleable&,void>& _rHdl ); + void SetConversionFormatChangedHdl( const Link<weld::Toggleable&,void>& _rHdl ); + void SetFindHdl( const Link<weld::Button&,void>& _rHdl ); + + OUString GetCurrentString( ) const; + void SetCurrentString( + const OUString& _rNewString, + const css::uno::Sequence< OUString >& _rSuggestions, + bool _bOriginatesFromDocument + ); + + void FocusSuggestion( ); + + /// retrieves the current suggestion + OUString GetCurrentSuggestion( ) const; + + void SetConversionFormat( editeng::HangulHanjaConversion::ConversionFormat _eType ); + editeng::HangulHanjaConversion::ConversionFormat GetConversionFormat( ) const; + + void SetByCharacter( bool _bByCharacter ); + void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ); + + /// should text which does not match the primary conversion direction be ignored? + bool GetUseBothDirections( ) const; + + /** get current conversion direction to use + (return argument if GetUseBothDirections is true) */ + editeng::HangulHanjaConversion::ConversionDirection GetDirection( editeng::HangulHanjaConversion::ConversionDirection eDefaultDirection ) const; + + /// enables or disables the checkboxes for ruby formatted replacements + void EnableRubySupport( bool bVal ); + + private: + DECL_LINK( OnOption, weld::Button&, void ); + DECL_LINK( OnSuggestionModified, weld::Entry&, void ); + DECL_LINK( OnSuggestionSelected, SuggestionDisplay&, void ); + DECL_LINK( OnConversionDirectionClicked, weld::Toggleable&, void ); + DECL_LINK( ClickByCharacterHdl, weld::Toggleable&, void ); + + /// fill the suggestion list box with suggestions for the actual input + void FillSuggestions( const css::uno::Sequence< OUString >& _rSuggestions ); + }; + + + typedef std::vector< css::uno::Reference< css::linguistic2::XConversionDictionary > > HHDictList; + + class HangulHanjaOptionsDialog : public weld::GenericDialogController + { + private: + HHDictList m_aDictList; + css::uno::Reference< css::linguistic2::XConversionDictionaryList > m_xConversionDictionaryList; + + std::unique_ptr<weld::TreeView> m_xDictsLB; + std::unique_ptr<weld::CheckButton> m_xIgnorepostCB; + std::unique_ptr<weld::CheckButton> m_xShowrecentlyfirstCB; + std::unique_ptr<weld::CheckButton> m_xAutoreplaceuniqueCB; + std::unique_ptr<weld::Button> m_xNewPB; + std::unique_ptr<weld::Button> m_xEditPB; + std::unique_ptr<weld::Button> m_xDeletePB; + std::unique_ptr<weld::Button> m_xOkPB; + + DECL_LINK( OkHdl, weld::Button&, void ); + DECL_LINK( DictsLB_SelectHdl, weld::TreeView&, void ); + DECL_LINK( NewDictHdl, weld::Button&, void ); + DECL_LINK( EditDictHdl, weld::Button&, void ); + DECL_LINK( DeleteDictHdl, weld::Button&, void ); + + void Init(); ///< reads settings from core and init controls + public: + HangulHanjaOptionsDialog(weld::Window* pParent); + virtual ~HangulHanjaOptionsDialog() override; + + void AddDict( const OUString& _rName, bool _bChecked ); + }; + + class HangulHanjaNewDictDialog : public weld::GenericDialogController + { + private: + bool m_bEntered; + + std::unique_ptr<weld::Button> m_xOkBtn; + std::unique_ptr<weld::Entry> m_xDictNameED; + + DECL_LINK(OKHdl, weld::Button&, void); + DECL_LINK(ModifyHdl, weld::Entry&, void); + public: + HangulHanjaNewDictDialog(weld::Window* pParent); + virtual ~HangulHanjaNewDictDialog() override; + + bool GetName( OUString& _rRetName ) const; + }; + + class SuggestionList; + class HangulHanjaEditDictDialog; + + class SuggestionEdit + { + private: + HangulHanjaEditDictDialog* m_pParent; + SuggestionEdit* m_pPrev; + SuggestionEdit* m_pNext; + weld::ScrolledWindow* m_pScrollBar; + std::unique_ptr<weld::Entry> m_xEntry; + + bool ShouldScroll( bool _bUp ) const; + void DoJump( bool _bUp ); + public: + SuggestionEdit(std::unique_ptr<weld::Entry> xEntry, HangulHanjaEditDictDialog* pParent); + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); + void init(weld::ScrolledWindow* pScrollBar, SuggestionEdit* pPrev, SuggestionEdit* pNext); + + void grab_focus() { m_xEntry->grab_focus(); } + void set_text(const OUString& rText) { m_xEntry->set_text(rText); } + void connect_changed(const Link<weld::Entry&, void>& rLink) { m_xEntry->connect_changed(rLink); } + }; + + class HangulHanjaEditDictDialog : public weld::GenericDialogController + { + private: + const OUString m_aEditHintText; + HHDictList& m_rDictList; + sal_uInt32 m_nCurrentDict; + + OUString m_aOriginal; + std::unique_ptr<SuggestionList> m_xSuggestions; + + sal_uInt16 m_nTopPos; + bool m_bModifiedSuggestions; + bool m_bModifiedOriginal; + + std::unique_ptr<weld::ComboBox> m_xBookLB; + std::unique_ptr<weld::ComboBox> m_xOriginalLB; + std::unique_ptr<SuggestionEdit> m_xEdit1; + std::unique_ptr<SuggestionEdit> m_xEdit2; + std::unique_ptr<SuggestionEdit> m_xEdit3; + std::unique_ptr<SuggestionEdit> m_xEdit4; + std::unique_ptr<weld::Widget> m_xContents; + std::unique_ptr<weld::ScrolledWindow> m_xScrollSB; + std::unique_ptr<weld::Button> m_xNewPB; + std::unique_ptr<weld::Button> m_xDeletePB; + + DECL_LINK( OriginalModifyHdl, weld::ComboBox&, void ); + DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void ); + DECL_LINK( EditModifyHdl1, weld::Entry&, void ); + DECL_LINK( EditModifyHdl2, weld::Entry&, void ); + DECL_LINK( EditModifyHdl3, weld::Entry&, void ); + DECL_LINK( EditModifyHdl4, weld::Entry&, void ); + + DECL_LINK( BookLBSelectHdl, weld::ComboBox&, void ); + DECL_LINK( NewPBPushHdl, weld::Button&, void ); + DECL_LINK( DeletePBPushHdl, weld::Button&, void ); + + void InitEditDictDialog(sal_uInt32 nSelDict); + void UpdateOriginalLB(); + void UpdateSuggestions(); + void UpdateButtonStates(); + + void SetEditText( SuggestionEdit& rEdit, sal_uInt16 nEntryNum ); + void EditModify( const weld::Entry* pEdit, sal_uInt8 nEntryOffset ); + + bool DeleteEntryFromDictionary( const css::uno::Reference< css::linguistic2::XConversionDictionary >& xDict ); + + public: + HangulHanjaEditDictDialog(weld::Window* pParent, HHDictList& rDictList, sal_uInt32 nSelDict); + virtual ~HangulHanjaEditDictDialog() override; + + void UpdateScrollbar(); + }; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx new file mode 100644 index 0000000000..a87bb1460f --- /dev/null +++ b/cui/source/inc/headertablistbox.hxx @@ -0,0 +1,37 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/weld.hxx> + +class MacroEventListBox final +{ +private: + std::unique_ptr<weld::TreeView> m_xTreeView; + +public: + MacroEventListBox(std::unique_ptr<weld::TreeView> xTreeView); + void set_sensitive(bool bSensitive) { m_xTreeView->set_sensitive(bSensitive); } + void show() { m_xTreeView->show(); } + + weld::TreeView& GetListBox() { return *m_xTreeView; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/helpids.h b/cui/source/inc/helpids.h new file mode 100644 index 0000000000..8f9af7fd95 --- /dev/null +++ b/cui/source/inc/helpids.h @@ -0,0 +1,52 @@ +/* -*- 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 . + */ +#pragma once + +#include <rtl/ustring.hxx> + +inline constexpr OUString HID_OPTIONS_COLORCONFIG_SAVE_SCHEME + = u"CUI_HID_OPTIONS_COLORCONFIG_SAVE_SCHEME"_ustr; +inline constexpr OUString HID_OFA_FONT_SUBST_CLB = u"CUI_HID_OFA_FONT_SUBST_CLB"_ustr; +inline constexpr OUString HID_DBPATH_CTL_PATH = u"CUI_HID_DBPATH_CTL_PATH"_ustr; +#define HID_DBPATH_HEADERBAR "CUI_HID_DBPATH_HEADERBAR" +inline constexpr OUString HID_OFADLG_TREELISTBOX = u"CUI_HID_OFADLG_TREELISTBOX"_ustr; +inline constexpr OUString HID_SVX_CONFIG_TOOLBAR = u"CUI_HID_SVX_CONFIG_TOOLBAR"_ustr; +inline constexpr OUString HID_SVX_CONFIG_TOOLBAR_CONTENTS + = u"CUI_HID_SVX_CONFIG_TOOLBAR_CONTENTS"_ustr; +inline constexpr OUString HID_SVX_CONFIG_NOTEBOOKBAR_CONTENTS + = u"CUI_HID_SVX_CONFIG_NOTEBOOKBAR_CONTENTS"_ustr; +inline constexpr OUString HID_HANGULDLG_SUGGESTIONS_GRID + = u"CUI_HID_HANGULDLG_SUGGESTIONS_GRID"_ustr; +inline constexpr OUString HID_HANGULDLG_SUGGESTIONS_LIST + = u"CUI_HID_HANGULDLG_SUGGESTIONS_LIST"_ustr; +inline constexpr OUString HID_SVX_CONFIG_NAME_SUBMENU = u"CUI_HID_SVX_CONFIG_NAME_SUBMENU"_ustr; +inline constexpr OUString HID_SVX_CONFIG_RENAME_MENU = u"CUI_HID_SVX_CONFIG_RENAME_MENU"_ustr; +inline constexpr OUString HID_SVX_CONFIG_RENAME_MENU_ITEM + = u"CUI_HID_SVX_CONFIG_RENAME_MENU_ITEM"_ustr; +inline constexpr OUString HID_SVX_CONFIG_RENAME_TOOLBAR = u"CUI_HID_SVX_CONFIG_RENAME_TOOLBAR"_ustr; +inline constexpr OUString HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM + = u"CUI_HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM"_ustr; +inline constexpr OUString HID_SVX_UP_TOOLBAR_ITEM = u"CUI_HID_SVX_UP_TOOLBAR_ITEM"_ustr; +inline constexpr OUString HID_SVX_DOWN_TOOLBAR_ITEM = u"CUI_HID_SVX_DOWN_TOOLBAR_ITEM"_ustr; +inline constexpr OUString HID_SVX_SAVE_IN = u"CUI_HID_SVX_SAVE_IN"_ustr; +inline constexpr OUString HID_SVX_TOPLEVELLISTBOX = u"CUI_HID_SVX_TOPLEVELLISTBOX"_ustr; +inline constexpr OUString HID_SVX_DESCFIELD = u"CUI_HID_SVX_DESCFIELD"_ustr; +inline constexpr OUString HID_MACRO_HEADERTABLISTBOX = u"CUI_HID_MACRO_HEADERTABLISTBOX"_ustr; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx new file mode 100644 index 0000000000..68bce1650a --- /dev/null +++ b/cui/source/inc/hldocntp.hxx @@ -0,0 +1,60 @@ +/* -*- 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 . + */ +#pragma once + +#include "hltpbase.hxx" + +/************************************************************************* +|* +|* Tabpage : Hyperlink - New Document +|* +\************************************************************************/ +class SvxHyperlinkNewDocTp : public SvxHyperlinkTabPageBase +{ +private: + std::unique_ptr<weld::RadioButton> m_xRbtEditNow; + std::unique_ptr<weld::RadioButton> m_xRbtEditLater; + std::unique_ptr<SvxHyperURLBox> m_xCbbPath; + std::unique_ptr<weld::Button> m_xBtCreate; + std::unique_ptr<weld::TreeView> m_xLbDocTypes; + + bool ImplGetURLObject( const OUString& rPath, std::u16string_view rBase, INetURLObject& aURLObject ) const; + void FillDocumentList (); + + DECL_LINK (ClickNewHdl_Impl, weld::Button&, void ); + DECL_STATIC_LINK(SvxHyperlinkNewDocTp, DispatchDocument, void*, void); + +protected: + void FillDlgFields(const OUString& rStrURL) override; + void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ) override; + +public: + SvxHyperlinkNewDocTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + virtual ~SvxHyperlinkNewDocTp () override; + + static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + + virtual void DoApply () override; + + virtual void SetInitFocus() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx new file mode 100644 index 0000000000..61005a42d6 --- /dev/null +++ b/cui/source/inc/hldoctp.hxx @@ -0,0 +1,73 @@ +/* -*- 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 . + */ +#pragma once + +#include "hltpbase.hxx" + +/************************************************************************* +|* +|* Tabpage : Hyperlink - Document +|* +\************************************************************************/ +class SvxHyperlinkDocTp final : public SvxHyperlinkTabPageBase +{ +private: + std::unique_ptr<SvxHyperURLBox> m_xCbbPath; + std::unique_ptr<weld::Button> m_xBtFileopen; + std::unique_ptr<weld::Entry> m_xEdTarget; + std::unique_ptr<weld::Label> m_xFtFullURL; + std::unique_ptr<weld::Button> m_xBtBrowse; + + OUString maStrURL; + + bool m_bMarkWndOpen; + + DECL_LINK (ClickFileopenHdl_Impl, weld::Button&, void ); + DECL_LINK (ClickTargetHdl_Impl, weld::Button&, void ); + + DECL_LINK (ModifiedPathHdl_Impl, weld::ComboBox&, void ); ///< Contents of combobox "Path" modified + DECL_LINK (ModifiedTargetHdl_Impl, weld::Entry&, void ); ///< Contents of editfield "Target" modified + + DECL_LINK( LostFocusPathHdl_Impl, weld::Widget&, void ); ///< Combobox "path" lost its focus + + DECL_LINK( TimeoutHdl_Impl, Timer *, void ); ///< Handler for timer -timeout + + enum class EPathType { Invalid, ExistsFile }; + static EPathType GetPathType ( std::u16string_view rStrPath ); + + void FillDlgFields(const OUString& rStrURL) override; + void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ) override; + virtual bool ShouldOpenMarkWnd () override {return m_bMarkWndOpen;} + virtual void SetMarkWndShouldOpen (bool bOpen) override {m_bMarkWndOpen=bOpen;} + OUString GetCurrentURL() const; + +public: + SvxHyperlinkDocTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + virtual ~SvxHyperlinkDocTp() override; + + static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + + virtual void SetMarkStr ( const OUString& aStrMark ) override; + + virtual void SetInitFocus() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx new file mode 100644 index 0000000000..ad308a401f --- /dev/null +++ b/cui/source/inc/hlinettp.hxx @@ -0,0 +1,78 @@ +/* -*- 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 . + */ +#pragma once + +#include <sal/config.h> + +#include <string_view> + +#include "cuihyperdlg.hxx" +#include "hltpbase.hxx" + +/************************************************************************* +|* +|* Tabpage : Hyperlink - Internet +|* +\************************************************************************/ + +class SvxHyperlinkInternetTp : public SvxHyperlinkTabPageBase +{ +private: + bool m_bMarkWndOpen; + + std::unique_ptr<SvxHyperURLBox> m_xCbbTarget; + std::unique_ptr<weld::Label> m_xFtTarget; + + DECL_LINK( Click_SmartProtocol_Impl, weld::Toggleable&, void ); ///< Radiobutton toggled: Type HTTP or + DECL_LINK( LostFocusTargetHdl_Impl, weld::Widget&, void ); ///< Combobox "Target" lost its focus + DECL_LINK( ModifiedTargetHdl_Impl, weld::ComboBox&, void ); ///< Contents of editfield "Target" modified + + DECL_LINK( TimeoutHdl_Impl, Timer *, void); ///< Handler for timer -timeout + + + void SetScheme(std::u16string_view rScheme); + void RemoveImproperProtocol(std::u16string_view rProperScheme); + static OUString GetSchemeFromButtons(); + static INetProtocol GetSmartProtocolFromButtons(); + + OUString CreateAbsoluteURL() const; + + void RefreshMarkWindow(); + +protected: + virtual void FillDlgFields(const OUString& rStrURL) override; + virtual void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ) override; + virtual bool ShouldOpenMarkWnd () override { return false; } + virtual void SetMarkWndShouldOpen (bool bOpen) override {m_bMarkWndOpen=bOpen;} + +public: + SvxHyperlinkInternetTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + virtual ~SvxHyperlinkInternetTp() override; + + static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + + virtual void SetMarkStr ( const OUString& aStrMark ) override; + + virtual void SetInitFocus() override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx new file mode 100644 index 0000000000..b7c76c52cb --- /dev/null +++ b/cui/source/inc/hlmailtp.hxx @@ -0,0 +1,61 @@ +/* -*- 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 . + */ +#pragma once + +#include "hltpbase.hxx" + +/************************************************************************* +|* +|* Tabpage : Hyperlink - Mail +|* +\************************************************************************/ + +class SvxHyperlinkMailTp : public SvxHyperlinkTabPageBase +{ +private: + std::unique_ptr<SvxHyperURLBox> m_xCbbReceiver; + std::unique_ptr<weld::Button> m_xBtAdrBook; + std::unique_ptr<weld::Entry> m_xEdSubject; + + DECL_STATIC_LINK(SvxHyperlinkMailTp, ClickAdrBookHdl_Impl, weld::Button&, void); + ///< Button : Address book + DECL_LINK (ModifiedReceiverHdl_Impl, weld::ComboBox&, void ); ///< Combobox "receiver" modified + + void SetScheme(std::u16string_view rScheme); + void RemoveImproperProtocol(std::u16string_view aProperScheme); + + OUString CreateAbsoluteURL() const; + +protected: + virtual void FillDlgFields(const OUString& rStrURL) override; + virtual void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ) override; + +public: + SvxHyperlinkMailTp(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + virtual ~SvxHyperlinkMailTp() override; + + static std::unique_ptr<IconChoicePage> Create(weld::Container* pWindow, SvxHpLinkDlg* pDlg, const SfxItemSet* pItemSet); + + virtual void SetInitFocus() override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx new file mode 100644 index 0000000000..d88dddab20 --- /dev/null +++ b/cui/source/inc/hlmarkwn.hxx @@ -0,0 +1,67 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/container/XNameAccess.hpp> +#include <vcl/weld.hxx> + +class SvxHyperlinkTabPageBase; + +//# # +//# Window-Class # +//# # +class SvxHlinkDlgMarkWnd : public weld::GenericDialogController +{ +private: + SvxHyperlinkTabPageBase* mpParent; + + sal_uInt16 mnError; + + std::unique_ptr<weld::Button> mxBtApply; + std::unique_ptr<weld::Button> mxBtClose; + std::unique_ptr<weld::TreeView> mxLbTree; + std::unique_ptr<weld::Label> mxError; + + void ErrorChanged(); + +protected: + bool RefreshFromDoc( const OUString& aURL ); + void RestoreLastSelection(); + + std::unique_ptr<weld::TreeIter> FindEntry(std::u16string_view aStrName); + void ClearTree(); + int FillTree( const css::uno::Reference< css::container::XNameAccess >& xLinks, const weld::TreeIter* pParentEntry =nullptr ); + + DECL_LINK( ClickApplyHdl_Impl, weld::Button&, void ); + DECL_LINK( DoubleClickApplyHdl_Impl, weld::TreeView&, bool ); + DECL_LINK( ClickCloseHdl_Impl, weld::Button&, void ); + +public: + SvxHlinkDlgMarkWnd(weld::Window* pParentDialog, SvxHyperlinkTabPageBase *pParentPage); + virtual ~SvxHlinkDlgMarkWnd() override; + + void MoveTo(const Point& rNewPos); + void RefreshTree(const OUString& aStrURL); + bool SelectEntry(std::u16string_view aStrMark); + + sal_uInt16 SetError( sal_uInt16 nError); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hlmarkwn_def.hxx b/cui/source/inc/hlmarkwn_def.hxx new file mode 100644 index 0000000000..34cd741fec --- /dev/null +++ b/cui/source/inc/hlmarkwn_def.hxx @@ -0,0 +1,26 @@ +/* -*- 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 . + */ + +#pragma once + +#define LERR_NOERROR 0 +#define LERR_NOENTRIES 1 +#define LERR_DOCNOTOPEN 2 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx new file mode 100644 index 0000000000..acb84198ad --- /dev/null +++ b/cui/source/inc/hltpbase.hxx @@ -0,0 +1,134 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <vcl/transfer.hxx> +#include <sfx2/dispatch.hxx> +#include <svtools/inettbc.hxx> +#include <vcl/timer.hxx> +#include <vcl/locktoplevels.hxx> + +#include <com/sun/star/frame/XFrame.hpp> +#include <svx/hlnkitem.hxx> + +#include "hlmarkwn.hxx" +#include "iconcdlg.hxx" + +/// ComboBox-Control for URL's with History and Autocompletion +class SvxHyperURLBox : public SvtURLBox, public DropTargetHelper +{ +protected: + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; + +public: + SvxHyperURLBox(std::unique_ptr<weld::ComboBox> xWidget); +}; + +/// Tabpage : Basisclass +class SvxHyperlinkTabPageBase : public IconChoicePage +{ +private: + std::unique_ptr<weld::ComboBox> mxCbbFrame; + std::unique_ptr<weld::ComboBox> mxLbForm; + std::unique_ptr<weld::Entry> mxEdIndication; + std::unique_ptr<weld::Entry> mxEdText; + std::unique_ptr<weld::Button> mxBtScript; + std::unique_ptr<weld::Label> mxFormLabel; + std::unique_ptr<weld::Label> mxFrameLabel; + + bool mbIsCloseDisabled; + + css::uno::Reference< css::frame::XFrame > + mxDocumentFrame; + +protected: + SvxHpLinkDlg* mpDialog; + + bool mbStdControlsInit; + + OUString maStrInitURL; + + Timer maTimer; + + TopLevelWindowLocker maBusy; + + std::shared_ptr<SvxHlinkDlgMarkWnd> mxMarkWnd; + + void InitStdControls (); + void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem ); + virtual void FillDlgFields(const OUString& rStrURL) = 0; + virtual void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ) = 0; + + void GetDataFromCommonFields( OUString& aStrName, + OUString& aStrIntName, OUString& aStrFrame, + SvxLinkInsertMode& eMode ); + + DECL_LINK (ClickScriptHdl_Impl, weld::Button&, void ); ///< Button : Script + + static OUString GetSchemeFromURL( const OUString& rStrURL ); + + void DisableClose( bool _bDisable ); + +public: + SvxHyperlinkTabPageBase ( + weld::Container* pParent, + SvxHpLinkDlg* pDlg, + const OUString& rUIXMLDescription, + const OUString& rID, + const SfxItemSet* pItemSet + ); + virtual ~SvxHyperlinkTabPageBase () override; + + void SetDocumentFrame( + const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame ) + { + mxDocumentFrame = rxDocumentFrame; + } + + virtual void DoApply (); + virtual void SetInitFocus(); + virtual void SetMarkStr ( const OUString& aStrMark ); + virtual void Reset( const SfxItemSet& ) override; + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void ActivatePage( const SfxItemSet& rItemSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + bool IsMarkWndVisible() const { return static_cast<bool>(mxMarkWnd); } + void MoveToExtraWnd ( Point aNewPos ); + + virtual bool QueryClose() override; + +protected: + virtual bool ShouldOpenMarkWnd(); + virtual void SetMarkWndShouldOpen(bool bOpen); + + void ShowMarkWnd(); + void HideMarkWnd(); + + SfxDispatcher* GetDispatcher() const; + + HyperDialogEvent GetMacroEvents() const; + SvxMacroTableDtor* GetMacroTable(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx new file mode 100644 index 0000000000..0b304e9439 --- /dev/null +++ b/cui/source/inc/hyphen.hxx @@ -0,0 +1,85 @@ +/* -*- 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 . + */ +#pragma once + +#include <memory> + +#include <vcl/weld.hxx> +#include <sfx2/basedlgs.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/linguistic2/XHyphenator.hpp> +#include <com/sun/star/linguistic2/XPossibleHyphens.hpp> + +class SvxSpellWrapper; + +class SvxHyphenWordDialog : public SfxDialogController +{ + OUString m_aLabel; + SvxSpellWrapper *const m_pHyphWrapper; + css::uno::Reference< css::linguistic2::XHyphenator > m_xHyphenator; + css::uno::Reference< css::linguistic2::XPossibleHyphens > m_xPossHyph; + OUString m_aEditWord; // aEditWord and aWordEdit.GetText() differ only by the character for the current selected hyphenation position + OUString m_aActWord; // actual word to be hyphenated + LanguageType m_nActLanguage; // and its language + sal_Int16 m_nMaxHyphenationPos; // right most valid hyphenation pos + sal_Int32 m_nOldPos; + sal_Int32 m_nHyphenationPositionsOffset; + int m_nWordEditWidth; + bool m_bBusy; + + std::unique_ptr<weld::Entry> m_xWordEdit; + std::unique_ptr<weld::Button> m_xLeftBtn; + std::unique_ptr<weld::Button> m_xRightBtn; + std::unique_ptr<weld::Button> m_xOkBtn; + std::unique_ptr<weld::Button> m_xContBtn; + std::unique_ptr<weld::Button> m_xDelBtn; + std::unique_ptr<weld::Button> m_xHyphAll; + std::unique_ptr<weld::Button> m_xCloseBtn; + + void EnableLRBtn_Impl(); + OUString EraseUnusableHyphens_Impl(); + + void InitControls_Impl(); + void ContinueHyph_Impl( sal_Int32 nInsPos = -1 ); // continue by default + + void select_region(int nStart, int nEnd); + + DECL_LINK(Left_Impl, weld::Button&, void); + DECL_LINK(Right_Impl, weld::Button&, void); + DECL_LINK(CutHdl_Impl, weld::Button&, void); + DECL_LINK(ContinueHdl_Impl, weld::Button&, void); + DECL_LINK(DeleteHdl_Impl, weld::Button&, void); + DECL_LINK(HyphenateAllHdl_Impl, weld::Button&, void); + DECL_LINK(CancelHdl_Impl, weld::Button&, void); + DECL_LINK(GetFocusHdl_Impl, weld::Widget&, void); + DECL_LINK(CursorChangeHdl_Impl, weld::Entry&, void); + +public: + SvxHyphenWordDialog(OUString aWord, LanguageType nLang, + weld::Widget* pParent, + css::uno::Reference<css::linguistic2::XHyphenator> const &xHyphen, + SvxSpellWrapper* pWrapper); + virtual ~SvxHyphenWordDialog() override; + + void SetWindowTitle( LanguageType nLang ); + bool SelLeft(); + bool SelRight(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx new file mode 100644 index 0000000000..e31aaa74e0 --- /dev/null +++ b/cui/source/inc/iconcdlg.hxx @@ -0,0 +1,82 @@ +/* -*- 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 . + */ +#pragma once + +#include <rtl/ustring.hxx> +#include <sfx2/tabdlg.hxx> +#include <utility> + +// forward-declarations +struct IconChoicePageData; +class SvxHpLinkDlg; +class IconChoicePage; +class SfxItemPool; +class SfxItemSet; + +// Create-Function +typedef std::unique_ptr<IconChoicePage> (*CreatePage)(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pAttrSet); + +class IconChoicePage +{ +protected: + std::unique_ptr<weld::Builder> xBuilder; + std::unique_ptr<weld::Container> xContainer; + +private: + const SfxItemSet* pSet; + bool bHasExchangeSupport; + +protected: + + IconChoicePage(weld::Container* pParent, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet* pItemSet); + +public: + virtual ~IconChoicePage(); + + OUString GetHelpId() const { return xContainer->get_help_id(); } + + const SfxItemSet& GetItemSet() const { return *pSet; } + + virtual bool FillItemSet( SfxItemSet* ) = 0; + virtual void Reset( const SfxItemSet& ) = 0; + + bool HasExchangeSupport() const { return bHasExchangeSupport; } + void SetExchangeSupport() { bHasExchangeSupport = true; } + + virtual void ActivatePage( const SfxItemSet& ); + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ); + virtual bool QueryClose(); +}; + +/// Data-structure for pages in dialog +struct IconChoicePageData +{ + OUString sId; + std::unique_ptr<IconChoicePage> xPage; ///< the TabPage itself + bool bRefresh; ///< Flag: page has to be newly initialized + + // constructor + IconChoicePageData(OUString aId, std::unique_ptr<IconChoicePage> xInPage) + : sId(std::move(aId)) + , xPage(std::move(xInPage)) + , bRefresh(false) + {} +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx new file mode 100644 index 0000000000..61c7075070 --- /dev/null +++ b/cui/source/inc/insdlg.hxx @@ -0,0 +1,114 @@ +/* -*- 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 . + */ +#pragma once + +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <com/sun/star/embed/XStorage.hpp> + +#include <svtools/insdlg.hxx> +#include <vcl/weld.hxx> +#include <comphelper/embeddedobjectcontainer.hxx> + +class INetURLObject; + +class InsertObjectDialog_Impl : public weld::GenericDialogController +{ +protected: + css::uno::Reference < css::embed::XEmbeddedObject > m_xObj; + const css::uno::Reference < css::embed::XStorage > m_xStorage; + comphelper::EmbeddedObjectContainer aCnt; + + InsertObjectDialog_Impl(weld::Window * pParent, + const OUString& rUIXMLDescription, const OUString& rID, + css::uno::Reference < css::embed::XStorage > xStorage); +public: + const css::uno::Reference<css::embed::XEmbeddedObject>& GetObject() const { return m_xObj; } + virtual css::uno::Reference<css::io::XInputStream> GetIconIfIconified(OUString* pGraphicMediaType); + void SetHelpId(const OUString& rHelpId) { m_xDialog->set_help_id(rHelpId); } + virtual bool IsCreateNew() const; +}; + +class SvInsertOleDlg : public InsertObjectDialog_Impl +{ + const SvObjectServerList* m_pServers; + + css::uno::Sequence< sal_Int8 > m_aIconMetaFile; + OUString m_aIconMediaType; + + std::unique_ptr<weld::RadioButton> m_xRbNewObject; + std::unique_ptr<weld::RadioButton> m_xRbObjectFromfile; + std::unique_ptr<weld::Frame> m_xObjectTypeFrame; + std::unique_ptr<weld::TreeView> m_xLbObjecttype; + std::unique_ptr<weld::Frame> m_xFileFrame; + std::unique_ptr<weld::Entry> m_xEdFilepath; + std::unique_ptr<weld::Button> m_xBtnFilepath; + std::unique_ptr<weld::CheckButton> m_xCbFilelink; + std::unique_ptr<weld::CheckButton> m_xCbAsIcon; + + DECL_LINK(DoubleClickHdl, weld::TreeView&, bool); + DECL_LINK(BrowseHdl, weld::Button&, void); + DECL_LINK(RadioHdl, weld::Toggleable&, void); + bool IsCreateNew() const override { return m_xRbNewObject->get_active(); } + +public: + SvInsertOleDlg(weld::Window* pParent, + const css::uno::Reference < css::embed::XStorage >& xStorage, + const SvObjectServerList* pServers ); + virtual short run() override; + + /// get replacement for the iconified embedded object and the mediatype of the replacement + css::uno::Reference< css::io::XInputStream > GetIconIfIconified( OUString* pGraphicMediaType ) override; +}; + +class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl +{ +private: + std::unique_ptr<weld::Entry> m_xEDName; + std::unique_ptr<weld::Entry> m_xEDURL; + std::unique_ptr<weld::Button> m_xBTOpen; + + std::unique_ptr<weld::RadioButton> m_xRBScrollingOn; + std::unique_ptr<weld::RadioButton> m_xRBScrollingOff; + std::unique_ptr<weld::RadioButton> m_xRBScrollingAuto; + + std::unique_ptr<weld::RadioButton> m_xRBFrameBorderOn; + std::unique_ptr<weld::RadioButton> m_xRBFrameBorderOff; + + std::unique_ptr<weld::Label> m_xFTMarginWidth; + std::unique_ptr<weld::SpinButton> m_xNMMarginWidth; + std::unique_ptr<weld::CheckButton> m_xCBMarginWidthDefault; + std::unique_ptr<weld::Label> m_xFTMarginHeight; + std::unique_ptr<weld::SpinButton> m_xNMMarginHeight; + std::unique_ptr<weld::CheckButton> m_xCBMarginHeightDefault; + + DECL_LINK(OpenHdl, weld::Button&, void); + DECL_LINK(CheckHdl, weld::Toggleable&, void); + + void Init(); + +public: + SfxInsertFloatingFrameDialog(weld::Window *pParent, + const css::uno::Reference<css::embed::XStorage>& xStorage); + SfxInsertFloatingFrameDialog(weld::Window* pParent, + const css::uno::Reference<css::embed::XEmbeddedObject>& xObj); + virtual short run() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx new file mode 100644 index 0000000000..597ef172c3 --- /dev/null +++ b/cui/source/inc/insrc.hxx @@ -0,0 +1,41 @@ +/* -*- 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 . + */ +#pragma once + +#include <rtl/string.hxx> +#include <svx/svxdlg.hxx> +#include <vcl/weld.hxx> + +class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::SpinButton> m_xCountEdit; + std::unique_ptr<weld::RadioButton> m_xBeforeBtn; + std::unique_ptr<weld::RadioButton> m_xAfterBtn; + +public: + SvxInsRowColDlg(weld::Window* pParent, bool bCol, const OUString& rHelpId); + + virtual short Execute() override; + + virtual bool isInsertBefore() const override; + virtual sal_uInt16 getInsertCount() const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx new file mode 100644 index 0000000000..5d7f778d5c --- /dev/null +++ b/cui/source/inc/labdlg.hxx @@ -0,0 +1,116 @@ +/* -*- 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 . + */ +#pragma once + +#include <svtools/valueset.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/sxctitm.hxx> +#include <svx/sxcecitm.hxx> +#include <svx/anchorid.hxx> +#include <vcl/image.hxx> + +class SdrView; + +// class SvxCaptionTabPage ----------------------------------------------- + +const sal_uInt16 CAPTYPE_BITMAPS_COUNT = 3; + +class SvxCaptionTabPage : public SfxTabPage +{ +private: + static const WhichRangesContainer pCaptionRanges; + + Image m_aBmpCapTypes[CAPTYPE_BITMAPS_COUNT]; + + std::vector<OUString> m_aStrHorzList; + std::vector<OUString> m_aStrVertList; + + SdrCaptionType nCaptionType; + sal_Int32 nGap; + SdrCaptionEscDir nEscDir; + bool bEscRel; + sal_Int32 nEscAbs; + sal_Int32 nEscRel; + sal_Int32 nLineLen; + bool bFitLineLen; + + sal_uInt16 nPosition; + sal_uInt16 nExtension; + + const SfxItemSet& rOutAttrs; + const SdrView* pView; + + std::unique_ptr<weld::MetricSpinButton> m_xMF_SPACING; + std::unique_ptr<weld::ComboBox> m_xLB_EXTENSION; + std::unique_ptr<weld::Label> m_xFT_BYFT; + std::unique_ptr<weld::MetricSpinButton> m_xMF_BY; + std::unique_ptr<weld::Label> m_xFT_POSITIONFT; + std::unique_ptr<weld::ComboBox> m_xLB_POSITION; + std::unique_ptr<weld::ComboBox> m_xLineTypes; + std::unique_ptr<weld::Label> m_xFT_LENGTHFT; + std::unique_ptr<weld::MetricSpinButton> m_xMF_LENGTH; + std::unique_ptr<weld::CheckButton> m_xCB_OPTIMAL; + std::unique_ptr<ValueSet> m_xCT_CAPTTYPE; + std::unique_ptr<weld::CustomWeld> m_xCT_CAPTTYPEWin; + + void SetupExtension_Impl( sal_uInt16 nType ); + void SetupType_Impl( SdrCaptionType nType ); + DECL_LINK(ExtensionSelectHdl_Impl, weld::ComboBox&, void); + DECL_LINK(PositionSelectHdl_Impl, weld::ComboBox&, void); + DECL_LINK(LineOptHdl_Impl, weld::Toggleable&, void); + DECL_LINK(SelectCaptTypeHdl_Impl, ValueSet*, void); + +public: + SvxCaptionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxCaptionTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pCaptionRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + void Construct(); + void SetView( const SdrView* pSdrView ) + { pView = pSdrView; } + + void FillValueSet(); +}; + +// class SvxCaptionTabDialog --------------------------------------------- +struct SvxSwFrameValidation; +class SvxCaptionTabDialog : public SfxTabDialogController +{ +private: + const SdrView* pView; + SvxAnchorIds nAnchorCtrls; + + Link<SvxSwFrameValidation&,void> aValidateLink; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +public: + SvxCaptionTabDialog(weld::Window* pParent, const SdrView* pView, + SvxAnchorIds nAnchorTypes); + + /// link for the Writer to validate positions + void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ); +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/linkdlg.hxx b/cui/source/inc/linkdlg.hxx new file mode 100644 index 0000000000..1e54954ec5 --- /dev/null +++ b/cui/source/inc/linkdlg.hxx @@ -0,0 +1,81 @@ +/* -*- 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 . + */ + +#pragma once + +#include <vcl/idle.hxx> +#include <vcl/virdev.hxx> +#include <vcl/weld.hxx> + +/********************** SvUpdateLinksDialog ****************************** +*************************************************************************/ +namespace sfx2 +{ +class LinkManager; +class SvBaseLink; +} + +enum class SfxLinkUpdateMode; + +class SvBaseLinksDlg : public weld::GenericDialogController +{ + OUString aStrAutolink; + OUString aStrManuallink; + OUString aStrBrokenlink; + OUString aStrCloselinkmsg; + OUString aStrCloselinkmsgMulti; + OUString aStrWaitinglink; + sfx2::LinkManager* pLinkMgr; + Idle aUpdateIdle; + + std::unique_ptr<weld::TreeView> m_xTbLinks; + std::unique_ptr<weld::LinkButton> m_xFtFullFileName; + std::unique_ptr<weld::Label> m_xFtFullSourceName; + std::unique_ptr<weld::Label> m_xFtFullTypeName; + std::unique_ptr<weld::RadioButton> m_xRbAutomatic; + std::unique_ptr<weld::RadioButton> m_xRbManual; + std::unique_ptr<weld::Button> m_xPbUpdateNow; + std::unique_ptr<weld::Button> m_xPbChangeSource; + std::unique_ptr<weld::Button> m_xPbBreakLink; + + ScopedVclPtr<VirtualDevice> m_xVirDev; + + DECL_LINK(LinksSelectHdl, weld::TreeView&, void); + DECL_LINK(LinksDoubleClickHdl, weld::TreeView&, bool); + DECL_LINK(ToggleHdl, weld::Toggleable&, void); + DECL_LINK(UpdateNowClickHdl, weld::Button&, void); + DECL_LINK(ChangeSourceClickHdl, weld::Button&, void); + DECL_LINK(BreakLinkClickHdl, weld::Button&, void); + DECL_LINK(UpdateWaitingHdl, Timer*, void); + DECL_LINK(EndEditHdl, sfx2::SvBaseLink&, void); + void LinksSelectHdl(weld::TreeView* pTreeView); + sfx2::SvBaseLink* GetSelEntry(int* pPos); + OUString ImplGetStateStr(const sfx2::SvBaseLink&); + void SetType(sfx2::SvBaseLink& rLink, int nPos, SfxLinkUpdateMode nType); + void InsertEntry(const sfx2::SvBaseLink& rLink, int nPos = -1, bool bSelect = false); + + void SetManager(sfx2::LinkManager*); + +public: + SvBaseLinksDlg(weld::Window* pParent, sfx2::LinkManager*, bool bHtml); + virtual ~SvBaseLinksDlg() override; + void SetActLink(sfx2::SvBaseLink const* pLink); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx new file mode 100644 index 0000000000..ba3c1de117 --- /dev/null +++ b/cui/source/inc/macroass.hxx @@ -0,0 +1,90 @@ +/* -*- 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 . + */ +#pragma once + +#include <sal/config.h> + +#include <sfx2/basedlgs.hxx> +#include <sfx2/tabdlg.hxx> +#include <svl/macitem.hxx> +#include <vcl/weld.hxx> +#include <com/sun/star/frame/XFrame.hpp> +#include <memory> + +class SfxMacroTabPage_; +class SfxMacroTabPage_Impl; +class Timer; + +class SfxMacroTabPage final : public SfxTabPage +{ + SvxMacroTableDtor aTbl; + DECL_LINK(SelectEvent_Impl, weld::TreeView&, void); + DECL_LINK(SelectGroup_Impl, weld::TreeView&, void); + DECL_LINK(SelectMacro_Impl, weld::TreeView&, void); + + DECL_LINK(AssignDeleteHdl_Impl, weld::TreeView&, bool); + DECL_LINK(AssignDeleteClickHdl_Impl, weld::Button&, void); + void AssignDeleteHdl(const weld::Widget*); + DECL_LINK( TimeOut_Impl, Timer*, void ); + + std::unique_ptr<SfxMacroTabPage_Impl> mpImpl; + + void InitAndSetHandler(); + void FillEvents(); + void EnableButtons(); + +public: + SfxMacroTabPage( + weld::Container* pPage, weld::DialogController* pController, + const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame, + const SfxItemSet& rSet + ); + + virtual ~SfxMacroTabPage() override; + + void AddEvent( const OUString & rEventName, SvMacroItemId nEventId ); + + void ScriptChanged(); + virtual void PageCreated (const SfxAllItemSet& aSet) override; + virtual void ActivatePage( const SfxItemSet& ) override; + void LaunchFillGroup(); + + // --------- inherit from the base ------------- + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + bool IsReadOnly() const override; + + // --------- inherit from the base ------------- + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet ); +}; + +class SfxMacroAssignDlg : public SfxSingleTabDialogController +{ +public: + SfxMacroAssignDlg(weld::Widget* pParent, + const css::uno::Reference< css::frame::XFrame >& rxDocumentFrame, + const SfxItemSet& rSet); + SfxMacroTabPage* GetTabPage() + { + return static_cast<SfxMacroTabPage*>(m_xSfxPage.get()); + } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx new file mode 100644 index 0000000000..2f2471bb09 --- /dev/null +++ b/cui/source/inc/macropg.hxx @@ -0,0 +1,132 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/basedlgs.hxx> +#include <sfx2/tabdlg.hxx> + +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/util/XModifiable.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <rtl/ustring.hxx> +#include <unotools/resmgr.hxx> + +#include <unordered_map> +#include <vector> + +typedef std::pair<OUString, OUString> EventPair; +typedef std::unordered_map<OUString, EventPair> EventsHash; + +struct EventDisplayName +{ + const char* pAsciiEventName; + TranslateId pEventResourceID; + EventDisplayName(const char* pAsciiName, TranslateId pResId) + : pAsciiEventName(pAsciiName) + , pEventResourceID(pResId) + { + } +}; + +class SvxMacroTabPage_; +class SvTabListBox; + +class SvxMacroTabPage_Impl; + + +class SvxMacroTabPage_ : public SfxTabPage +{ + DECL_LINK( SelectEvent_Impl, weld::TreeView&, void ); + DECL_LINK( AssignDeleteHdl_Impl, weld::Button&, void ); + DECL_LINK( DoubleClickHdl_Impl, weld::TreeView&, bool ); + DECL_LINK( DeleteAllHdl_Impl, weld::Button&, void ); + + void GenericHandler_Impl(const weld::Button* pBtn); + const EventPair* LookupEvent(const OUString& rEventName); + + css::uno::Reference< css::container::XNameReplace > m_xAppEvents; +protected: + std::unique_ptr<SvxMacroTabPage_Impl> mpImpl; + css::uno::Reference< css::container::XNameReplace > m_xDocEvents; + css::uno::Reference< css::util::XModifiable > m_xModifiable; + EventsHash m_appEventsHash; + EventsHash m_docEventsHash; + int m_nAssignedEvents; + bool bDocModified, bAppEvents, bInitialized; + std::vector< EventDisplayName > aDisplayNames; + + SvxMacroTabPage_(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet& rItemSet); + + void EnableButtons(); + static css::uno::Any GetPropsByName( const OUString& eventName, EventsHash& eventsHash ); + static EventPair GetPairFromAny(const css::uno::Any& aAny); + +public: + + virtual ~SvxMacroTabPage_() override; + void InitResources(); + + void InitAndSetHandler( const css::uno::Reference< css::container::XNameReplace >& xAppEvents, const css::uno::Reference< css::container::XNameReplace >& xDocEvents, const css::uno::Reference< css::util::XModifiable >& xModifiable ); + virtual bool FillItemSet( SfxItemSet* rSet ) override; + + virtual void Reset( const SfxItemSet* ) override; + + void DisplayAppEvents( bool appEvents); + void SetReadOnly( bool bSet ); + bool IsReadOnly() const override; +}; + +class SvxMacroTabPage : public SvxMacroTabPage_ +{ +public: + SvxMacroTabPage( + weld::Container* pPage, weld::DialogController* pController, + const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame, + const SfxItemSet& rSet, + css::uno::Reference< css::container::XNameReplace > const & xNameReplace, + sal_uInt16 nSelectedIndex + ); +}; + +// class SvxMacroAssignDlg -------------------------------------------------- + +typedef WhichRangesContainer (*GetTabPageRanges)(); // gives international Which-values + +class SvxMacroAssignSingleTabDialog : public SfxSingleTabDialogController +{ +public: + SvxMacroAssignSingleTabDialog(weld::Window* pParent, const SfxItemSet& rOptionsSet); + +private: + DECL_LINK(OKHdl_Impl, weld::Button&, void); +}; + +class SvxMacroAssignDlg : public SvxMacroAssignSingleTabDialog +{ +public: + SvxMacroAssignDlg( + weld::Window* pParent, + const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame, + const SfxItemSet& rSet, + const css::uno::Reference< css::container::XNameReplace >& xNameReplace, + sal_uInt16 nSelectedIndex + ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx new file mode 100644 index 0000000000..7e18c64855 --- /dev/null +++ b/cui/source/inc/measure.hxx @@ -0,0 +1,95 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/basedlgs.hxx> +#include <svx/dlgctrl.hxx> +#include <svx/measctrl.hxx> + +class SdrView; + +/// Dialog for changing TextAttributes +class SvxMeasurePage : public SvxTabPage +{ +private: + static const WhichRangesContainer pRanges; + + const SfxItemSet& rOutAttrs; + SfxItemSet aAttrSet; + const SdrView* pView; + MapUnit eUnit; + + bool bPositionModified; + + SvxRectCtl m_aCtlPosition; + SvxXMeasurePreview m_aCtlPreview; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldLineDist; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHelplineOverhang; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHelplineDist; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHelpline1Len; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldHelpline2Len; + std::unique_ptr<weld::CheckButton> m_xTsbBelowRefEdge; + std::unique_ptr<weld::SpinButton> m_xMtrFldDecimalPlaces; + std::unique_ptr<weld::CheckButton> m_xTsbAutoPosV; + std::unique_ptr<weld::CheckButton> m_xTsbAutoPosH; + std::unique_ptr<weld::CheckButton> m_xTsbShowUnit; + std::unique_ptr<weld::ComboBox> m_xLbUnit; + std::unique_ptr<weld::CheckButton> m_xTsbParallel; + std::unique_ptr<weld::Label> m_xFtAutomatic; + std::unique_ptr<weld::CustomWeld> m_xCtlPosition; + std::unique_ptr<weld::CustomWeld> m_xCtlPreview; + + void FillUnitLB(); + + DECL_LINK(ClickAutoPosHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ChangeAttrEditHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeAttrSpinHdl_Impl, weld::SpinButton&, void); + DECL_LINK(ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ChangeAttrClickHdl_Impl, weld::Toggleable&, void); + void ChangeAttrHdl_Impl(void const *); + +public: + + SvxMeasurePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxMeasurePage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void PointChanged( weld::DrawingArea* pWindow, RectPoint eRP ) override; + + void Construct(); + void SetView( const SdrView* pSdrView ) { pView = pSdrView; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; + +}; + +/* Derived from SfxSingleTabDialogController, in order to be able to be + informed about virtual methods by the control. */ +class SvxMeasureDialog : public SfxSingleTabDialogController +{ +public: + SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rAttr, + const SdrView* pView); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/multipat.hxx b/cui/source/inc/multipat.hxx new file mode 100644 index 0000000000..258e446e80 --- /dev/null +++ b/cui/source/inc/multipat.hxx @@ -0,0 +1,66 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> + +class SvxMultiPathDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::TreeView> m_xRadioLB; + std::unique_ptr<weld::Button> m_xAddBtn; + std::unique_ptr<weld::Button> m_xDelBtn; + + void AppendEntry(const OUString& rText, const OUString& rId); + void HandleEntryChecked(int nRow); + + DECL_LINK(AddHdl_Impl, weld::Button&, void); + DECL_LINK(DelHdl_Impl, weld::Button&, void); + DECL_LINK(SelectHdl_Impl, weld::TreeView&, void); + DECL_LINK(CheckHdl_Impl, const weld::TreeView::iter_col&, void); + +public: + SvxMultiPathDialog(weld::Window* pParent); + virtual ~SvxMultiPathDialog() override; + + OUString GetPath() const; + void SetPath(std::u16string_view rPath); + void SetTitle(const OUString& rTitle) { m_xDialog->set_title(rTitle); } +}; + +class SvxPathSelectDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::TreeView> m_xPathLB; + std::unique_ptr<weld::Button> m_xAddBtn; + std::unique_ptr<weld::Button> m_xDelBtn; + + DECL_LINK(AddHdl_Impl, weld::Button&, void); + DECL_LINK(DelHdl_Impl, weld::Button&, void); + DECL_LINK(SelectHdl_Impl, weld::TreeView&, void); + +public: + SvxPathSelectDialog(weld::Window* pParent); + + OUString GetPath() const; + void SetPath( std::u16string_view rPath ); + void SetTitle(const OUString& rTitle) { m_xDialog->set_title(rTitle); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx new file mode 100644 index 0000000000..4a34cb3771 --- /dev/null +++ b/cui/source/inc/newtabledlg.hxx @@ -0,0 +1,70 @@ +/* -*- 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 . + */ +#pragma once + +#include <svx/svxdlg.hxx> +#include <vcl/weld.hxx> + +class SvxNewTableDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::SpinButton> mxNumColumns; + std::unique_ptr<weld::SpinButton> mxNumRows; + +public: + SvxNewTableDialog(weld::Window* pParent); + + sal_Int32 getRows() const; + sal_Int32 getColumns() const; +}; + +class SvxNewTableDialogWrapper : public SvxAbstractNewTableDialog +{ +private: + std::shared_ptr<SvxNewTableDialog> m_xDlg; + +public: + SvxNewTableDialogWrapper(weld::Window* pParent) + : m_xDlg(std::make_shared<SvxNewTableDialog>(pParent)) + { + } + + virtual std::shared_ptr<weld::DialogController> getDialogController() override + { + return m_xDlg; + } + + virtual sal_Int32 getRows() const override + { + if (m_xDlg) + return m_xDlg->getRows(); + + return 0; + } + + virtual sal_Int32 getColumns() const override + { + if (m_xDlg) + return m_xDlg->getColumns(); + + return 0; + } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx new file mode 100644 index 0000000000..13f1a88e9e --- /dev/null +++ b/cui/source/inc/numfmt.hxx @@ -0,0 +1,154 @@ +/* -*- 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 . + */ +#pragma once + + +#include <rtl/ustring.hxx> +#include <sfx2/tabdlg.hxx> +#include <svx/langbox.hxx> +#include <tools/color.hxx> +#include <vcl/customweld.hxx> +#include <vcl/weld.hxx> + +class SvxNumberFormatShell; +class SvxNumberInfoItem; +class vector; + + +class SvxNumberPreview : public weld::CustomWidgetController +{ +private: + OUString aPrevStr; + Color aPrevCol; + sal_Int32 mnPos; + sal_Unicode mnChar; + +protected: + virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override; + +public: + SvxNumberPreview(); + + void NotifyChange( const OUString& rPrevStr, const Color* pColor = nullptr ); + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override + { + CustomWidgetController::SetDrawingArea(pDrawingArea); + pDrawingArea->set_size_request(-1, pDrawingArea->get_text_height() * 3); + } +}; + +class SvxNumberFormatTabPage : public SfxTabPage +{ + static const WhichRangesContainer pRanges; + +public: + SvxNumberFormatTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet ); + virtual ~SvxNumberFormatTabPage() override; + // Returns area information. + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual DeactivateRC DeactivatePage ( SfxItemSet* pSet ) override; + + void HideLanguage(bool bFlag=true); + virtual void PageCreated(const SfxAllItemSet& aSet) override; + +private: + std::unique_ptr<SvxNumberInfoItem> pNumItem; + std::unique_ptr<SvxNumberFormatShell> pNumFmtShell; + sal_uInt32 nInitFormat; + short m_nLbFormatSelPosEdComment; + + bool bNumItemFlag; ///< for handling with DocShell + bool bOneAreaFlag; + bool bLegacyAutomaticCurrency; + short nFixedCategory; + + OUString sAutomaticLangEntry; + OUString sAutomaticCurrencyEntry; + + SvxNumberPreview m_aWndPreview; + std::unique_ptr<weld::Label> m_xFtCategory; + std::unique_ptr<weld::TreeView> m_xLbCategory; + std::unique_ptr<weld::Label> m_xFtFormat; + std::unique_ptr<weld::ComboBox> m_xLbCurrency; + std::unique_ptr<weld::TreeView> m_xLbFormat; + std::unique_ptr<weld::Label> m_xFtLanguage; + std::unique_ptr<weld::CheckButton> m_xCbSourceFormat; + std::unique_ptr<weld::Label> m_xFtOptions; + std::unique_ptr<weld::Label> m_xFtDecimals; + std::unique_ptr<weld::SpinButton> m_xEdDecimals; + std::unique_ptr<weld::Label> m_xFtDenominator; + std::unique_ptr<weld::SpinButton> m_xEdDenominator; + std::unique_ptr<weld::CheckButton> m_xBtnNegRed; + std::unique_ptr<weld::Label> m_xFtLeadZeroes; + std::unique_ptr<weld::SpinButton> m_xEdLeadZeroes; + std::unique_ptr<weld::CheckButton> m_xBtnThousand; + std::unique_ptr<weld::CheckButton> m_xBtnEngineering; + std::unique_ptr<weld::Widget> m_xFormatCodeFrame; + std::unique_ptr<weld::Entry> m_xEdFormat; + std::unique_ptr<weld::Button> m_xIbAdd; + std::unique_ptr<weld::Button> m_xIbInfo; + std::unique_ptr<weld::Button> m_xIbRemove; + std::unique_ptr<weld::Label> m_xFtComment; + std::unique_ptr<weld::Entry> m_xEdComment; + std::unique_ptr<SvxLanguageBox> m_xLbLanguage; + std::unique_ptr<weld::CustomWeld> m_xWndPreview; + + void Init_Impl(); + void FillCurrencyBox(); + void FillFormatListBox_Impl( std::vector<OUString>& rEntries ); + void UpdateOptions_Impl( bool bCheckCatChange ); + void UpdateFormatListBox_Impl( bool bCat, bool bUpdateEdit ); + void UpdateThousandEngineeringCheckBox(); + void UpdateDecimalsDenominatorEditBox(); + void Obstructing(); + void EnableBySourceFormat_Impl(); + void SetCategory( sal_uInt16 nPos ); + OUString GetExpColorString( const Color*& rpPreviewColor, const OUString& aFormatStr, short nTmpCatPos ); + void MakePreviewText( const OUString& rFormat ); + void ChangePreviewText( sal_uInt16 nPos ); + void AddAutomaticLanguage_Impl(LanguageType eAutoLang, bool bSelect); + bool Click_Impl(const weld::Button& rIB); + // Handler + DECL_LINK(LostFocusHdl_Impl, weld::Widget&, void); + DECL_LINK(DoubleClickHdl_Impl, weld::TreeView&, bool); + DECL_LINK(SelFormatListBoxHdl_Impl, weld::ComboBox&, void); + DECL_LINK(SelFormatTreeListBoxHdl_Impl, weld::TreeView&, void); + DECL_LINK(SelFormatClickHdl_Impl, weld::Toggleable&, void); + void SelFormatHdl_Impl(weld::Widget*); + DECL_LINK(ClickHdl_Impl, weld::Button&, void); + DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void); + DECL_LINK(OptEditHdl_Impl, weld::SpinButton&, void); + DECL_LINK(OptClickHdl_Impl, weld::Toggleable&, void); + void EditHdl_Impl(const weld::Entry*); + void OptHdl_Impl(const weld::Widget*); + + // set and get currency, taking into account if the legacy + // automatic currency entry exists + void set_active_currency(sal_Int32 nCurCurrencyEntryPos); + sal_uInt32 get_active_currency() const; + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx new file mode 100644 index 0000000000..d693b9e032 --- /dev/null +++ b/cui/source/inc/numpages.hxx @@ -0,0 +1,386 @@ +/* -*- 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 . + */ +#pragma once + +#include <vector> +#include <memory> + +#include <sfx2/tabdlg.hxx> +#include <editeng/numdef.hxx> +#include <editeng/svxenum.hxx> +#include <svtools/ctrlbox.hxx> +#include <vcl/customweld.hxx> +#include <vcl/timer.hxx> +#include <cui/numberingpreview.hxx> + +#define MN_GALLERY_ENTRY 100 + +class ColorListBox; +class SvxNumValueSet; +class SvxNumRule; +class SvxBmpNumValueSet; +class SvxBrushItem; +struct ImplSVEvent; + +struct SvxNumSettings_Impl +{ + SvxNumType nNumberType; + short nParentNumbering; + OUString sPrefix; + OUString sSuffix; + OUString sBulletChar; + OUString sBulletFont; + SvxNumSettings_Impl() : + nNumberType(SVX_NUM_CHARS_UPPER_LETTER), + nParentNumbering(0) + {} +}; + +typedef std::vector<std::unique_ptr<SvxNumSettings_Impl> > SvxNumSettingsArr_Impl; + + +class SvxSingleNumPickTabPage final : public SfxTabPage +{ + SvxNumSettingsArr_Impl aNumSettingsArr; + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + sal_uInt16 nActNumLvl; + bool bModified : 1; + bool bPreset : 1; + TypedWhichId<SvxNumBulletItem> nNumItemId; + + std::unique_ptr<SvxNumValueSet> m_xExamplesVS; + std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin; + + DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); + DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); + +public: + SvxSingleNumPickTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxSingleNumPickTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; +}; + +class SvxBulletPickTabPage final : public SfxTabPage +{ + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + sal_uInt16 nActNumLvl; + bool bModified : 1; + bool bPreset : 1; + TypedWhichId<SvxNumBulletItem> nNumItemId; + + OUString sBulletCharFormatName; + + std::unique_ptr<SvxNumValueSet> m_xExamplesVS; + std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin; + + DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); + DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); +public: + SvxBulletPickTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxBulletPickTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +#define NUM_VALUSET_COUNT 16 + +/// TabPage for complete numeration +class SvxNumPickTabPage final : public SfxTabPage +{ + OUString sNumCharFmtName; + OUString sBulletCharFormatName; + + SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]; // is initialized with the five formats + + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + sal_uInt16 nActNumLvl; + TypedWhichId<SvxNumBulletItem> nNumItemId; + bool bModified : 1; + bool bPreset : 1; + + std::unique_ptr<SvxNumValueSet> m_xExamplesVS; + std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin; + + DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); + DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); + +public: + SvxNumPickTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxNumPickTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + void SetCharFormatNames(const OUString& rCharName, const OUString& rBulName) + { sNumCharFmtName = rCharName; + sBulletCharFormatName = rBulName;} + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +class SvxBitmapPickTabPage final : public SfxTabPage +{ + std::vector<OUString> aGrfNames; + + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + sal_uInt16 nActNumLvl; + TypedWhichId<SvxNumBulletItem> nNumItemId; + MapUnit eCoreUnit; + bool bModified : 1; + bool bPreset : 1; + + std::unique_ptr<weld::Label> m_xErrorText; + std::unique_ptr<weld::Button> m_xBtBrowseFile; + std::unique_ptr<SvxBmpNumValueSet> m_xExamplesVS; + std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin; + + DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); + DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); + DECL_LINK(ClickAddBrowseHdl_Impl, weld::Button&, void); + +public: + SvxBitmapPickTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxBitmapPickTabPage() override; + + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; +}; + +class SvxNumOptionsTabPage : public SfxTabPage +{ + OUString m_sNumCharFmtName; + OUString m_sBulletCharFormatName; + + Timer aInvalidateTimer; + + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + + Size aInitSize[SVX_MAX_NUM]; + + ImplSVEvent* m_pLevelHdlEvent; + + bool bLastWidthModified : 1; + bool bModified : 1; + bool bPreset : 1; + bool bAutomaticCharStyles: 1; + bool bHTMLMode : 1; + + std::vector<OUString> aGrfNames; + vcl::Font aActBulletFont; + + sal_uInt8 nBullet; + sal_uInt16 nActNumLvl; + TypedWhichId<SvxNumBulletItem> nNumItemId; + MapUnit eCoreUnit; + + SvxNumberingPreview m_aPreviewWIN; + std::unique_ptr<weld::Widget> m_xGrid; + std::unique_ptr<weld::TreeView> m_xLevelLB; + std::unique_ptr<weld::ComboBox> m_xFmtLB; + std::unique_ptr<weld::Label> m_xSeparatorFT; + std::unique_ptr<weld::Label> m_xPrefixFT; + std::unique_ptr<weld::Entry> m_xPrefixED; + std::unique_ptr<weld::Label> m_xSuffixFT; + std::unique_ptr<weld::Entry> m_xSuffixED; + std::unique_ptr<weld::Label> m_xCharFmtFT; + std::unique_ptr<weld::ComboBox> m_xCharFmtLB; + std::unique_ptr<weld::Label> m_xBulColorFT; + std::unique_ptr<ColorListBox> m_xBulColLB; + std::unique_ptr<weld::Label> m_xBulRelSizeFT; + std::unique_ptr<weld::MetricSpinButton> m_xBulRelSizeMF; + std::unique_ptr<weld::Label> m_xAllLevelFT; + std::unique_ptr<weld::SpinButton> m_xAllLevelNF; + std::unique_ptr<weld::CheckButton> m_xIsLegalCB; + std::unique_ptr<weld::Label> m_xStartFT; + std::unique_ptr<weld::SpinButton> m_xStartED; + std::unique_ptr<weld::Label> m_xBulletFT; + std::unique_ptr<weld::Button> m_xBulletPB; + std::unique_ptr<weld::Label> m_xBitmapFT; + std::unique_ptr<weld::MenuButton> m_xBitmapMB; + std::unique_ptr<weld::Label> m_xWidthFT; + std::unique_ptr<weld::MetricSpinButton> m_xWidthMF; + std::unique_ptr<weld::Label> m_xHeightFT; + std::unique_ptr<weld::MetricSpinButton> m_xHeightMF; + std::unique_ptr<weld::CheckButton> m_xRatioCB; + std::unique_ptr<weld::Label> m_xOrientFT; + std::unique_ptr<weld::ComboBox> m_xOrientLB; + std::unique_ptr<weld::Widget> m_xAllLevelsFrame; + std::unique_ptr<weld::Menu> m_xGalleryMenu; + std::unique_ptr<weld::CheckButton> m_xSameLevelCB; + std::unique_ptr<weld::CustomWeld> m_xPreviewWIN; + + void InitControls(); + /** To switch between the numbering type + 0 - Number; + 1 - Bullet; + 2 - Bitmap; */ + void SwitchNumberType( sal_uInt8 nType ); + void CheckForStartValue_Impl(sal_uInt16 nNumberingType); + + DECL_LINK(NumberTypeSelectHdl_Impl, weld::ComboBox&, void); + DECL_LINK(LevelHdl_Impl, weld::TreeView&, void); + DECL_LINK(LevelHdl, void *, void); + DECL_LINK(PopupActivateHdl_Impl, weld::Toggleable&, void); + DECL_LINK(GraphicHdl_Impl, const OUString&, void); + DECL_LINK(BulletHdl_Impl, weld::Button&, void); + DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(RatioHdl_Impl, weld::Toggleable&, void); + DECL_LINK(CharFmtHdl_Impl, weld::ComboBox&, void); + DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void); + DECL_LINK(SpinModifyHdl_Impl, weld::SpinButton&, void); + DECL_LINK(AllLevelHdl_Impl, weld::SpinButton&, void); + DECL_LINK(IsLegalHdl_Impl, weld::Toggleable&, void); + DECL_LINK(OrientHdl_Impl, weld::ComboBox&, void); + DECL_LINK(SameLevelHdl_Impl, weld::Toggleable&, void); + DECL_LINK(BulColorHdl_Impl, ColorListBox&, void); + DECL_LINK(BulRelSizeHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(PreviewInvalidateHdl_Impl, Timer*, void); + void EditModifyHdl_Impl(const weld::Entry*); + +public: + SvxNumOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxNumOptionsTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + void SetCharFmts(const OUString& rNumName, const OUString& rBulletName) + { + m_sNumCharFmtName = rNumName; + m_sBulletCharFormatName = rBulletName; + } + void SetMetric(FieldUnit eSet); + + void SetModified(bool bRepaint = true); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + + +class SvxNumPositionTabPage : public SfxTabPage +{ + std::unique_ptr<SvxNumRule> pActNum; + std::unique_ptr<SvxNumRule> pSaveNum; + + ImplSVEvent* m_pLevelHdlEvent; + sal_uInt16 nActNumLvl; + TypedWhichId<SvxNumBulletItem> nNumItemId; + MapUnit eCoreUnit; + + bool bModified : 1; + bool bPreset : 1; + bool bInInintControl : 1; // workaround for Modify-error, is said to be corrected from 391 on + bool bLabelAlignmentPosAndSpaceModeActive; + + SvxNumberingPreview m_aPreviewWIN; + std::unique_ptr<weld::TreeView> m_xLevelLB; + // former set of controls shown for numbering rules containing list level + // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION + std::unique_ptr<weld::Label> m_xDistBorderFT; + std::unique_ptr<weld::MetricSpinButton> m_xDistBorderMF; + std::unique_ptr<weld::CheckButton> m_xRelativeCB; + std::unique_ptr<weld::Label> m_xIndentFT; + std::unique_ptr<weld::MetricSpinButton> m_xIndentMF; + std::unique_ptr<weld::Label> m_xDistNumFT; + std::unique_ptr<weld::MetricSpinButton> m_xDistNumMF; + std::unique_ptr<weld::Label> m_xAlignFT; + std::unique_ptr<weld::ComboBox> m_xAlignLB; + // new set of controls shown for numbering rules containing list level + // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT + std::unique_ptr<weld::Label> m_xLabelFollowedByFT; + std::unique_ptr<weld::ComboBox> m_xLabelFollowedByLB; + std::unique_ptr<weld::Label> m_xListtabFT; + std::unique_ptr<weld::MetricSpinButton> m_xListtabMF; + std::unique_ptr<weld::Label>m_xAlign2FT; + std::unique_ptr<weld::ComboBox> m_xAlign2LB; + std::unique_ptr<weld::Label> m_xAlignedAtFT; + std::unique_ptr<weld::MetricSpinButton> m_xAlignedAtMF; + std::unique_ptr<weld::Label> m_xIndentAtFT; + std::unique_ptr<weld::MetricSpinButton> m_xIndentAtMF; + std::unique_ptr<weld::Button> m_xStandardPB; + std::unique_ptr<weld::CustomWeld> m_xPreviewWIN; + + void InitControls(); + + DECL_LINK(LevelHdl_Impl, weld::TreeView&, void); + DECL_LINK(LevelHdl, void *, void); + DECL_LINK(EditModifyHdl_Impl, weld::ComboBox&, void); + DECL_LINK(DistanceHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(RelativeHdl_Impl, weld::Toggleable&, void); + DECL_LINK(StandardHdl_Impl, weld::Button&, void); + + void InitPosAndSpaceMode(); + void ShowControlsDependingOnPosAndSpaceMode(); + + DECL_LINK(LabelFollowedByHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ListtabPosHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(AlignAtHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(IndentAtHdl_Impl, weld::MetricSpinButton&, void); + +public: + SvxNumPositionTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxNumPositionTabPage() override; + + virtual void ActivatePage(const SfxItemSet& rSet) override; + virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rAttrSet); + + void SetMetric(FieldUnit eSet); + void SetModified(); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx new file mode 100644 index 0000000000..31a622f7a5 --- /dev/null +++ b/cui/source/inc/optasian.hxx @@ -0,0 +1,63 @@ +/* -*- 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 . + */ +#pragma once + +#include <memory> +#include <sfx2/tabdlg.hxx> +#include <svx/langbox.hxx> + +struct SvxAsianLayoutPage_Impl; +class SvxAsianLayoutPage : public SfxTabPage +{ + std::unique_ptr<SvxAsianLayoutPage_Impl> pImpl; + + std::unique_ptr<weld::RadioButton> m_xCharKerningRB; + std::unique_ptr<weld::RadioButton> m_xCharPunctKerningRB; + std::unique_ptr<weld::RadioButton> m_xNoCompressionRB; + std::unique_ptr<weld::RadioButton> m_xPunctCompressionRB; + std::unique_ptr<weld::RadioButton> m_xPunctKanaCompressionRB; + std::unique_ptr<weld::Label> m_xLanguageFT; + std::unique_ptr<SvxLanguageBox> m_xLanguageLB; + std::unique_ptr<weld::CheckButton> m_xStandardCB; + std::unique_ptr<weld::Label> m_xStartFT; + std::unique_ptr<weld::Entry> m_xStartED; + std::unique_ptr<weld::Label> m_xEndFT; + std::unique_ptr<weld::Entry> m_xEndED; + std::unique_ptr<weld::Label> m_xHintFT; + + DECL_LINK(LanguageHdl, weld::ComboBox&, void); + DECL_LINK(ChangeStandardHdl, weld::Toggleable&, void); + DECL_LINK(ModifyHdl, weld::Entry&, void); + +public: + SvxAsianLayoutPage(weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet& rSet); + virtual ~SvxAsianLayoutPage() override; + + static std::unique_ptr<SfxTabPage> + Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet); + static WhichRangesContainer GetRanges(); + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet(SfxItemSet* rSet) override; + virtual void Reset(const SfxItemSet* rSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx new file mode 100644 index 0000000000..8e382cc32e --- /dev/null +++ b/cui/source/inc/optdict.hxx @@ -0,0 +1,108 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <svx/langbox.hxx> + +namespace com::sun::star{ + namespace linguistic2{ + class XDictionary; + class XSpellChecker1; + } +} + +// forward --------------------------------------------------------------- + + +// class SvxNewDictionaryDialog ------------------------------------------ + +class SvxNewDictionaryDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Entry> m_xNameEdit; + std::unique_ptr<SvxLanguageBox> m_xLanguageLB; + std::unique_ptr<weld::CheckButton> m_xExceptBtn; + std::unique_ptr<weld::Button> m_xOKBtn; + css::uno::Reference<css::linguistic2::XDictionary> m_xNewDic; + + DECL_LINK(OKHdl_Impl, weld::Button&, void); + DECL_LINK(ModifyHdl_Impl, weld::Entry&, void); + +public: + SvxNewDictionaryDialog(weld::Window* pParent); + + const css::uno::Reference<css::linguistic2::XDictionary>& GetNewDictionary() const { return m_xNewDic; } +}; + +// class SvxEditDictionaryDialog ----------------------------------------- + +class SvxEditDictionaryDialog : public weld::GenericDialogController +{ +private: + OUString sModify; + OUString sNew; + OUString sReplaceFT_Text; + + css::uno::Sequence< + css::uno::Reference< + css::linguistic2::XDictionary > > aDics; //! snapshot copy to work on + + bool bFirstSelect; + bool bDoNothing; + bool bDicIsReadonly; + + weld::TreeView* m_pWordsLB; + std::unique_ptr<weld::ComboBox> m_xAllDictsLB; + std::unique_ptr<weld::Label> m_xLangFT; + std::unique_ptr<SvxLanguageBox> m_xLangLB; + std::unique_ptr<weld::Entry> m_xWordED; + std::unique_ptr<weld::Label> m_xReplaceFT; + std::unique_ptr<weld::Entry> m_xReplaceED; + std::unique_ptr<weld::TreeView> m_xSingleColumnLB; + std::unique_ptr<weld::TreeView> m_xDoubleColumnLB; + std::unique_ptr<weld::Button> m_xNewReplacePB; + std::unique_ptr<weld::Button> m_xDeletePB; + + DECL_LINK(SelectBookHdl_Impl, weld::ComboBox&, void); + DECL_LINK(SelectLangHdl_Impl, weld::ComboBox&, void); + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(NewDelButtonHdl, weld::Button&, void); + DECL_LINK(NewDelActionHdl, weld::Entry&, bool); + DECL_LINK(ModifyHdl, weld::Entry&, void); + DECL_LINK(EntrySizeAllocHdl, const Size&, void); + bool NewDelHdl(const weld::Widget*); + + void ShowWords_Impl( sal_uInt16 nId ); + void SetLanguage_Impl( LanguageType nLanguage ); + bool IsDicReadonly_Impl() const { return bDicIsReadonly; } + void SetDicReadonly_Impl( css::uno::Reference< + css::linguistic2::XDictionary > const &xDic ); + + void RemoveDictEntry(int nEntry); + int GetLBInsertPos(std::u16string_view rDicWord); + +public: + SvxEditDictionaryDialog(weld::Window* pParent, std::u16string_view rName); + virtual ~SvxEditDictionaryDialog() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx new file mode 100644 index 0000000000..6c5657acf7 --- /dev/null +++ b/cui/source/inc/optlingu.hxx @@ -0,0 +1,156 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/langbox.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/configuration/ReadWriteAccess.hpp> + +namespace com::sun::star{ + namespace beans{ + class XPropertySet; + } + namespace linguistic2{ + class XDictionary; + class XDictionaryList; + class XLinguProperties; + } +} + +class SvxLinguData_Impl; + +// define ---------------------------------------------------------------- + +#define GROUP_MODULES (sal_uInt16(0x0008)) + +// forward --------------------------------------------------------------- + +class SvxEditModulesDlg : public weld::GenericDialogController +{ + OUString sSpell; + OUString sHyph; + OUString sThes; + OUString sGrammar; + + std::unique_ptr<SvxLinguData_Impl> pDefaultLinguData; + SvxLinguData_Impl& rLinguData; + + std::unique_ptr<weld::TreeView> m_xModulesCLB; + std::unique_ptr<weld::Button> m_xPrioUpPB; + std::unique_ptr<weld::Button> m_xPrioDownPB; + std::unique_ptr<weld::Button> m_xBackPB; + std::unique_ptr<weld::LinkButton> m_xMoreDictsLink; + std::unique_ptr<weld::Button> m_xClosePB; + std::unique_ptr<SvxLanguageBox> m_xLanguageLB; + + css::uno::Reference< css::configuration::XReadWriteAccess> m_xReadWriteAccess; + + DECL_LINK( SelectHdl_Impl, weld::TreeView&, void ); + DECL_LINK( UpDownHdl_Impl, weld::Button&, void ); + DECL_LINK( ClickHdl_Impl, weld::Button&, void ); + DECL_LINK( BackHdl_Impl, weld::Button&, void ); + DECL_LINK( LangSelectListBoxHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( BoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); + DECL_STATIC_LINK( SvxEditModulesDlg, OnLinkClick, weld::LinkButton&, bool); + void LangSelectHdl_Impl(const SvxLanguageBox* pBox); + +public: + SvxEditModulesDlg(weld::Window* pParent, SvxLinguData_Impl& rData); + virtual ~SvxEditModulesDlg() override; +}; + +struct ImplSVEvent; + +// class SvxLinguTabPage ------------------------------------------------- +class SvxLinguTabPage : public SfxTabPage +{ +private: + OUString sCapitalWords; + OUString sWordsWithDigits; + OUString sSpellSpecial; + OUString sSpellAuto; + OUString sSpellClosedCompound; + OUString sSpellHyphenatedCompound; + OUString sGrammarAuto; + OUString sNumMinWordlen; + OUString sNumPreBreak; + OUString sNumPostBreak; + OUString sHyphAuto; + OUString sHyphSpecial; + + int nUPN_HYPH_MIN_WORD_LENGTH; + int nUPN_HYPH_MIN_LEADING; + int nUPN_HYPH_MIN_TRAILING; + + ImplSVEvent* m_nDlbClickEventId; + + css::uno::Reference< + css::linguistic2::XLinguProperties > xProp; + + css::uno::Reference< + css::linguistic2::XDictionaryList > xDicList; + css::uno::Sequence< + css::uno::Reference< + css::linguistic2::XDictionary > > aDics; + + std::unique_ptr<SvxLinguData_Impl> pLinguData; + + std::unique_ptr<weld::Label> m_xLinguModulesFT; + std::unique_ptr<weld::TreeView> m_xLinguModulesCLB; + std::unique_ptr<weld::Button> m_xLinguModulesEditPB; + std::unique_ptr<weld::Label> m_xLinguDicsFT; + std::unique_ptr<weld::TreeView> m_xLinguDicsCLB; + std::unique_ptr<weld::Button> m_xLinguDicsNewPB; + std::unique_ptr<weld::Button> m_xLinguDicsEditPB; + std::unique_ptr<weld::Button> m_xLinguDicsDelPB; + std::unique_ptr<weld::TreeView> m_xLinguOptionsCLB; + std::unique_ptr<weld::Button> m_xLinguOptionsEditPB; + std::unique_ptr<weld::Box> m_xMoreDictsBox; + std::unique_ptr<weld::LinkButton> m_xMoreDictsLink; + + void AddDicBoxEntry( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx ); + static sal_uInt32 GetDicUserData( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx ); + + DECL_LINK( SelectHdl_Impl, weld::TreeView&, void ); + DECL_LINK( ClickHdl_Impl, weld::Button&, void ); + DECL_LINK( BoxDoubleClickHdl_Impl, weld::TreeView&, bool ); + DECL_LINK( ModulesBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); + DECL_LINK( DicsBoxCheckButtonHdl_Impl, const weld::TreeView::iter_col&, void ); + DECL_LINK( PostDblClickHdl_Impl, void *, void); + DECL_STATIC_LINK( SvxLinguTabPage, OnLinkClick, weld::LinkButton&, bool); + + void UpdateModulesBox_Impl(); + void UpdateDicBox_Impl(); + +public: + SvxLinguTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxLinguTabPage() override; + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + void HideGroups( sal_uInt16 nGrp ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx new file mode 100644 index 0000000000..ccfeb70e00 --- /dev/null +++ b/cui/source/inc/optpath.hxx @@ -0,0 +1,72 @@ +/* -*- 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 . + */ +#pragma once + +#include <memory> +#include <sfx2/tabdlg.hxx> + +#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp> +#include <svtools/dialogclosedlistener.hxx> +#include <unotools/pathoptions.hxx> + +// forward --------------------------------------------------------------- +struct OptPath_Impl; +class SvxPathTabPage; + +// class SvxPathTabPage -------------------------------------------------- +class SvxPathTabPage : public SfxTabPage +{ +private: + std::unique_ptr<OptPath_Impl> pImpl; + + rtl::Reference< ::svt::DialogClosedListener > xDialogListener; + css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker; + + std::unique_ptr<weld::Button> m_xStandardBtn; + std::unique_ptr<weld::Button> m_xPathBtn; + std::unique_ptr<weld::TreeView> m_xPathBox; + + void ChangeCurrentEntry( const OUString& _rFolder ); + + DECL_LINK(PathHdl_Impl, weld::Button&, void); + DECL_LINK(DoubleClickPathHdl_Impl, weld::TreeView&, bool); + DECL_LINK(StandardHdl_Impl, weld::Button&, void); + + DECL_LINK(PathSelect_Impl, weld::TreeView&, void); + DECL_LINK(HeaderBarClick, int, void); + + DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void); + + void GetPathList( SvtPathOptions::Paths _nPathHandle, OUString& _rInternalPath, + OUString& _rUserPath, OUString& _rWritablePath, bool& _rReadOnly ); + void SetPathList( SvtPathOptions::Paths _nPathHandle, + std::u16string_view _rUserPath, const OUString& _rWritablePath ); + +public: + SvxPathTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet ); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxPathTabPage() override; + + virtual OUString GetAllStrings() override; + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx new file mode 100644 index 0000000000..151569ac46 --- /dev/null +++ b/cui/source/inc/page.hxx @@ -0,0 +1,188 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/pagectrl.hxx> +#include <svx/pagenumberlistbox.hxx> +#include <svx/papersizelistbox.hxx> +#include <svx/frmdirlbox.hxx> +#include <i18nutil/paper.hxx> +#include <svx/flagsdef.hxx> +#include <vcl/print.hxx> + +// class SvxPageDescPage ------------------------------------------------- +/* + [Description] + TabPage for page settings (size, margins, ...) + + [Items] + <SvxPageItem>: <SID_ATTR_PAGE> + <SvxSizeItem>: <SID_ATTR_SIZE> + <SvxSizeItem>: <SID_ATTR_MAXSIZE> + <SvxULSpaceItem>: <SID_ATTR_LRSPACE> + <SvxLRSpaceItem>: <SID_ATTR_ULSPACE> + <SvxPaperBinItem>: <SID_ATTR_PAPERBIN> + <SvxBoolItem>: <SID_ATTR_EXT1> + <SvxBoolItem>: <SID_ATTR_EXT2> + + <SfxSetItem>: <SID_ATTR_HEADERSET> + <SfxBoolItem>: <SID_ATTR_ON> + <SfxBoolItem>: <SID_ATTR_DYNAMIC> + <SfxBoolItem>: <SID_ATTR_SHARED> + <SvxSizeItem>: <SID_ATTR_SIZE> + <SvxULSpaceItem>: <SID_ATTR_ULSPACE> + <SvxLRSpaceItem>: <SID_ATTR_LRSPACE> + + <SfxSetItem>: <SID_ATTR_FOOTERSET> + <SfxBoolItem>: <SID_ATTR_ON> + <SfxBoolItem>: <SID_ATTR_DYNAMIC> + <SfxBoolItem>: <SID_ATTR_SHARED> + <SvxSizeItem>: <SID_ATTR_SIZE> + <SvxULSpaceItem>: <SID_ATTR_ULSPACE> + <SvxLRSpaceItem>: <SID_ATTR_LRSPACE> +*/ + +typedef sal_uInt16 MarginPosition; + +class SvxPageDescPage : public SfxTabPage +{ + static const WhichRangesContainer pRanges; +private: + OUString sStandardRegister; + tools::Long nFirstLeftMargin; + tools::Long nFirstRightMargin; + tools::Long nFirstTopMargin; + tools::Long nFirstBottomMargin; + tools::Long nLastLeftMargin; + tools::Long nLastRightMargin; + tools::Long nLastTopMargin; + tools::Long nLastBottomMargin; + + bool bLandscape; + bool bBorderModified; + SvxModeType eMode; + Paper ePaperStart; + + MarginPosition m_nPos; + VclPtr<Printer> mpDefPrinter; + + bool mbDelPrinter : 1; + bool mbEnableDrawingLayerFillStyles : 1; + + SvxPageWindow m_aBspWin; + + // paper format + std::unique_ptr<SvxPaperSizeListBox> m_xPaperSizeBox; + std::unique_ptr<weld::MetricSpinButton> m_xPaperWidthEdit; + std::unique_ptr<weld::MetricSpinButton> m_xPaperHeightEdit; + std::unique_ptr<weld::RadioButton> m_xPortraitBtn; + std::unique_ptr<weld::RadioButton> m_xLandscapeBtn; + std::unique_ptr<weld::Label> m_xTextFlowLbl; + std::unique_ptr<svx::FrameDirectionListBox> m_xTextFlowBox; + std::unique_ptr<weld::ComboBox> m_xPaperTrayBox; + // Margins + std::unique_ptr<weld::Label> m_xLeftMarginLbl; + std::unique_ptr<weld::MetricSpinButton> m_xLeftMarginEdit; + std::unique_ptr<weld::Label> m_xRightMarginLbl; + std::unique_ptr<weld::MetricSpinButton> m_xRightMarginEdit; + std::unique_ptr<weld::MetricSpinButton> m_xTopMarginEdit; + std::unique_ptr<weld::MetricSpinButton> m_xBottomMarginEdit; + std::unique_ptr<weld::Label> m_xGutterMarginLbl; + std::unique_ptr<weld::MetricSpinButton> m_xGutterMarginEdit; + // layout settings + std::unique_ptr<weld::Label> m_xPageText; + std::unique_ptr<weld::ComboBox> m_xLayoutBox; + std::unique_ptr<weld::Label> m_xNumberFormatText; + std::unique_ptr<SvxPageNumberListBox> m_xNumberFormatBox; + //Extras Calc + std::unique_ptr<weld::Label> m_xTblAlignFT; + std::unique_ptr<weld::CheckButton> m_xHorzBox; + std::unique_ptr<weld::CheckButton> m_xVertBox; + // Impress and Draw + std::unique_ptr<weld::CheckButton> m_xAdaptBox; + //Register Writer + std::unique_ptr<weld::CheckButton> m_xRegisterCB; + std::unique_ptr<weld::Label> m_xRegisterFT; + std::unique_ptr<weld::ComboBox> m_xRegisterLB; + std::unique_ptr<weld::Label> m_xGutterPositionFT; + std::unique_ptr<weld::ComboBox> m_xGutterPositionLB; + std::unique_ptr<weld::CheckButton> m_xRtlGutterCB; + std::unique_ptr<weld::CheckButton> m_xBackgroundFullSizeCB; + std::unique_ptr<weld::Label> m_xInsideLbl; + std::unique_ptr<weld::Label> m_xOutsideLbl; + std::unique_ptr<weld::Label> m_xPrintRangeQueryText; + std::unique_ptr<weld::CustomWeld> m_xBspWin; + + void Init_Impl(); + DECL_LINK(LayoutHdl_Impl, weld::ComboBox&, void); + DECL_LINK(GutterPositionHdl_Impl, weld::ComboBox&, void); + DECL_LINK(PaperBinHdl_Impl, weld::Widget&, void); + DECL_LINK(SwapOrientation_Impl, weld::Toggleable&, void); + void SwapFirstValues_Impl( bool bSet ); + DECL_LINK(BorderModify_Impl, weld::MetricSpinButton&, void); + void InitHeadFoot_Impl( const SfxItemSet& rSet ); + DECL_LINK(CenterHdl_Impl, weld::Toggleable&, void); + void UpdateExample_Impl( bool bResetbackground = false ); + + DECL_LINK(PaperSizeSelect_Impl, weld::ComboBox&, void ); + DECL_LINK(PaperSizeModify_Impl, weld::MetricSpinButton&, void); + + DECL_LINK(FrameDirectionModify_Impl, weld::ComboBox&, void ); + + void ResetBackground_Impl( const SfxItemSet& rSet ); + + void RangeHdl_Impl(); + void CalcMargin_Impl(); + + DECL_LINK(RegisterModify, weld::Toggleable&, void); + + // page direction + /** Disables vertical page direction entries in the text flow listbox. */ + void DisableVerticalPageDir(); + + bool IsPrinterRangeOverflow(weld::MetricSpinButton& rField, tools::Long nFirstMargin, + tools::Long nLastMargin, MarginPosition nPos); + void CheckMarginEdits( bool _bClear ); + bool IsMarginOutOfRange() const; + +protected: + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + SvxPageDescPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxPageDescPage() override; + + // returns the range of the Which values + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* rOutSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void FillUserData() override; + + void SetPaperFormatRanges( Paper eStart ) + { ePaperStart = eStart; } + + void SetCollectionList(const std::vector<OUString> &aList); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx new file mode 100644 index 0000000000..9e78c83110 --- /dev/null +++ b/cui/source/inc/paragrph.hxx @@ -0,0 +1,311 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/relfld.hxx> +#include <svx/paraprev.hxx> +#include <svx/frmdirlbox.hxx> + +class SvxLineSpacingItem; + +// class SvxStdParagraphTabPage ------------------------------------------ +/* + [Description] + With this TabPage standard attributes of a paragraph can be set + (indention, distance, alignment, line spacing). + + [Items] + <SvxAdjustItem><SID_ATTR_PARA_ADJUST> + <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE> + <SvxULSpaceItem><SID_ATTR_ULSPACE> + <SvxLRSpaceItem><SID_ATTR_LRSPACE> +*/ + +class SvxStdParagraphTabPage: public SfxTabPage +{ + static const WhichRangesContainer pStdRanges; + +private: + tools::Long nWidth; + tools::Long nMinFixDist; + bool bRelativeMode; + OUString sAbsDist; + + SvxParaPrevWindow m_aExampleWin; + + // indentation + bool m_bSplitLRSpace = false; ///< which items to use? + SvxRelativeField m_aLeftIndent; + + SvxRelativeField m_aRightIndent; + + std::unique_ptr<weld::Label> m_xFLineLabel; + SvxRelativeField m_aFLineIndent; + std::unique_ptr<weld::CheckButton> m_xAutoCB; + + // distance + SvxRelativeField m_aTopDist; + SvxRelativeField m_aBottomDist; + std::unique_ptr<weld::CheckButton> m_xContextualCB; + + // line spacing + std::unique_ptr<weld::ComboBox> m_xLineDist; + std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtPercentBox; + std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtMetricBox; + std::unique_ptr<weld::MetricSpinButton> m_xLineDistAtPlaceHolderBox; + std::unique_ptr<weld::Label> m_xLineDistAtLabel; + std::unique_ptr<weld::Label> m_xAbsDist; + + // only writer + std::unique_ptr<weld::CheckButton> m_xRegisterCB; + + // preview + std::unique_ptr<weld::CustomWeld> m_xExampleWin; + + void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr ); + void Init_Impl(); + void UpdateExample_Impl(); + void ELRLoseFocus(); + + DECL_LINK(LineDistPopupHdl_Impl, weld::ComboBox&, void); + DECL_LINK(LineDistHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ModifyHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(AutoHdl_Impl, weld::Toggleable&, void); + + bool m_bLineDistToggled = false; + +protected: + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + +public: + SvxStdParagraphTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxStdParagraphTabPage() override; + + DECL_LINK(ELRLoseFocusHdl, weld::MetricSpinButton&, void); + + static WhichRangesContainer GetRanges() { return pStdRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + + void EnableRelativeMode(); + void EnableRegisterMode(); + void EnableContextualMode(); + void EnableAutoFirstLine(); + void EnableAbsLineDist(tools::Long nMinTwip); + void EnableNegativeMode(); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +// class SvxParaAlignTabPage ------------------------------------------------ + +class SvxParaAlignTabPage : public SfxTabPage +{ + static const WhichRangesContainer pAlignRanges, pSdrAlignRanges; + + bool m_bSdrVertAlign; + + SvxParaPrevWindow m_aExampleWin; + + // alignment + std::unique_ptr<weld::RadioButton> m_xLeft; + std::unique_ptr<weld::RadioButton> m_xRight; + std::unique_ptr<weld::RadioButton> m_xCenter; + std::unique_ptr<weld::RadioButton> m_xJustify; + std::unique_ptr<weld::Label> m_xLeftBottom; + std::unique_ptr<weld::Label> m_xRightTop; + + std::unique_ptr<weld::Label> m_xLastLineFT; + std::unique_ptr<weld::ComboBox> m_xLastLineLB; + std::unique_ptr<weld::CheckButton> m_xExpandCB; + + std::unique_ptr<weld::CheckButton> m_xSnapToGridCB; + + //preview + std::unique_ptr<weld::CustomWeld> m_xExampleWin; + //vertical alignment + std::unique_ptr<weld::Widget> m_xVertAlignFL; + std::unique_ptr<weld::ComboBox> m_xVertAlignLB; + std::unique_ptr<weld::Label> m_xVertAlign; + std::unique_ptr<weld::Label> m_xVertAlignSdr; + + std::unique_ptr<svx::FrameDirectionListBox> m_xTextDirectionLB; + + DECL_LINK(AlignHdl_Impl, weld::Toggleable&, void); + DECL_LINK(LastLineHdl_Impl, weld::ComboBox&, void); + DECL_LINK(TextDirectionHdl_Impl, weld::ComboBox&, void); + + void UpdateExample_Impl(); + +protected: + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +public: + SvxParaAlignTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxParaAlignTabPage() override; + + static WhichRangesContainer GetRanges() { return pAlignRanges; } + static WhichRangesContainer GetSdrRanges() { return pSdrAlignRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + + void EnableJustifyExt(); + void EnableSdrVertAlign(); + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +// class SvxExtParagraphTabPage ------------------------------------------ +/* + [Description] + With this TabPage special attributes of a paragraph can be set + (hyphenation, pagebreak, orphan, widow, ...). + + [Items] + <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE> + <SvxFormatBreakItem><SID_ATTR_PARA_PAGEBREAK> + <SvxFormatSplitItem><SID_ATTR_PARA_SPLIT> + <SvxWidowsItem><SID_ATTR_PARA_WIDOWS> + <SvxOrphansItem><SID_ATTR_PARA_ORPHANS> +*/ + +class SvxExtParagraphTabPage: public SfxTabPage +{ + static const WhichRangesContainer pExtRanges; + +public: + SvxExtParagraphTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, + const SfxItemSet* rSet ); + virtual ~SvxExtParagraphTabPage() override; + + static WhichRangesContainer GetRanges() { return pExtRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; + + void DisablePageBreak(); + +protected: + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +private: + weld::TriStateEnabled aHyphenState; + weld::TriStateEnabled aPageBreakState; + weld::TriStateEnabled aApplyCollState; + weld::TriStateEnabled aPageNumState; + weld::TriStateEnabled aAllowSplitState; + weld::TriStateEnabled aKeepParaState; + weld::TriStateEnabled aOrphanState; + weld::TriStateEnabled aWidowState; + + bool bPageBreak; + bool bHtmlMode; + sal_uInt16 nStdPos; + + // hyphenation + std::unique_ptr<weld::CheckButton> m_xHyphenBox; + std::unique_ptr<weld::CheckButton> m_xHyphenNoCapsBox; + std::unique_ptr<weld::CheckButton> m_xHyphenNoLastWordBox; + std::unique_ptr<weld::Label> m_xBeforeText; + std::unique_ptr<weld::SpinButton> m_xExtHyphenBeforeBox; + std::unique_ptr<weld::Label> m_xAfterText; + std::unique_ptr<weld::SpinButton> m_xExtHyphenAfterBox; + std::unique_ptr<weld::Label> m_xMaxHyphenLabel; + std::unique_ptr<weld::SpinButton> m_xMaxHyphenEdit; + std::unique_ptr<weld::Label> m_xMinWordLabel; + std::unique_ptr<weld::SpinButton> m_xMinWordLength; + std::unique_ptr<weld::Label> m_xHyphenZoneLabel; + SvxRelativeField m_aHyphenZone; + + // pagebreak + std::unique_ptr<weld::CheckButton> m_xPageBreakBox; + std::unique_ptr<weld::Label> m_xBreakTypeFT; + std::unique_ptr<weld::ComboBox> m_xBreakTypeLB; + std::unique_ptr<weld::Label> m_xBreakPositionFT; + std::unique_ptr<weld::ComboBox> m_xBreakPositionLB; + std::unique_ptr<weld::CheckButton> m_xApplyCollBtn; + std::unique_ptr<weld::ComboBox> m_xApplyCollBox; + std::unique_ptr<weld::CheckButton> m_xPageNumBox; + std::unique_ptr<weld::SpinButton> m_xPagenumEdit; + + // paragraph division + std::unique_ptr<weld::CheckButton> m_xAllowSplitBox; + std::unique_ptr<weld::CheckButton> m_xKeepParaBox; + + // orphan/widow + std::unique_ptr<weld::CheckButton> m_xOrphanBox; + std::unique_ptr<weld::SpinButton> m_xOrphanRowNo; + std::unique_ptr<weld::Label> m_xOrphanRowLabel; + + std::unique_ptr<weld::CheckButton> m_xWidowBox; + std::unique_ptr<weld::SpinButton> m_xWidowRowNo; + std::unique_ptr<weld::Label> m_xWidowRowLabel; + + void HyphenClickHdl(); + void PageNumBoxClickHdl(); + void ApplyCollClickHdl(); + void PageBreakHdl(); + void AllowSplitHdl(); + void OrphanHdl(); + void WidowHdl(); + + DECL_LINK(PageBreakHdl_Impl, weld::Toggleable&, void); + DECL_LINK(AllowSplitHdl_Impl, weld::Toggleable&, void); + DECL_LINK(WidowHdl_Impl, weld::Toggleable&, void); + DECL_LINK(OrphanHdl_Impl, weld::Toggleable&, void); + DECL_LINK(HyphenClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ApplyCollClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(PageBreakPosHdl_Impl, weld::ComboBox&, void); + DECL_LINK(PageBreakTypeHdl_Impl, weld::ComboBox&, void); + DECL_LINK(PageNumBoxClickHdl_Impl, weld::Toggleable&, void); + DECL_LINK(KeepParaBoxClickHdl_Impl, weld::Toggleable&, void); + + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +class SvxAsianTabPage : public SfxTabPage +{ + std::unique_ptr<weld::CheckButton> m_xForbiddenRulesCB; + std::unique_ptr<weld::CheckButton> m_xHangingPunctCB; + std::unique_ptr<weld::CheckButton> m_xScriptSpaceCB; + +public: + SvxAsianTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet); + virtual ~SvxAsianTabPage() override; + + static WhichRangesContainer GetRanges(); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + virtual void ChangesApplied() override; +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/passwdomdlg.hxx b/cui/source/inc/passwdomdlg.hxx new file mode 100644 index 0000000000..1077195f7a --- /dev/null +++ b/cui/source/inc/passwdomdlg.hxx @@ -0,0 +1,74 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/basedlgs.hxx> +#include <memory> + +class PasswordToOpenModifyDialog : public SfxDialogController +{ + std::unique_ptr<weld::Entry> m_xPasswdToOpenED; + std::unique_ptr<weld::Label> m_xPasswdToOpenInd; + std::unique_ptr<weld::LevelBar> m_xPasswdToOpenBar; + std::unique_ptr<weld::Entry> m_xReenterPasswdToOpenED; + std::unique_ptr<weld::Label> m_xReenterPasswdToOpenInd; + std::unique_ptr<weld::Expander> m_xOptionsExpander; + std::unique_ptr<weld::Button> m_xOk; + std::unique_ptr<weld::CheckButton> m_xOpenReadonlyCB; + std::unique_ptr<weld::Label> m_xPasswdToModifyFT; + std::unique_ptr<weld::Entry> m_xPasswdToModifyED; + std::unique_ptr<weld::Label> m_xPasswdToModifyInd; + std::unique_ptr<weld::LevelBar> m_xPasswdToModifyBar; + std::unique_ptr<weld::Label> m_xReenterPasswdToModifyFT; + std::unique_ptr<weld::Entry> m_xReenterPasswdToModifyED; + std::unique_ptr<weld::Label> m_xReenterPasswdToModifyInd; + std::shared_ptr<weld::MessageDialog> m_xErrorBox; + + OUString m_aOneMismatch; + OUString m_aTwoMismatch; + OUString m_aInvalidStateForOkButton; + OUString m_aInvalidStateForOkButton_v2; + std::optional<OUString> m_oPasswordPolicy; + + int m_nMaxPasswdLen; + bool m_bIsPasswordToModify; + bool m_bAllowEmpty; + + + DECL_LINK(OkBtnClickHdl, weld::Button&, void); + DECL_LINK(ReadonlyOnOffHdl, weld::Toggleable&, void); + DECL_LINK(ChangeHdl, weld::Entry&, void); + + PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ) = delete; + PasswordToOpenModifyDialog & operator = ( const PasswordToOpenModifyDialog & ) = delete; + +public: + PasswordToOpenModifyDialog(weld::Window* pParent, + sal_uInt16 nMaxPasswdLen /* 0 -> no max len enforced */, + bool bIsPasswordToModify ); + ~PasswordToOpenModifyDialog(); + + // AbstractPasswordToOpenModifyDialog + OUString GetPasswordToOpen() const; + OUString GetPasswordToModify() const; + bool IsRecommendToOpenReadonly() const; + void AllowEmpty(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx new file mode 100644 index 0000000000..72f7911f2c --- /dev/null +++ b/cui/source/inc/pastedlg.hxx @@ -0,0 +1,73 @@ +/* -*- 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 . + */ + +#pragma once + +#include <map> +#include <sot/formats.hxx> +#include <tools/globname.hxx> +#include <vcl/transfer.hxx> +#include <vcl/weld.hxx> + +struct TransferableObjectDescriptor; +class TransferableDataHelper; + +class SvPasteObjectDialog : public weld::GenericDialogController +{ + std::map< SotClipboardFormatId, OUString > aSupplementMap; + // Additional UNO command to be displayed along the supported paste formats + std::pair<OUString, OUString> aExtraCommand; + SvGlobalName aObjClassName; + OUString aObjName; + + std::unique_ptr<weld::Label> m_xFtObjectSource; + std::unique_ptr<weld::TreeView> m_xLbInsertList; + std::unique_ptr<weld::Button> m_xOKButton; + + weld::TreeView& ObjectLB() { return *m_xLbInsertList; } + + void SelectObject(); + DECL_LINK(SelectHdl, weld::TreeView&, void); + DECL_LINK(DoubleClickHdl, weld::TreeView&, bool); + +public: + SvPasteObjectDialog(weld::Window* pParent); + + void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName ); + void InsertUno( const OUString& sUnoCmd, const OUString& sLabel); + void SetObjName( const SvGlobalName & rClass, const OUString & rObjName ); + /** + * @brief PreGetFormat Prepares the dialog for running to get format of paste as a SotClipboardFormatId value by calling GetFormatOnly() + * @param aHelper + */ + void PreGetFormat( const TransferableDataHelper& aHelper); + /** + * @brief GetFormatOnly Returns a SotClipboardFormatId value. Should be called after actually running the dialog. + * @return + */ + SotClipboardFormatId GetFormatOnly(); + /** + * @brief GetFormat Prepares and runs the dialog, and returns a SotClipboardFormatId depending on the RET_OK result + * @param aHelper TransferableDataHelper containing the data to be pasted + * @return a SotClipboardFormatId value depending on the result of running the dialog + */ + SotClipboardFormatId GetFormat( const TransferableDataHelper& aHelper); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/postdlg.hxx b/cui/source/inc/postdlg.hxx new file mode 100644 index 0000000000..66fd07af62 --- /dev/null +++ b/cui/source/inc/postdlg.hxx @@ -0,0 +1,104 @@ +/* -*- 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 . + */ +#pragma once + +#include <sal/config.h> + +#include <string_view> + +#include <sfx2/basedlgs.hxx> + +// class SvxPostItDialog ------------------------------------------------- +/* + [Description] + In this dialog a note can be created or edited. If the + application holds a list of notes, it can be iterated + over this list with links. + + [Items] + <SvxPostItAuthorItem><SID_ATTR_POSTIT_AUTHOR> + <SvxPostItDateItem><SID_ATTR_POSTIT_DATE> + <SvxPostItTextItem><SID_ATTR_POSTIT_TEXT> +*/ + +class SvxPostItDialog : public SfxDialogController +{ +public: + SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet, + bool bPrevNext); + virtual ~SvxPostItDialog() override; + + static WhichRangesContainer GetRanges(); + const SfxItemSet* GetOutputItemSet() const { return m_xOutSet.get(); } + + void SetPrevHdl( const Link<SvxPostItDialog&,void>& rLink ) + { m_aPrevHdlLink = rLink; } + void SetNextHdl( const Link<SvxPostItDialog&,void>& rLink ) + { m_aNextHdlLink = rLink; } + + void EnableTravel(bool bNext, bool bPrev); + OUString GetNote() const + { + return m_xEditED->get_text(); + } + void SetNote(const OUString& rTxt) + { + m_xEditED->set_text(rTxt); + } + void ShowLastAuthor(std::u16string_view rAuthor, std::u16string_view rDate); + void DontChangeAuthor() + { + m_xAuthorBtn->set_sensitive(false); + } + void HideAuthor() + { + m_xInsertAuthor->hide(); + } + void set_title(const OUString& rTitle) + { + m_xDialog->set_title(rTitle); + } + std::shared_ptr<weld::Dialog> const & GetDialog() const + { + return m_xDialog; + } + +private: + const SfxItemSet& m_rSet; + std::unique_ptr<SfxItemSet> m_xOutSet; + + Link<SvxPostItDialog&,void> m_aPrevHdlLink; + Link<SvxPostItDialog&,void> m_aNextHdlLink; + + std::unique_ptr<weld::Label> m_xLastEditFT; + std::unique_ptr<weld::Label> m_xAltTitle; + std::unique_ptr<weld::TextView> m_xEditED; + std::unique_ptr<weld::Widget> m_xInsertAuthor; + std::unique_ptr<weld::Button> m_xAuthorBtn; + std::unique_ptr<weld::Button> m_xOKBtn; + std::unique_ptr<weld::Button> m_xPrevBtn; + std::unique_ptr<weld::Button> m_xNextBtn; + + DECL_LINK(Stamp, weld::Button&, void); + DECL_LINK(OKHdl, weld::Button&, void); + DECL_LINK(PrevHdl, weld::Button&, void); + DECL_LINK(NextHdl, weld::Button&, void); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/screenshotannotationdlg.hxx b/cui/source/inc/screenshotannotationdlg.hxx new file mode 100644 index 0000000000..1e41810a09 --- /dev/null +++ b/cui/source/inc/screenshotannotationdlg.hxx @@ -0,0 +1,39 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> +#include <memory> + +class ScreenshotAnnotationDlg_Impl; + +class ScreenshotAnnotationDlg : public weld::GenericDialogController +{ +private: + std::unique_ptr<ScreenshotAnnotationDlg_Impl> m_pImpl; + + ScreenshotAnnotationDlg(const ScreenshotAnnotationDlg&) = delete; + ScreenshotAnnotationDlg& operator=(const ScreenshotAnnotationDlg&) = delete; + +public: + ScreenshotAnnotationDlg(weld::Dialog& rParentDialog); + virtual ~ScreenshotAnnotationDlg() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx new file mode 100644 index 0000000000..b1b014771d --- /dev/null +++ b/cui/source/inc/scriptdlg.hxx @@ -0,0 +1,166 @@ +/* -*- 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 . + */ + +#pragma once + +#include <memory> +#include <sfx2/basedlgs.hxx> +#include <vcl/weld.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/script/browse/XBrowseNode.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> + +#include <unordered_map> + +#define OBJTYPE_METHOD 2L +#define OBJTYPE_SCRIPTCONTAINER 3L +#define OBJTYPE_SFROOT 4L + +typedef std::unordered_map < OUString, OUString > Selection_hash; + +class SFEntry; + +enum class InputDialogMode { + NEWLIB = 1, + NEWMACRO = 2, + RENAME = 3, +}; + +class CuiInputDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::Entry> m_xEdit; +public: + CuiInputDialog(weld::Window * pParent, InputDialogMode nMode); + OUString GetObjectName() const { return m_xEdit->get_text(); } + void SetObjectName(const OUString& rName) + { + m_xEdit->set_text(rName); + m_xEdit->select_region(0, -1); + } +}; + +class SFEntry final +{ +private: + bool loaded; + css::uno::Reference< css::script::browse::XBrowseNode > nodes; + css::uno::Reference< css::frame::XModel > model; +public: + SFEntry( const css::uno::Reference< css::script::browse::XBrowseNode >& entryNodes , + const css::uno::Reference< css::frame::XModel >& entryModel) { nodes = entryNodes; loaded=false; model = entryModel; } + SFEntry( const SFEntry& r ) { nodes = r.nodes; loaded = r.loaded; } + const css::uno::Reference< css::script::browse::XBrowseNode >& GetNode() const { return nodes ;} + const css::uno::Reference< css::frame::XModel >& GetModel() const { return model ;}; + bool isLoaded() const { return loaded; } + void setLoaded() { loaded=true; } +}; + +class SvxScriptOrgDialog : public SfxDialogController +{ + weld::Window* m_pParent; + OUString m_sLanguage; + static Selection_hash m_lastSelection; + const OUString m_delErrStr; + const OUString m_delErrTitleStr; + const OUString m_delQueryStr; + const OUString m_delQueryTitleStr; + const OUString m_createErrStr; + const OUString m_createDupStr; + const OUString m_createErrTitleStr; + const OUString m_renameErrStr; + const OUString m_renameErrTitleStr; + const OUString m_sMyMacros; + const OUString m_sProdMacros; + + std::unique_ptr<weld::TreeView> m_xScriptsBox; + std::unique_ptr<weld::TreeIter> m_xScratchIter; + std::unique_ptr<weld::Button> m_xRunButton; + std::unique_ptr<weld::Button> m_xCloseButton; + std::unique_ptr<weld::Button> m_xCreateButton; + std::unique_ptr<weld::Button> m_xEditButton; + std::unique_ptr<weld::Button> m_xRenameButton; + std::unique_ptr<weld::Button> m_xDelButton; + + DECL_LINK( ScriptSelectHdl, weld::TreeView&, void ); + DECL_LINK( ExpandingHdl, const weld::TreeIter&, bool ); + DECL_LINK( ButtonHdl, weld::Button&, void ); + static bool getBoolProperty( css::uno::Reference< css::beans::XPropertySet > const & xProps, OUString const & propName ); + void CheckButtons( css::uno::Reference< css::script::browse::XBrowseNode > const & node ); + + void createEntry(const weld::TreeIter& rEntry); + void renameEntry(const weld::TreeIter& rEntry); + void deleteEntry(const weld::TreeIter& rEntry); + css::uno::Reference<css::script::browse::XBrowseNode> getBrowseNode(const weld::TreeIter& rEntry); + css::uno::Reference<css::frame::XModel> getModel(const weld::TreeIter& rEntry); + OUString getListOfChildren( const css::uno::Reference< css::script::browse::XBrowseNode >& node, int depth ); + void StoreCurrentSelection(); + void RestorePreviousSelection(); + + void Init(std::u16string_view language); + void delUserData(const weld::TreeIter& rIter); + void deleteTree(const weld::TreeIter& rIter); + void deleteAllTree(); + void insertEntry(OUString const & rText, OUString const & rBitmap, + const weld::TreeIter* pParent, + bool bChildrenOnDemand, + std::unique_ptr< SFEntry > && aUserData, + std::u16string_view factoryURL, bool bSelect); + void insertEntry(OUString const & rText, OUString const & rBitmap, + const weld::TreeIter* pParent, + bool bChildrenOnDemand, + std::unique_ptr< SFEntry > && aUserData, + bool bSelect); + + void RequestSubEntries(const weld::TreeIter& rRootEntry, + css::uno::Reference< css::script::browse::XBrowseNode > const & node, + css::uno::Reference< css::frame::XModel>& model); + + static css::uno::Reference< css::script::browse::XBrowseNode > + getLangNodeFromRootNode( css::uno::Reference< css::script::browse::XBrowseNode > const & root, std::u16string_view language ); + + static css::uno::Reference< css::uno::XInterface > getDocumentModel( css::uno::Reference< css::uno::XComponentContext > const & xCtx, std::u16string_view docName ); + +public: + // prob need another arg in the ctor + // to specify the language or provider + SvxScriptOrgDialog(weld::Window* pParent, OUString language); + virtual ~SvxScriptOrgDialog() override; + + virtual short run() override; +}; + +class SvxScriptErrorDialog +{ +private: + struct DialogData { + weld::Window* pParent; + OUString sMessage; + }; + + DECL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, void*, void ); + +public: + + static void ShowAsyncErrorDialog( weld::Window* pParent, css::uno::Any const & aException ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx new file mode 100644 index 0000000000..46f34c0dae --- /dev/null +++ b/cui/source/inc/sdrcelldlg.hxx @@ -0,0 +1,48 @@ +/* -*- 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 . + */ + +#pragma once + + +#include <sfx2/tabdlg.hxx> +#include <svx/xtable.hxx> +#include <svx/tabarea.hxx> + +class SdrModel; +class SvxFormatCellsDialog : public SfxTabDialogController +{ +private: + const SfxItemSet& mrOutAttrs; + + XColorListRef mpColorTab; + ChangeType mnColorTabState; + XGradientListRef mpGradientList; + XHatchListRef mpHatchingList; + XBitmapListRef mpBitmapList; + XPatternListRef mpPatternList; + +public: + SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle); + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/showcols.hxx b/cui/source/inc/showcols.hxx new file mode 100644 index 0000000000..e378c5e197 --- /dev/null +++ b/cui/source/inc/showcols.hxx @@ -0,0 +1,45 @@ +/* -*- 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 . + */ + +#pragma once + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/container/XIndexContainer.hpp> +#include <vcl/weld.hxx> + +// FmShowColsDialog + +class FmShowColsDialog final : public weld::GenericDialogController +{ + std::unique_ptr<weld::TreeView> m_xList; + std::unique_ptr<weld::Button> m_xOK; + + css::uno::Reference<css::container::XIndexAccess> m_xColumns; + +public: + FmShowColsDialog(weld::Window* pParent); + virtual ~FmShowColsDialog() override; + + void SetColumns(const css::uno::Reference<css::container::XIndexContainer>& xCols); + +private: + DECL_LINK(OnClickedOk, weld::Button&, void); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx new file mode 100644 index 0000000000..ce14e0714a --- /dev/null +++ b/cui/source/inc/splitcelldlg.hxx @@ -0,0 +1,64 @@ +/* -*- 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 . + */ +#pragma once + +#include <svx/svxdlg.hxx> +#include <vcl/weld.hxx> + +class SvxSplitTableDlg : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::SpinButton> m_xCountEdit; + std::unique_ptr<weld::RadioButton> m_xHorzBox; + std::unique_ptr<weld::RadioButton> m_xVertBox; + std::unique_ptr<weld::CheckButton> m_xPropCB; + + tools::Long mnMaxVertical; + tools::Long mnMaxHorizontal; + +public: + SvxSplitTableDlg(weld::Window *pParent, bool bIsTableVertical, tools::Long nMaxVertical, tools::Long nMaxHorizontal); + + DECL_LINK(ToggleHdl, weld::Toggleable&, void); + + bool IsHorizontal() const; + bool IsProportional() const; + tools::Long GetCount() const; + + void SetSplitVerticalByDefault(); +}; + +class SvxAbstractSplitTableDialog_Impl : public SvxAbstractSplitTableDialog +{ + std::shared_ptr<SvxSplitTableDlg> m_xDlg; + +public: + SvxAbstractSplitTableDialog_Impl(std::shared_ptr<SvxSplitTableDlg> pDlg) : m_xDlg(std::move(pDlg)) {} + + virtual bool IsHorizontal() const override; + virtual bool IsProportional() const override; + virtual tools::Long GetCount() const override; + + virtual void SetSplitVerticalByDefault() override; + + virtual short Execute() override; + virtual bool StartExecuteAsync(AsyncContext& rContext) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx new file mode 100644 index 0000000000..712abc8b55 --- /dev/null +++ b/cui/source/inc/srchxtra.hxx @@ -0,0 +1,81 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svtools/ctrltool.hxx> +#include <svx/srchdlg.hxx> +#include <vcl/weld.hxx> + +class SvxSearchFormatDialog : public SfxTabDialogController +{ +public: + SvxSearchFormatDialog(weld::Window* pParent, const SfxItemSet& rSet); + virtual ~SvxSearchFormatDialog() override; + +protected: + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +private: + std::unique_ptr<FontList> m_pFontList; +}; + +// class SvxSearchFormatDialog ------------------------------------------- + +class SvxSearchAttributeDialog : public weld::GenericDialogController +{ +public: + SvxSearchAttributeDialog(weld::Window* pParent, SearchAttrItemList& rLst, + const WhichRangesContainer& pWhRanges); + virtual ~SvxSearchAttributeDialog() override; + +private: + SearchAttrItemList& rList; + + std::unique_ptr<weld::TreeView> m_xAttrLB; + std::unique_ptr<weld::Button> m_xOKBtn; + + DECL_LINK(OKHdl, weld::Button&, void); +}; + +// class SvxSearchSimilarityDialog --------------------------------------- + +class SvxSearchSimilarityDialog : public weld::GenericDialogController +{ +private: + std::unique_ptr<weld::SpinButton> m_xOtherFld; + std::unique_ptr<weld::SpinButton> m_xLongerFld; + std::unique_ptr<weld::SpinButton> m_xShorterFld; + std::unique_ptr<weld::CheckButton> m_xRelaxBox; + +public: + SvxSearchSimilarityDialog(weld::Window* pParent, + bool bRelax, + sal_uInt16 nOther, + sal_uInt16 nShorter, + sal_uInt16 nLonger); + virtual ~SvxSearchSimilarityDialog() override; + + sal_uInt16 GetOther() const { return static_cast<sal_uInt16>(m_xOtherFld->get_value()); } + sal_uInt16 GetShorter() const { return static_cast<sal_uInt16>(m_xShorterFld->get_value()); } + sal_uInt16 GetLonger() const { return static_cast<sal_uInt16>(m_xLongerFld->get_value()); } + bool IsRelaxed() const { return m_xRelaxBox->get_active(); } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx new file mode 100644 index 0000000000..eb73196986 --- /dev/null +++ b/cui/source/inc/swpossizetabpage.hxx @@ -0,0 +1,130 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/swframeexample.hxx> +#include <vcl/weld.hxx> + +// SvxSwPosSizeTabPage - position and size page for Writer drawing objects +struct FrmMap; +class SdrView; +struct SvxSwFrameValidation; +enum class SvxAnchorIds; + +class SvxSwPosSizeTabPage : public SfxTabPage +{ + Link<SvxSwFrameValidation&,void> m_aValidateLink; + + ::tools::Rectangle m_aRect; //size of all selected objects + ::tools::Rectangle m_aWorkArea; + Point m_aAnchorPos; + + FrmMap const * m_pVMap; + FrmMap const * m_pHMap; + const SdrView* m_pSdrView; + + // initial values + short m_nOldH; + short m_nOldHRel; + short m_nOldV; + short m_nOldVRel; + + double m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button + bool m_bHtmlMode; + bool m_bIsVerticalFrame; + bool m_bPositioningDisabled; + bool m_bIsMultiSelection; + bool m_bIsInRightToLeft; + TriState m_nProtectSizeState; + + SwFrameExample m_aExampleWN; + + std::unique_ptr<weld::MetricSpinButton> m_xWidthMF; + std::unique_ptr<weld::MetricSpinButton> m_xHeightMF; + std::unique_ptr<weld::CheckButton> m_xKeepRatioCB; + std::unique_ptr<weld::RadioButton> m_xToPageRB; + std::unique_ptr<weld::RadioButton> m_xToParaRB; + std::unique_ptr<weld::RadioButton> m_xToCharRB; + std::unique_ptr<weld::RadioButton> m_xAsCharRB; + std::unique_ptr<weld::RadioButton> m_xToFrameRB; + std::unique_ptr<weld::CheckButton> m_xPositionCB; + std::unique_ptr<weld::CheckButton> m_xSizeCB; + std::unique_ptr<weld::Widget> m_xPosFrame; + std::unique_ptr<weld::Label> m_xHoriFT; + std::unique_ptr<weld::ComboBox> m_xHoriLB; + std::unique_ptr<weld::Label> m_xHoriByFT; + std::unique_ptr<weld::MetricSpinButton> m_xHoriByMF; + std::unique_ptr<weld::Label> m_xHoriToFT; + std::unique_ptr<weld::ComboBox> m_xHoriToLB; + std::unique_ptr<weld::CheckButton> m_xHoriMirrorCB; + std::unique_ptr<weld::Label> m_xVertFT; + std::unique_ptr<weld::ComboBox> m_xVertLB; + std::unique_ptr<weld::Label> m_xVertByFT; + std::unique_ptr<weld::MetricSpinButton> m_xVertByMF; + std::unique_ptr<weld::Label> m_xVertToFT; + std::unique_ptr<weld::ComboBox> m_xVertToLB; + std::unique_ptr<weld::CheckButton> m_xFollowCB; + std::unique_ptr<weld::CustomWeld> m_xExampleWN; + + DECL_LINK(RangeModifyHdl, weld::Widget&, void); + DECL_LINK(RangeModifyClickHdl, weld::Toggleable&, void); + DECL_LINK(AnchorTypeHdl, weld::Toggleable&, void); + DECL_LINK(PosHdl, weld::ComboBox&, void); + DECL_LINK(RelHdl, weld::ComboBox&, void); + DECL_LINK(MirrorHdl, weld::Toggleable&, void); + DECL_LINK(ModifyHdl, weld::MetricSpinButton&, void); + DECL_LINK(ProtectHdl, weld::Toggleable&, void); + + void InitPos(RndStdIds nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel, + sal_uInt16 nV, sal_uInt16 nVRel, + tools::Long nX, tools::Long nY); + static sal_uInt16 GetMapPos(FrmMap const *pMap, const weld::ComboBox& rAlignLB); + static short GetAlignment(FrmMap const *pMap, sal_uInt16 nMapPos, const weld::ComboBox& rRelationLB); + static short GetRelation(const weld::ComboBox& rRelationLB); + RndStdIds GetAnchorType(bool* pbHasChanged = nullptr); + void FillRelLB(FrmMap const *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, weld::ComboBox& rLB, weld::Label& rFT); + sal_uInt16 FillPosLB(FrmMap const *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, weld::ComboBox& rLB); + + void UpdateExample(); + + void setOptimalFrmWidth(); + void setOptimalRelWidth(); + +public: + SvxSwPosSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + virtual ~SvxSwPosSizeTabPage() override; + + static WhichRangesContainer GetRanges(); + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void EnableAnchorTypes(SvxAnchorIds nAnchorEnable); + + void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ) + {m_aValidateLink = rLink;} + + void SetView( const SdrView* pSdrView ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx new file mode 100644 index 0000000000..207b8b7050 --- /dev/null +++ b/cui/source/inc/tabstpge.hxx @@ -0,0 +1,146 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/customweld.hxx> +#include <vcl/weld.hxx> +#include <sfx2/tabdlg.hxx> + +#include <editeng/tstpitem.hxx> +#include <svx/flagsdef.hxx> + +class SvxTabulatorTabPage; + +// class TabWin_Impl ----------------------------------------------------- + +class TabWin_Impl : public weld::CustomWidgetController +{ +private: + sal_uInt16 nTabStyle; + +public: + + TabWin_Impl() : nTabStyle(0) + { + } + virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override; + + void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; } +}; + +// class SvxTabulatorTabPage --------------------------------------------- +/* + [Description] + In this TabPage tabulators are managed. + + [Items] + <SvxTabStopItem><SID_ATTR_TABSTOP> + <SfxUInt16Item><SID_ATTR_TABSTOP_DEFAULTS> + <SfxUInt16Item><SID_ATTR_TABSTOP_POS> + <SfxInt32Item><SID_ATTR_TABSTOP_OFFSET> +*/ + +class SvxTabulatorTabPage : public SfxTabPage +{ + static const WhichRangesContainer pRanges; + +public: + SvxTabulatorTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + virtual ~SvxTabulatorTabPage() override; + + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + void DisableControls( const TabulatorDisableFlags nFlag ); + +protected: + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +private: + // local variables, internal functions + SvxTabStop aCurrentTab; + std::unique_ptr<SvxTabStopItem> aNewTabs; + tools::Long nDefDist; + + TabWin_Impl m_aLeftWin; + TabWin_Impl m_aRightWin; + TabWin_Impl m_aCenterWin; + TabWin_Impl m_aDezWin; + + // just to format the numbers, not shown + std::unique_ptr<weld::MetricSpinButton> m_xTabSpin; + // tabulators and positions + std::unique_ptr<weld::EntryTreeView> m_xTabBox; + // TabType + std::unique_ptr<weld::RadioButton> m_xLeftTab; + std::unique_ptr<weld::RadioButton> m_xRightTab; + std::unique_ptr<weld::RadioButton> m_xCenterTab; + std::unique_ptr<weld::RadioButton> m_xDezTab; + + std::unique_ptr<weld::Entry> m_xDezChar; + std::unique_ptr<weld::Label> m_xDezCharLabel; + + std::unique_ptr<weld::RadioButton> m_xNoFillChar; + std::unique_ptr<weld::RadioButton> m_xFillPoints; + std::unique_ptr<weld::RadioButton> m_xFillDashLine ; + std::unique_ptr<weld::RadioButton> m_xFillSolidLine; + std::unique_ptr<weld::RadioButton> m_xFillSpecial; + std::unique_ptr<weld::Entry> m_xFillChar; + + std::unique_ptr<weld::Button> m_xNewBtn; + std::unique_ptr<weld::Button> m_xDelAllBtn; + std::unique_ptr<weld::Button> m_xDelBtn; + + std::unique_ptr<weld::Container> m_xTypeFrame; + std::unique_ptr<weld::Container> m_xFillFrame; + + std::unique_ptr<weld::CustomWeld> m_xLeftWin; + std::unique_ptr<weld::CustomWeld> m_xRightWin; + std::unique_ptr<weld::CustomWeld> m_xCenterWin; + std::unique_ptr<weld::CustomWeld> m_xDezWin; + + void InitTabPos_Impl( sal_uInt16 nPos = 0 ); + void SetFillAndTabType_Impl(); + void NewHdl_Impl(const weld::Button*); + + OUString FormatTab(); + + // Handler + DECL_LINK(NewHdl_Impl, weld::Button&, void); + DECL_LINK(DelHdl_Impl, weld::Button&, void); + DECL_LINK(DelAllHdl_Impl, weld::Button&, void); + + DECL_LINK(FillTypeCheckHdl_Impl, weld::Toggleable&, void); + DECL_LINK(TabTypeCheckHdl_Impl, weld::Toggleable&, void); + + DECL_LINK(SelectHdl_Impl, weld::TreeView&, bool); + DECL_LINK(ModifyHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ReformatHdl_Impl, weld::Widget&, void); + DECL_LINK(GetFillCharHdl_Impl, weld::Widget&, void); + DECL_LINK(GetDezCharHdl_Impl, weld::Widget&, void); + + int FindCurrentTab(); + + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx new file mode 100644 index 0000000000..010d395471 --- /dev/null +++ b/cui/source/inc/textanim.hxx @@ -0,0 +1,105 @@ +/* -*- 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 . + */ +#pragma once + +#include <sfx2/tabdlg.hxx> +#include <svx/sdtakitm.hxx> +#include <svx/sdtaditm.hxx> +#include <vcl/weld.hxx> + +class SdrView; + +/************************************************************************* +|* +|* Page for changing TextAnimations (running text etc.) +|* +\************************************************************************/ + +class SvxTextAnimationPage : public SfxTabPage +{ +private: + static const WhichRangesContainer pRanges; + + SdrTextAniKind eAniKind; + FieldUnit eFUnit; + MapUnit eUnit; + + TriState m_aUpState; + TriState m_aLeftState; + TriState m_aRightState; + TriState m_aDownState; + + std::unique_ptr<weld::ComboBox> m_xLbEffect; + std::unique_ptr<weld::Widget> m_xBoxDirection; + std::unique_ptr<weld::ToggleButton> m_xBtnUp; + std::unique_ptr<weld::ToggleButton> m_xBtnLeft; + std::unique_ptr<weld::ToggleButton> m_xBtnRight; + std::unique_ptr<weld::ToggleButton> m_xBtnDown; + + std::unique_ptr<weld::Frame> m_xFlProperties; + std::unique_ptr<weld::CheckButton> m_xTsbStartInside; + std::unique_ptr<weld::CheckButton> m_xTsbStopInside; + + std::unique_ptr<weld::Widget> m_xBoxCount; + std::unique_ptr<weld::CheckButton> m_xTsbEndless; + std::unique_ptr<weld::SpinButton> m_xNumFldCount; + + std::unique_ptr<weld::CheckButton> m_xTsbPixel; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldAmount; + + std::unique_ptr<weld::CheckButton> m_xTsbAuto; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDelay; + + DECL_LINK( SelectEffectHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( ClickEndlessHdl_Impl, weld::Toggleable&, void ); + DECL_LINK( ClickAutoHdl_Impl, weld::Toggleable&, void ); + DECL_LINK( ClickPixelHdl_Impl, weld::Toggleable&, void ); + DECL_LINK( ClickDirectionHdl_Impl, weld::Button&, void ); + + void SelectDirection( SdrTextAniDirection nValue ); + sal_uInt16 GetSelectedDirection() const; + +public: + SvxTextAnimationPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxTextAnimationPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; +}; + +/************************************************************************* +|* +|* Text-Tab-Dialog +|* +\************************************************************************/ +class SvxTextTabDialog : public SfxTabDialogController +{ +private: + const SdrView* pView; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +public: + SvxTextTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrView* pView); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx new file mode 100644 index 0000000000..a6a7f2bd6f --- /dev/null +++ b/cui/source/inc/textattr.hxx @@ -0,0 +1,92 @@ +/* -*- 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 . + */ +#pragma once + +#include <svx/dlgctrl.hxx> +#include <svx/svdobjkind.hxx> + +class SdrView; + +/************************************************************************* +|* +|* Dialog for changing TextAttributes +|* +\************************************************************************/ + +class SvxTextAttrPage : public SvxTabPage +{ +private: + static const WhichRangesContainer pRanges; + + const SfxItemSet& rOutAttrs; + SdrObjKind m_eObjKind; + + bool bAutoGrowSizeEnabled; + bool bContourEnabled; + bool bAutoGrowWidthEnabled; + bool bAutoGrowHeightEnabled; + bool bWordWrapTextEnabled; + bool bFitToSizeEnabled; + + SvxRectCtl m_aCtlPosition; + + std::unique_ptr<weld::Widget> m_xDrawingText; + std::unique_ptr<weld::Widget> m_xCustomShapeText; + std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth; + std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight; + std::unique_ptr<weld::CheckButton> m_xTsbFitToSize; + std::unique_ptr<weld::CheckButton> m_xTsbContour; + std::unique_ptr<weld::CheckButton> m_xTsbWordWrapText; + std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowSize; + std::unique_ptr<weld::Frame> m_xFlDistance; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldLeft; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldRight; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldTop; + std::unique_ptr<weld::MetricSpinButton> m_xMtrFldBottom; + std::unique_ptr<weld::Frame> m_xFlPosition; + std::unique_ptr<weld::CustomWeld> m_xCtlPosition; + std::unique_ptr<weld::CheckButton> m_xTsbFullWidth; + + DECL_LINK(ClickFullWidthHdl_Impl, weld::Toggleable&, void); + DECL_LINK(ClickHdl_Impl, weld::Toggleable&, void); + + /** Return whether the text direction is from left to right (</sal_True>) or + top to bottom (</sal_False>). + */ + bool IsTextDirectionLeftToRight() const; + +public: + + SvxTextAttrPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxTextAttrPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void PointChanged( weld::DrawingArea* pWindow, RectPoint eRP ) override; + + void Construct(); + void SetObjKind(SdrObjKind eObjKind) { m_eObjKind = eObjKind; } + virtual void PageCreated(const SfxAllItemSet& aSet) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx new file mode 100644 index 0000000000..05865d68d9 --- /dev/null +++ b/cui/source/inc/thesdlg.hxx @@ -0,0 +1,82 @@ +/* -*- 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 . + */ +#pragma once + +#include <com/sun/star/linguistic2/XThesaurus.hpp> + +#include <vcl/idle.hxx> +#include <sfx2/basedlgs.hxx> + +#include <memory> +#include <stack> + +struct ImplSVEvent; + +class SvxThesaurusDialog : public SfxDialogController +{ + Idle m_aModifyIdle; + + css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus; + OUString aLookUpText; + LanguageType nLookUpLanguage; + std::stack< OUString > aLookUpHistory; + bool m_bWordFound; + + std::unique_ptr<weld::Button> m_xLeftBtn; + std::unique_ptr<weld::ComboBox> m_xWordCB; + std::unique_ptr<weld::TreeView> m_xAlternativesCT; + std::unique_ptr<weld::Label> m_xNotFound; + std::unique_ptr<weld::Entry> m_xReplaceEdit; + std::unique_ptr<weld::ComboBox> m_xLangLB; + std::unique_ptr<weld::Button> m_xReplaceBtn; + ImplSVEvent* m_nSelectFirstEvent; + +public: + virtual ~SvxThesaurusDialog() override; + + // Handler + DECL_LINK( ReplaceBtnHdl_Impl, weld::Button&, void ); + DECL_LINK( LeftBtnHdl_Impl, weld::Button&, void ); + DECL_LINK( LanguageHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( WordSelectHdl_Impl, weld::ComboBox&, void ); + DECL_LINK( AlternativesSelectHdl_Impl, weld::TreeView&, void ); + DECL_LINK( AlternativesDoubleClickHdl_Impl, weld::TreeView&, bool ); + DECL_LINK( SelectFirstHdl_Impl, void*, void ); + DECL_LINK( ReplaceEditHdl_Impl, weld::Entry&, void ); + DECL_LINK( ModifyTimer_Hdl, Timer *, void ); + DECL_LINK( KeyInputHdl, const KeyEvent&, bool ); + + /// @throws css::lang::IllegalArgumentException + /// @throws css::uno::RuntimeException + css::uno::Sequence< css::uno::Reference< css::linguistic2::XMeaning > > + queryMeanings_Impl( OUString& rTerm, const css::lang::Locale& rLocale, const css::beans::PropertyValues& rProperties ); + + bool UpdateAlternativesBox_Impl(); + void LookUp( const OUString &rText ); + void LookUp_Impl(); + +public: + SvxThesaurusDialog(weld::Widget* pParent, + css::uno::Reference< css::linguistic2::XThesaurus > const & xThesaurus, + const OUString &rWord, LanguageType nLanguage); + void SetWindowTitle( LanguageType nLanguage ); + OUString GetWord() const; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/tipofthedaydlg.hxx b/cui/source/inc/tipofthedaydlg.hxx new file mode 100644 index 0000000000..69af1996e4 --- /dev/null +++ b/cui/source/inc/tipofthedaydlg.hxx @@ -0,0 +1,50 @@ +/* -*- 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 . + */ +#pragma once + +#include <vcl/weld.hxx> +#include "cuigrfflt.hxx" + +class VclWindowEvent; + +class TipOfTheDayDialog : public weld::GenericDialogController +{ +private: + CuiGraphicPreviewWindow m_aPreview; + weld::Window* m_pParent; + + std::unique_ptr<weld::Label> m_pText; + std::unique_ptr<weld::CheckButton> m_pShowTip; + std::unique_ptr<weld::Button> m_pNext; + std::unique_ptr<weld::LinkButton> m_pLink; + std::unique_ptr<weld::CustomWeld> m_pPreview; + + sal_Int32 m_nCurrentTip; + void UpdateTip(); + DECL_LINK(OnNextClick, weld::Button&, void); + DECL_LINK(OnLinkClick, weld::LinkButton&, bool); + +public: + TipOfTheDayDialog(weld::Window* pWindow); + virtual ~TipOfTheDayDialog() override; + + DECL_LINK(Terminated, VclWindowEvent&, void); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/toolbarmodedlg.hxx b/cui/source/inc/toolbarmodedlg.hxx new file mode 100644 index 0000000000..5965aa7598 --- /dev/null +++ b/cui/source/inc/toolbarmodedlg.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <sal/config.h> + +#include <string_view> + +#include <vcl/weld.hxx> + +class ToolbarmodeDialog : public weld::GenericDialogController +{ +public: + ToolbarmodeDialog(weld::Window* pWindow); + virtual ~ToolbarmodeDialog() override; + +private: + std::unique_ptr<weld::Image> m_pImage; + std::unique_ptr<weld::Button> m_pApply; + std::unique_ptr<weld::Button> m_pApplyAll; + std::unique_ptr<weld::RadioButton> m_pRadioButtons[9]; + std::unique_ptr<weld::Label> m_pInfoLabel; + + void UpdateImage(std::u16string_view sFileName); + int GetActiveRadioButton(); + DECL_LINK(SelectToolbarmode, weld::Toggleable&, void); + DECL_LINK(OnApplyClick, weld::Button&, void); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx new file mode 100644 index 0000000000..0a30b720fc --- /dev/null +++ b/cui/source/inc/transfrm.hxx @@ -0,0 +1,248 @@ +/* -*- 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 . + */ +#pragma once + +#include <svx/dlgctrl.hxx> +#include <svx/dialcontrol.hxx> +#include <svx/anchorid.hxx> +#include <basegfx/range/b2drange.hxx> + +// predefines +class SdrView; + +/************************************************************************* +|* +|* Transform-Tab-Dialog +|* +\************************************************************************/ + +struct SvxSwFrameValidation; +class SvxTransformTabDialog : public SfxTabDialogController +{ +private: + const SdrView* pView; + + SvxAnchorIds nAnchorCtrls; + Link<SvxSwFrameValidation&,void> aValidateLink; + + virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override; + +public: + SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, + const SdrView* pView, + SvxAnchorIds nAnchorTypes); + + //link for the Writer to validate positions + void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink ); +}; + +/************************************************************************* +|* +|* position and size tab page +|* +\************************************************************************/ + +class SvxPositionSizeTabPage : public SvxTabPage +{ + static const WhichRangesContainer pPosSizeRanges; + +private: + const SfxItemSet& mrOutAttrs; + + const SdrView* mpView; + + // #i75273# + basegfx::B2DRange maRange; + basegfx::B2DRange maWorkRange; + basegfx::B2DPoint maAnchor; + + MapUnit mePoolUnit; + FieldUnit meDlgUnit; + TriState mnProtectSizeState; + bool mbPageDisabled; + bool mbProtectDisabled; + bool mbSizeDisabled; + bool mbAdjustDisabled; + bool mbIgnoreAutoGrowWidth; + bool mbIgnoreAutoGrowHeight; + + // from size + // #i75273# + double mfOldWidth; + double mfOldHeight; + RectPoint meRP; + + SvxRectCtl m_aCtlPos; + SvxRectCtl m_aCtlSize; + + // position + std::unique_ptr<weld::Widget> m_xFlPosition; + std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX; + std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY; + std::unique_ptr<weld::CustomWeld> m_xCtlPos; + + // size + std::unique_ptr<weld::Widget> m_xFlSize; + std::unique_ptr<weld::Label> m_xFtWidth; + std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth; + std::unique_ptr<weld::Label> m_xFtHeight; + std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight; + std::unique_ptr<weld::CheckButton> m_xCbxScale; + std::unique_ptr<weld::CustomWeld> m_xCtlSize; + + // protect + std::unique_ptr<weld::Widget> m_xFlProtect; + std::unique_ptr<weld::CheckButton> m_xTsbPosProtect; + std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect; + + // adjust + std::unique_ptr<weld::Widget> m_xFlAdjust; + std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth; + std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight; + + DECL_LINK(ChangePosProtectHdl, weld::Toggleable&, void); + DECL_LINK(ChangeSizeProtectHdl, weld::Toggleable&, void); + + void SetMinMaxPosition(); + void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange); + + DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ClickSizeProtectHdl, weld::Toggleable&, void ); + DECL_LINK( ClickAutoHdl, weld::Toggleable&, void ); + +public: + SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxPositionSizeTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pPosSizeRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override; + + void Construct(); + void SetView( const SdrView* pSdrView ) { mpView = pSdrView; } + + virtual void FillUserData() override; + + void DisableResize(); + void DisableProtect(); + + void UpdateControlStates(); +}; + +/************************************************************************* +|* +|* rotation angle tab page +|* +\************************************************************************/ +class SvxAngleTabPage : public SvxTabPage +{ + static const WhichRangesContainer pAngleRanges; + +private: + const SdrView* pView; + + // #i75273# + basegfx::B2DRange maRange; + basegfx::B2DPoint maAnchor; + + MapUnit ePoolUnit; + FieldUnit eDlgUnit; + + SvxRectCtl m_aCtlRect; + + std::unique_ptr<weld::Widget> m_xFlPosition; + std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX; + std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY; + std::unique_ptr<weld::CustomWeld> m_xCtlRect; + std::unique_ptr<weld::Widget> m_xFlAngle; + std::unique_ptr<weld::MetricSpinButton> m_xNfAngle; + std::unique_ptr<svx::DialControl> m_xCtlAngle; + std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin; + +public: + SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxAngleTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pAngleRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override; + + void Construct(); + void SetView( const SdrView* pSdrView ) { pView = pSdrView; } +}; + +/************************************************************************* +|* +|* slant/corner radius tab page +|* +\************************************************************************/ +class SvxSlantTabPage : public SfxTabPage +{ + static const WhichRangesContainer pSlantRanges; + +private: + const SdrView* pView; + + MapUnit ePoolUnit; + FieldUnit eDlgUnit; + + std::unique_ptr<weld::Widget> m_xFlRadius; + std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius; + std::unique_ptr<weld::Widget> m_xFlAngle; + std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle; + std::unique_ptr<weld::Widget> m_aControlGroups[2]; + std::unique_ptr<weld::Widget> m_aControlGroupX[2]; + std::unique_ptr<weld::MetricSpinButton> m_aControlX[2]; + std::unique_ptr<weld::Widget> m_aControlGroupY[2]; + std::unique_ptr<weld::MetricSpinButton> m_aControlY[2]; + +public: + SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); + virtual ~SvxSlantTabPage() override; + + static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* ); + static WhichRangesContainer GetRanges() { return pSlantRanges; } + + virtual bool FillItemSet( SfxItemSet* ) override; + virtual void Reset( const SfxItemSet * ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + void Construct(); + void SetView( const SdrView* pSdrView ) { pView = pSdrView; } +}; + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx new file mode 100644 index 0000000000..307c70f9ed --- /dev/null +++ b/cui/source/inc/treeopt.hxx @@ -0,0 +1,291 @@ +/* -*- 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 . + */ + +#pragma once + +#include <sal/config.h> + +#include <memory> + +#include <sfx2/basedlgs.hxx> +#include <svtools/restartdialog.hxx> +#include <utility> +#include <i18nutil/searchopt.hxx> +#include <vcl/timer.hxx> + +class SfxModule; +class SfxShell; + +// struct OrderedEntry --------------------------------------------------- + +struct OrderedEntry +{ + sal_Int32 m_nIndex; + OUString m_sId; + + OrderedEntry( sal_Int32 nIndex, OUString aId ) : + m_nIndex( nIndex ), m_sId(std::move( aId )) {} +}; + + +// struct Module --------------------------------------------------------- + +struct Module +{ + bool m_bActive; + std::vector< std::unique_ptr<OrderedEntry> > m_aNodeList; + + Module() : m_bActive( false ) {} +}; + +// struct OptionsLeaf ---------------------------------------------------- + +struct OptionsLeaf +{ + OUString m_sLabel; + OUString m_sPageURL; + OUString m_sEventHdl; + OUString m_sGroupId; + sal_Int32 m_nGroupIndex; + + OptionsLeaf( OUString aLabel, + OUString aPageURL, + OUString aEventHdl, + OUString aGroupId, + sal_Int32 nGroupIndex ) : + m_sLabel(std::move( aLabel )), + m_sPageURL(std::move( aPageURL )), + m_sEventHdl(std::move( aEventHdl )), + m_sGroupId(std::move( aGroupId )), + m_nGroupIndex( nGroupIndex ) {} +}; + +// struct OptionsNode ---------------------------------------------------- + +struct OptionsNode +{ + OUString m_sId; + OUString m_sLabel; + bool m_bAllModules; + std::vector< std::unique_ptr<OptionsLeaf> > m_aLeaves; + std::vector< std::vector< std::unique_ptr<OptionsLeaf> > > + m_aGroupedLeaves; + + OptionsNode( OUString aId, + OUString aLabel, + bool bAllModules ) : + m_sId(std::move( aId )), + m_sLabel(std::move( aLabel )), + m_bAllModules( bAllModules ) {} +}; + +typedef std::vector< std::unique_ptr<OptionsNode> > VectorOfNodes; + +struct LastPageSaver +{ + sal_uInt16 m_nLastPageId; + OUString m_sLastPageURL_Tools; + OUString m_sLastPageURL_ExtMgr; + + LastPageSaver() : m_nLastPageId( USHRT_MAX ) {} +}; + +// class OfaTreeOptionsDialog -------------------------------------------- + +namespace com::sun::star::frame { class XFrame; } +namespace com::sun::star::awt { class XContainerWindowProvider; } + +struct OptionsPageInfo; +struct Module; +class ExtensionsTabPage; +class SvxColorTabPage; +struct OptionsGroupInfo; +struct OptionsPageIdInfo; + +class OfaTreeOptionsDialog final: public SfxOkDialogController +{ +private: + std::unique_ptr<weld::Button> xOkPB; + std::unique_ptr<weld::Button> xApplyPB; + std::unique_ptr<weld::Button> xBackPB; + + std::unique_ptr<weld::TreeView> xTreeLB; + std::unique_ptr<weld::Container> xTabBox; + std::unique_ptr<weld::Entry> m_xSearchEdit; + + weld::Window* m_pParent; + + std::unique_ptr<weld::TreeIter> xCurrentPageEntry; + + // For search + Timer m_aUpdateDataTimer; + i18nutil::SearchOptions2 m_options; + + bool bIsFirtsInitialize; + std::vector<OptionsPageIdInfo*> m_aTreePageIds; + typedef std::vector<std::pair<sal_uInt16, std::vector<sal_uInt16>>> VectorOfMatchedIds; + + void generalOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_GENERAL_OPTIONS + void loadAndSaveOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_FILTER_DLG + void languageOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_LANGUAGE_OPTIONS + void writerOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SW_EDITOPTIONS + void writerWebOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SW_ONLINEOPTIONS + void calcOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SC_EDITOPTIONS + void impressOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SD_EDITOPTIONS + void drawOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SD_GRAPHIC_OPTIONS + void mathOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SM_EDITOPTIONS + void databaseOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SB_STARBASEOPTIONS + void chartOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_SCH_EDITOPTIONS + void internetOptions(const std::vector<sal_uInt16>& vPageId = {}); // SID_INET_DLG + + void clearOptionsDialog(); + void selectFirstEntry(); + void storeOptionsTree(); + void showDialog(VectorOfMatchedIds& pSearchIds); + + OUString sTitle; + + bool bForgetSelection; + bool bIsFromExtensionManager; + + // check "for the current document only" and set focus to "Western" languages box + bool bIsForSetDocumentLanguage; + + bool bNeedsRestart; + svtools::RestartReason eRestartReason; + + css::uno::Reference < css::awt::XContainerWindowProvider > + m_xContainerWinProvider; + css::uno::Reference<css::frame::XFrame> m_xFrame; + + static LastPageSaver* pLastPageSaver; + + std::optional<SfxItemSet> CreateItemSet( sal_uInt16 nId ); + static void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ); + void Initialize( const css::uno::Reference< css::frame::XFrame >& _xFrame ); + + void LoadExtensionOptions( std::u16string_view rExtensionId ); + static OUString GetModuleIdentifier( const css::uno::Reference< + css::frame::XFrame >& xFrame ); + static std::unique_ptr<Module> LoadModule( std::u16string_view rModuleIdentifier ); + static VectorOfNodes LoadNodes( Module* pModule, std::u16string_view rExtensionId ); + void InsertNodes( const VectorOfNodes& rNodeList ); + + void ApplyOptions(); + + DECL_LINK(ShowPageHdl_Impl, weld::TreeView&, void); + DECL_LINK(BackHdl_Impl, weld::Button&, void); + DECL_LINK(ApplyHdl_Impl, weld::Button&, void); + DECL_LINK(HelpHdl_Impl, weld::Widget&, bool); + DECL_LINK(SearchUpdateHdl, weld::Entry&, void); + DECL_LINK(ImplUpdateDataHdl, Timer*, void); + DECL_LINK(FocusOut_Impl, weld::Widget&, void); + void ResetCurrentPageFromConfig(); + void SelectHdl_Impl(); + void initializeCurrentDialog(OptionsPageInfo*& pPageInfo, + std::unique_ptr<weld::TreeIter>& xEntry); + + void InitItemSets(OptionsGroupInfo& rGroupInfo); + + virtual short run() override; + + virtual weld::Button& GetOKButton() const override { return *xOkPB; } + virtual const SfxItemSet* GetExampleSet() const override { return nullptr; } + + int applySearchFilter(const OUString& rSearchTerm); + + // Common initialization + OfaTreeOptionsDialog(weld::Window* pParent, bool fromExtensionManager); + +public: + OfaTreeOptionsDialog(weld::Window* pParent, + const css::uno::Reference< css::frame::XFrame >& _xFrame, + bool bActivateLastSelection); + OfaTreeOptionsDialog(weld::Window* pParent, std::u16string_view rExtensionId); + virtual ~OfaTreeOptionsDialog() override; + + OptionsPageInfo* AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup ); + sal_uInt16 AddGroup( const OUString& rGroupName, SfxShell* pCreateShell, + SfxModule* pCreateModule, sal_uInt16 nDialogId ); + + void ActivateLastSelection(); + void ActivatePage( sal_uInt16 nResId ); + void ActivatePage( const OUString& rPageURL ); + void ApplyItemSets(); + + // default value initializes all dialogs + void initializeFirstNDialog(sal_Int16 nNumberOfNode = -1); + + // helper functions to call the Languages and Locales TabPage from the SpellDialog + static void ApplyLanguageOptions(const SfxItemSet& rSet); + static OUString getCurrentFactory_Impl( const css::uno::Reference< css::frame::XFrame >& _xFrame ); + + void SetNeedsRestart( svtools::RestartReason eReason ); +}; + +// class ExtensionsTabPage ----------------------------------------------- + +namespace com::sun::star::awt { class XWindow; } +namespace com::sun::star::awt { class XContainerWindowEventHandler; } + +class ExtensionsTabPage +{ +private: + weld::Container* m_pContainer; + OUString m_sPageURL; + css::uno::Reference<css::awt::XWindow> m_xPageParent; + css::uno::Reference<css::awt::XWindow> m_xPage; + OUString m_sEventHdl; + css::uno::Reference< css::awt::XContainerWindowEventHandler > + m_xEventHdl; + css::uno::Reference< css::awt::XContainerWindowProvider > + m_xWinProvider; + + void CreateDialogWithHandler(); + bool DispatchAction( const OUString& rAction ); + +public: + ExtensionsTabPage( + weld::Container* pParent, + OUString rPageURL, OUString aEvtHdl, + const css::uno::Reference< + css::awt::XContainerWindowProvider >& rProvider ); + + ~ExtensionsTabPage(); + + void Show(); + void Hide(); + + void ActivatePage(); + void DeactivatePage(); + + void ResetPage(); + void SavePage(); +}; + +// class TreeOptHelper --------------------------------------------------- + +class TreeOptHelper +{ +public: + static void storeStringsOfDialog(sal_uInt16 nPageId, const OUString& sPageStrings); + static OUString getStringsFromDialog(sal_uInt16 nPageId); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/zoom.hxx b/cui/source/inc/zoom.hxx new file mode 100644 index 0000000000..f44998378d --- /dev/null +++ b/cui/source/inc/zoom.hxx @@ -0,0 +1,67 @@ +/* -*- 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 . + */ +#pragma once + +#include <memory> +#include <sfx2/basedlgs.hxx> +#include <svl/itemset.hxx> +#include <svx/zoom_def.hxx> +#include <vcl/weld.hxx> + +class SvxZoomDialog : public SfxDialogController +{ +private: + const SfxItemSet& m_rSet; + std::unique_ptr<SfxItemSet> m_pOutSet; + bool m_bModified; + + std::unique_ptr<weld::RadioButton> m_xOptimalBtn; + std::unique_ptr<weld::RadioButton> m_xWholePageBtn; + std::unique_ptr<weld::RadioButton> m_xPageWidthBtn; + std::unique_ptr<weld::RadioButton> m_x100Btn; + std::unique_ptr<weld::RadioButton> m_xUserBtn; + std::unique_ptr<weld::MetricSpinButton> m_xUserEdit; + std::unique_ptr<weld::Widget> m_xViewFrame; + std::unique_ptr<weld::RadioButton> m_xAutomaticBtn; + std::unique_ptr<weld::RadioButton> m_xSingleBtn; + std::unique_ptr<weld::RadioButton> m_xColumnsBtn; + std::unique_ptr<weld::SpinButton> m_xColumnsEdit; + std::unique_ptr<weld::CheckButton> m_xBookModeChk; + std::unique_ptr<weld::Button> m_xOKBtn; + + DECL_LINK(UserHdl, weld::Toggleable&, void); + DECL_LINK(SpinHdl, weld::MetricSpinButton&, void); + DECL_LINK(ViewLayoutUserHdl, weld::Toggleable&, void); + DECL_LINK(ViewLayoutSpinHdl, weld::SpinButton&, void); + DECL_LINK(ViewLayoutCheckHdl, weld::Toggleable&, void); + DECL_LINK(OKHdl, weld::Button&, void); + +public: + SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet); + + const SfxItemSet* GetOutputItemSet() const; + + sal_uInt16 GetFactor() const; + void SetFactor(sal_uInt16 nNewFactor, ZoomButtonId nButtonId = ZoomButtonId::NONE); + + void HideButton(ZoomButtonId nButtonId); + void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |