diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-08 11:51:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-09 07:51:25 +0200 |
commit | 47378fcb3ca35bbe9fc27e9c062479dc5812138b (patch) | |
tree | 8b13678be170d31ac655efc1d887505fcef9479e /include/svx | |
parent | e4f5c7e3bf9a791ce777d1027aa17c93ad8f28a3 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/gallery1.hxx | 12 | ||||
-rw-r--r-- | include/svx/gallerybinaryengine.hxx | 111 | ||||
-rw-r--r-- | include/svx/gallerybinaryengineentry.hxx | 67 | ||||
-rw-r--r-- | include/svx/gallerybinarystoragelocations.hxx | 52 | ||||
-rw-r--r-- | include/svx/galleryfilestorage.hxx | 28 | ||||
-rw-r--r-- | include/svx/galleryfilestorageentry.hxx | 28 | ||||
-rw-r--r-- | include/svx/galleryobjectcollection.hxx | 4 | ||||
-rw-r--r-- | include/svx/gallerystoragelocations.hxx | 33 | ||||
-rw-r--r-- | include/svx/galtheme.hxx | 17 |
9 files changed, 19 insertions, 333 deletions
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 <svl/SfxBroadcaster.hxx> #include <svx/svxdllapi.h> #include <tools/urlobj.hxx> -#include <svx/gallerybinaryengineentry.hxx> -#include <svx/gallerybinaryengine.hxx> #include <cstdio> #include <memory> #include <vector> +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<GalleryBinaryEngineEntry>& 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 <svx/galmisc.hxx> -#include <svx/svxdllapi.h> -#include <svx/fmmodel.hxx> -#include <svx/gallerybinarystoragelocations.hxx> -#include <svx/galleryfilestorage.hxx> -#include <tools/urlobj.hxx> -#include <sot/storage.hxx> -#include <vcl/salctype.hxx> - -#include <tools/datetime.hxx> - -#include <memory> - -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<SotStorage> 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<SotStorage>& 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<GalleryObject>& pEntry); - - std::unique_ptr<SgaObject> 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<SotTempStream> const& rxModelStream); - SgaObjectSvDraw insertModelStream(const tools::SvRef<SotTempStream>& 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<INetURLObject>& 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 <tools/urlobj.hxx> -#include <svx/galtheme.hxx> -#include <svx/gallerybinaryengine.hxx> -#include <svx/gallerybinarystoragelocations.hxx> -#include <svx/galleryfilestorageentry.hxx> - -class GalleryBinaryStorageLocations; -class GalleryObjectCollection; -class GalleryBinaryEngine; - -class GalleryBinaryEngineEntry final : public GalleryFileStorageEntry -{ -private: - std::unique_ptr<GalleryBinaryStorageLocations> 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<GalleryBinaryStorageLocations>& getGalleryStorageLocations() const - { - return mpGalleryStorageLocations; - } - - static GalleryThemeEntry* CreateThemeEntry(const INetURLObject& rURL, bool bReadOnly); - - void removeTheme(); - - std::unique_ptr<GalleryTheme>& getCachedTheme(std::unique_ptr<GalleryTheme>& pNewTheme); - - void setStorageLocations(INetURLObject& rURL); - - std::unique_ptr<GalleryBinaryEngine> - 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 <tools/urlobj.hxx> -#include <svx/svxdllapi.h> -#include <svx/gallerystoragelocations.hxx> - -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 <optional> #include <vector> -struct GalleryObject +class GalleryObjectStorage; + +struct SVXCORE_DLLPUBLIC GalleryObject { std::optional<INetURLObject> 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 <svx/svxdllapi.h> -#include <tools/urlobj.hxx> - -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 <svx/svxdllapi.h> #include <svx/galleryobjectcollection.hxx> -#include <svx/gallerybinaryengine.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> @@ -32,19 +31,21 @@ #include <svx/galmisc.hxx> #include <memory> -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: |