LibreOffice Module svx (master)  1
gallerybinaryengine.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include <svx/galtheme.hxx>
23 #include <svx/galmisc.hxx>
24 #include <svx/svxdllapi.h>
25 #include <svx/fmmodel.hxx>
27 #include <tools/urlobj.hxx>
28 #include <sot/storage.hxx>
29 
30 #include <memory>
31 
34 class SgaObjectSvDraw;
35 class SgaObjectBmp;
36 class SgaObject;
37 class SotStorage;
38 struct GalleryObject;
39 class FmFormModel;
40 class GalleryTheme;
41 
43 {
44 private:
48  bool mbReadOnly;
49 
50 public:
51  GalleryBinaryEngine(const GalleryStorageLocations& rGalleryStorageLocations,
52  GalleryObjectCollection& rGalleryObjectCollection, bool bReadOnly);
53  SAL_DLLPRIVATE ~GalleryBinaryEngine();
54 
55  void clearSotStorage();
56 
57  SAL_DLLPRIVATE void ImplCreateSvDrawStorage();
58  SAL_DLLPRIVATE const tools::SvRef<SotStorage>& GetSvDrawStorage() const;
59 
60  const INetURLObject& GetThmURL() const { return maGalleryStorageLocations.GetThmURL(); }
61  const INetURLObject& GetSdgURL() const { return maGalleryStorageLocations.GetSdgURL(); }
62  const INetURLObject& GetSdvURL() const { return maGalleryStorageLocations.GetSdvURL(); }
63  const INetURLObject& GetStrURL() const { return maGalleryStorageLocations.GetStrURL(); }
64 
65  SAL_DLLPRIVATE bool implWrite(const GalleryTheme& rTheme);
66 
67  void insertObject(const SgaObject& rObj, GalleryObject* pFoundEntry, OUString& rDestDir,
68  sal_uInt32& rInsertPos);
69 
70  std::unique_ptr<SgaObject> implReadSgaObject(GalleryObject const* pEntry);
71  bool implWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry,
72  OUString& aDestDir);
73 
74  bool readModel(const GalleryObject* pObject, SdrModel& rModel);
75  SgaObjectSvDraw insertModel(const FmFormModel& rModel, const INetURLObject& rUserURL);
76 
77  bool readModelStream(const GalleryObject* pObject,
78  tools::SvRef<SotStorageStream> const& rxModelStream);
79  SgaObjectSvDraw insertModelStream(const tools::SvRef<SotStorageStream>& rxModelStream,
80  const INetURLObject& rUserURL);
81 
82  INetURLObject implCreateUniqueURL(SgaObjKind eObjKind, const INetURLObject& rUserURL,
83  ConvertDataFormat nFormat = ConvertDataFormat::Unknown);
84 
85  SgaObjectBmp insertGraphic(const Graphic& rGraphic, const GfxLink& aGfxLink,
86  ConvertDataFormat& nExportFormat, const INetURLObject& rUserURL);
87 
88  SgaObjectSvDraw updateSvDrawObject(GalleryObject* pEntry);
89 
90  void updateTheme();
91  static void insertFileOrDirURL(const INetURLObject& rFileOrDirURL,
92  std::vector<INetURLObject>& rURLVector);
93 };
94 
95 SvStream& WriteGalleryTheme(SvStream& rOut, const GalleryTheme& rTheme);
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const INetURLObject & GetSdgURL() const
const GalleryStorageLocations & maGalleryStorageLocations
bool bReadOnly
tools::SvRef< SotStorage > m_aSvDrawStorageRef
SvStream & WriteGalleryTheme(SvStream &rOut, const GalleryTheme &rTheme)
const INetURLObject & GetSdvURL() const
const INetURLObject & GetStrURL() const
SgaObjKind
Definition: galmisc.hxx:55
const INetURLObject & GetThmURL() const
ConvertDataFormat
const INetURLObject & GetThmURL() const
const INetURLObject & GetStrURL() const
const INetURLObject & GetSdvURL() const
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
const INetURLObject & GetSdgURL() const
GalleryObjectCollection & mrGalleryObjectCollection