From 47378fcb3ca35bbe9fc27e9c062479dc5812138b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 May 2023 11:51:44 +0200 Subject: move some gallery header files inside svx They are not used outside svx. Change-Id: Ib9ef73ec19a12401ea808922aba49e0ce1625378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151501 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/gallery1.hxx | 12 +-- include/svx/gallerybinaryengine.hxx | 111 -------------------------- include/svx/gallerybinaryengineentry.hxx | 67 ---------------- include/svx/gallerybinarystoragelocations.hxx | 52 ------------ include/svx/galleryfilestorage.hxx | 28 ------- include/svx/galleryfilestorageentry.hxx | 28 ------- include/svx/galleryobjectcollection.hxx | 4 +- include/svx/gallerystoragelocations.hxx | 33 -------- include/svx/galtheme.hxx | 17 ++-- 9 files changed, 19 insertions(+), 333 deletions(-) delete mode 100644 include/svx/gallerybinaryengine.hxx delete mode 100644 include/svx/gallerybinaryengineentry.hxx delete mode 100644 include/svx/gallerybinarystoragelocations.hxx delete mode 100644 include/svx/galleryfilestorage.hxx delete mode 100644 include/svx/galleryfilestorageentry.hxx delete mode 100644 include/svx/gallerystoragelocations.hxx (limited to 'include/svx') diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx index 708d6fa0d718..7b6fe2b23dc5 100644 --- a/include/svx/gallery1.hxx +++ b/include/svx/gallery1.hxx @@ -24,18 +24,19 @@ #include #include #include -#include -#include #include #include #include +class Gallery; +class GalleryBinaryEngine; class GalleryBinaryEngineEntry; +class GalleryObjectCollection; class GalleryStorageLocations; class GalleryTheme; -class GalleryThemeEntry +class SVXCORE_DLLPUBLIC GalleryThemeEntry { private: @@ -52,10 +53,11 @@ public: const OUString& rName, bool bReadOnly, bool bNewFile, sal_uInt32 nId, bool bThemeNameFromResource ); - + ~GalleryThemeEntry(); + const std::unique_ptr& getGalleryStorageEngineEntry() const { return mpGalleryStorageEngineEntry; } - GalleryStorageLocations& getGalleryStorageLocations() const { return *mpGalleryStorageEngineEntry->getGalleryStorageLocations(); } + GalleryStorageLocations& getGalleryStorageLocations() const; GalleryTheme* createGalleryTheme(Gallery* pGallery); diff --git a/include/svx/gallerybinaryengine.hxx b/include/svx/gallerybinaryengine.hxx deleted file mode 100644 index 5e89b5dd756d..000000000000 --- a/include/svx/gallerybinaryengine.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- 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 -#include -#include -#include -#include -#include -#include - -#include - -#include - -class GalleryStorageLocations; -class GalleryBinaryStorageLocations; -class GalleryObjectCollection; -class SgaObjectSvDraw; -class SgaObjectBmp; -class SgaObject; -class SotStorage; -struct GalleryObject; -class FmFormModel; -class GalleryTheme; -class GalleryThemeEntry; - -class SVXCORE_DLLPUBLIC GalleryBinaryEngine final : public GalleryFileStorage -{ -private: - tools::SvRef m_aSvDrawStorageRef; - const GalleryBinaryStorageLocations& maGalleryStorageLocations; - GalleryObjectCollection& mrGalleryObjectCollection; - bool mbReadOnly; - OUString m_aDestDir; - bool m_bDestDirRelative; - - const INetURLObject& GetSdgURL() const { return maGalleryStorageLocations.GetSdgURL(); } - const INetURLObject& GetSdvURL() const { return maGalleryStorageLocations.GetSdvURL(); } - const INetURLObject& GetStrURL() const { return maGalleryStorageLocations.GetStrURL(); } - const INetURLObject& GetThmURL() const { return maGalleryStorageLocations.GetThmURL(); } - -public: - GalleryBinaryEngine(const GalleryBinaryStorageLocations& rGalleryStorageLocations, - GalleryObjectCollection& rGalleryObjectCollection, bool bReadOnly); - SAL_DLLPRIVATE ~GalleryBinaryEngine(); - - void clearSotStorage(); - - void setDestDir(const OUString& rDestDir, bool bRelative); - - SAL_DLLPRIVATE void ImplCreateSvDrawStorage(); - SAL_DLLPRIVATE const tools::SvRef& GetSvDrawStorage() const; - - const INetURLObject& getThemeURL() const { return maGalleryStorageLocations.getThemeURL(); } - - SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme, const GalleryThemeEntry* pThm); - - void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, sal_uInt32 nInsertPos); - void removeObject(const std::unique_ptr& pEntry); - - std::unique_ptr implReadSgaObject(GalleryObject const* pEntry); - bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry); - - bool readModel(const GalleryObject* pObject, SdrModel& rModel); - SgaObjectSvDraw insertModel(const FmFormModel& rModel, const INetURLObject& rUserURL); - - bool readModelStream(const GalleryObject* pObject, - tools::SvRef const& rxModelStream); - SgaObjectSvDraw insertModelStream(const tools::SvRef& rxModelStream, - const INetURLObject& rUserURL); - - INetURLObject implCreateUniqueURL(SgaObjKind eObjKind, const INetURLObject& rUserURL, - ConvertDataFormat nFormat = ConvertDataFormat::Unknown); - - SgaObjectBmp insertGraphic(const Graphic& rGraphic, const GfxLink& aGfxLink, - const ConvertDataFormat& nExportFormat, - const INetURLObject& rUserURL); - - SgaObjectSvDraw updateSvDrawObject(const GalleryObject* pEntry); - - void updateTheme(); - static void insertFileOrDirURL(const INetURLObject& rFileOrDirURL, - std::vector& rURLVector); - - SvStream& writeGalleryTheme(SvStream& rOStm, const GalleryTheme& rTheme, - const GalleryThemeEntry* pThm); - - DateTime getModificationDate() const; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/gallerybinaryengineentry.hxx b/include/svx/gallerybinaryengineentry.hxx deleted file mode 100644 index f624e9177bd5..000000000000 --- a/include/svx/gallerybinaryengineentry.hxx +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- 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 -#include -#include -#include - -class GalleryBinaryStorageLocations; -class GalleryObjectCollection; -class GalleryBinaryEngine; - -class GalleryBinaryEngineEntry final : public GalleryFileStorageEntry -{ -private: - std::unique_ptr mpGalleryStorageLocations; - -public: - GalleryBinaryEngineEntry(); - static void CreateUniqueURL(const INetURLObject& rBaseURL, INetURLObject& aURL); - - OUString ReadStrFromIni(std::u16string_view aKeyName) const; - - const INetURLObject& GetThmURL() const { return mpGalleryStorageLocations->GetThmURL(); } - const INetURLObject& GetSdgURL() const { return mpGalleryStorageLocations->GetSdgURL(); } - const INetURLObject& GetSdvURL() const { return mpGalleryStorageLocations->GetSdvURL(); } - const INetURLObject& GetStrURL() const { return mpGalleryStorageLocations->GetStrURL(); } - - const std::unique_ptr& getGalleryStorageLocations() const - { - return mpGalleryStorageLocations; - } - - static GalleryThemeEntry* CreateThemeEntry(const INetURLObject& rURL, bool bReadOnly); - - void removeTheme(); - - std::unique_ptr& getCachedTheme(std::unique_ptr& pNewTheme); - - void setStorageLocations(INetURLObject& rURL); - - std::unique_ptr - createGalleryStorageEngine(GalleryObjectCollection& mrGalleryObjectCollection, bool& bReadOnly); -}; - -SvStream& ReadGalleryTheme(SvStream& rIn, GalleryTheme& rTheme); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/gallerybinarystoragelocations.hxx b/include/svx/gallerybinarystoragelocations.hxx deleted file mode 100644 index 6876c64a2a17..000000000000 --- a/include/svx/gallerybinarystoragelocations.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- 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 -#include - -class SVXCORE_DLLPUBLIC GalleryBinaryStorageLocations final : public GalleryStorageLocations -{ -private: - INetURLObject maThmURL; - INetURLObject maSdgURL; - INetURLObject maSdvURL; - INetURLObject maStrURL; - - void SetThmExtension(INetURLObject& aURL); - void SetSdgExtension(INetURLObject& aURL); - void SetSdvExtension(INetURLObject& aURL); - void SetStrExtension(INetURLObject& aURL); - -public: - static INetURLObject ImplGetURLIgnoreCase(const INetURLObject& rURL); - - const INetURLObject& GetThmURL() const { return maThmURL; } - const INetURLObject& GetSdgURL() const { return maSdgURL; } - const INetURLObject& GetSdvURL() const { return maSdvURL; } - const INetURLObject& GetStrURL() const { return maStrURL; } - - void SetStorageLocations(INetURLObject& aURL); - - const INetURLObject& getThemeURL() const { return maSdgURL; } -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galleryfilestorage.hxx b/include/svx/galleryfilestorage.hxx deleted file mode 100644 index fee632e9b397..000000000000 --- a/include/svx/galleryfilestorage.hxx +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- 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 - -class GalleryFileStorage -{ -public: - virtual ~GalleryFileStorage() = 0; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galleryfilestorageentry.hxx b/include/svx/galleryfilestorageentry.hxx deleted file mode 100644 index 0f00cfb5a6ee..000000000000 --- a/include/svx/galleryfilestorageentry.hxx +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- 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 - -class GalleryFileStorageEntry -{ -public: - virtual ~GalleryFileStorageEntry() = 0; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galleryobjectcollection.hxx b/include/svx/galleryobjectcollection.hxx index ec27761cc07e..a363f06de4ca 100644 --- a/include/svx/galleryobjectcollection.hxx +++ b/include/svx/galleryobjectcollection.hxx @@ -28,7 +28,9 @@ #include #include -struct GalleryObject +class GalleryObjectStorage; + +struct SVXCORE_DLLPUBLIC GalleryObject { std::optional m_oStorageUrl; sal_uInt32 nOffset; diff --git a/include/svx/gallerystoragelocations.hxx b/include/svx/gallerystoragelocations.hxx deleted file mode 100644 index 343ed0b7e77b..000000000000 --- a/include/svx/gallerystoragelocations.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- 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 - -class SVXCORE_DLLPUBLIC GalleryStorageLocations -{ -public: - virtual ~GalleryStorageLocations() = 0; - virtual void SetStorageLocations(INetURLObject& aURL) = 0; - virtual const INetURLObject& getThemeURL() const = 0; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx index 585293be0ae2..e3ef7f7d991f 100644 --- a/include/svx/galtheme.hxx +++ b/include/svx/galtheme.hxx @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -32,19 +31,21 @@ #include #include -namespace weld { class ComboBox; } - -class SotStorageStream; - +class GalleryBinaryEngine; class GalleryThemeEntry; class SgaObject; +class SotStorageStream; class FmFormModel; class Gallery; - namespace unogallery { - class GalleryTheme; class GalleryItem; + class GalleryTheme; +} +namespace weld +{ + class ComboBox; + class Widget; } class SVXCORE_DLLPUBLIC GalleryTheme final : public SfxBroadcaster @@ -152,7 +153,7 @@ public: DateTime getModificationDate() const; - const INetURLObject& getThemeURL() const { return mpGalleryStorageEngine->getThemeURL(); } + const INetURLObject& getThemeURL() const; public: -- cgit