nss: upgrade to release 3.73
[LibreOffice.git] / include / svx / gallerybinaryengine.hxx
blob4f13518802693cd37b590e7ea8f84f51cea008bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <svx/galmisc.hxx>
23 #include <svx/svxdllapi.h>
24 #include <svx/fmmodel.hxx>
25 #include <svx/gallerystoragelocations.hxx>
26 #include <svx/gallerybinarystoragelocations.hxx>
27 #include <svx/galleryfilestorage.hxx>
28 #include <tools/urlobj.hxx>
29 #include <sot/storage.hxx>
31 #include <tools/datetime.hxx>
32 #include <unotools/datetime.hxx>
34 #include <memory>
36 class GalleryStorageLocations;
37 class GalleryBinaryStorageLocations;
38 class GalleryObjectCollection;
39 class SgaObjectSvDraw;
40 class SgaObjectBmp;
41 class SgaObject;
42 class SotStorage;
43 struct GalleryObject;
44 class FmFormModel;
45 class GalleryTheme;
46 class GalleryThemeEntry;
48 class SVXCORE_DLLPUBLIC GalleryBinaryEngine : public GalleryFileStorage
50 private:
51 tools::SvRef<SotStorage> m_aSvDrawStorageRef;
52 const GalleryBinaryStorageLocations& maGalleryStorageLocations;
53 GalleryObjectCollection& mrGalleryObjectCollection;
54 bool mbReadOnly;
55 OUString m_aDestDir;
56 bool m_bDestDirRelative;
58 const INetURLObject& GetSdgURL() const { return maGalleryStorageLocations.GetSdgURL(); }
59 const INetURLObject& GetSdvURL() const { return maGalleryStorageLocations.GetSdvURL(); }
60 const INetURLObject& GetStrURL() const { return maGalleryStorageLocations.GetStrURL(); }
61 const INetURLObject& GetThmURL() const { return maGalleryStorageLocations.GetThmURL(); }
63 public:
64 GalleryBinaryEngine(const GalleryBinaryStorageLocations& rGalleryStorageLocations,
65 GalleryObjectCollection& rGalleryObjectCollection, bool bReadOnly);
66 SAL_DLLPRIVATE ~GalleryBinaryEngine();
68 void clearSotStorage();
70 void setDestDir(const OUString& rDestDir, bool bRelative);
72 SAL_DLLPRIVATE void ImplCreateSvDrawStorage();
73 SAL_DLLPRIVATE const tools::SvRef<SotStorage>& GetSvDrawStorage() const;
75 const INetURLObject& getThemeURL() const { return maGalleryStorageLocations.getThemeURL(); }
77 SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme, const GalleryThemeEntry* pThm);
79 void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, sal_uInt32 nInsertPos);
80 void removeObject(const std::unique_ptr<GalleryObject>& pEntry);
82 std::unique_ptr<SgaObject> implReadSgaObject(GalleryObject const* pEntry);
83 bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry);
85 bool readModel(const GalleryObject* pObject, SdrModel& rModel);
86 SgaObjectSvDraw insertModel(const FmFormModel& rModel, const INetURLObject& rUserURL);
88 bool readModelStream(const GalleryObject* pObject,
89 tools::SvRef<SotStorageStream> const& rxModelStream);
90 SgaObjectSvDraw insertModelStream(const tools::SvRef<SotStorageStream>& rxModelStream,
91 const INetURLObject& rUserURL);
93 INetURLObject implCreateUniqueURL(SgaObjKind eObjKind, const INetURLObject& rUserURL,
94 ConvertDataFormat nFormat = ConvertDataFormat::Unknown);
96 SgaObjectBmp insertGraphic(const Graphic& rGraphic, const GfxLink& aGfxLink,
97 const ConvertDataFormat& nExportFormat,
98 const INetURLObject& rUserURL);
100 SgaObjectSvDraw updateSvDrawObject(const GalleryObject* pEntry);
102 void updateTheme();
103 static void insertFileOrDirURL(const INetURLObject& rFileOrDirURL,
104 std::vector<INetURLObject>& rURLVector);
106 SvStream& writeGalleryTheme(SvStream& rOStm, const GalleryTheme& rTheme,
107 const GalleryThemeEntry* pThm);
109 DateTime getModificationDate() const;
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */