LibreOffice Module svx (master)  1
svdetc.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 #ifndef INCLUDED_SVX_SVDETC_HXX
21 #define INCLUDED_SVX_SVDETC_HXX
22 
23 #include <editeng/outliner.hxx>
24 #include <svx/svxdllapi.h>
25 #include <tools/link.hxx>
26 #include <tools/fract.hxx>
27 #include <svx/svdobj.hxx>
28 #include <memory>
29 
30 
41 class SdrOutliner;
42 class SdrModel;
43 class SvtSysLocale;
44 class LocaleDataWrapper;
45 
46 namespace com { namespace sun { namespace star { namespace lang {
47  struct Locale;
48 }}}}
49 
56 SVX_DLLPUBLIC std::unique_ptr<SdrOutliner> SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rMod);
57 
65 {
66  // Default FontColor is COL_AUTO
67  inline Color GetFontColor() { return COL_AUTO; }
68 
69  // Default FontHeight is 847. The font height uses logical units (MapUnit/MapFraction
70  // see below for further details). The default setting 847/100mm corresponds to about
71  // 24 Point. If e.g. one would use Twips (SetMapUnit(MapUnit::MapTwip)) (20 Twip = 1 Point)
72  // instead, one would need to set the font height to 480, in order to get a 24 Point height.
73  inline size_t GetFontHeight() { return 847; }
74 
75  // The MapMode is needed for the global Outliner.
76  // Incidentally, every newly instantiated SdrModel is assigned this MapMode by default.
77  // Default MapUnit is MapUnit::Map100thMM
78  inline MapUnit GetMapUnit() { return MapUnit::Map100thMM; }
79 
80  // Default MapFraction is 1/1.
81  inline Fraction GetMapFraction() { return Fraction(1, 1); }
82 };
83 
84 class SfxItemSet;
85 
91 SVX_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol);
92 
93 
99 bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE=nullptr);
100 
104 std::unique_ptr<sal_uInt16[]> RemoveWhichRange(const sal_uInt16* pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd);
105 
112 {
113 private:
114  size_t m_nSumCurAction; // Sum of all handled Actions
115 
116  size_t m_nActionCount; // Count of Actions in the current object
117  size_t m_nCurAction; // Count of handled Actions in the current object
118 
119  size_t m_nInsertCount; // Count of to-be-inserted Actions in the current object
120  size_t m_nCurInsert; // Count of already inserted Actions
121 
122  size_t m_nObjCount; // Count of selected objects
123  size_t m_nCurObj; // Current object
124 
126 
127 public:
128  SvdProgressInfo( const Link<void*,bool>& _pLink );
129 
130  void Init( size_t _nObjCount );
131 
132  void SetNextObject();
133 
134  void SetActionCount( size_t _nActionCount );
135  void SetInsertCount( size_t _nInsertCount );
136 
137  bool ReportActions( size_t nActionCount );
138  void ReportInserts( size_t nInsertCount );
139 
140  size_t GetSumCurAction() const { return m_nSumCurAction; };
141  size_t GetObjCount() const { return m_nObjCount; };
142  size_t GetCurObj() const { return m_nCurObj; };
143 
144  size_t GetActionCount() const { return m_nActionCount; };
145  size_t GetCurAction() const { return m_nCurAction; };
146 
147  size_t GetInsertCount() const { return m_nInsertCount; };
148  size_t GetCurInsert() const { return m_nCurInsert; };
149 
150  void ReportRescales( size_t nRescaleCount );
151 };
152 
153 
154 std::vector<Link<SdrObjCreatorParams, SdrObject*>>& ImpGetUserMakeObjHdl();
155 
156 class SdrOle2Obj;
157 class AutoTimer;
158 
160 {
161  std::vector<SdrOle2Obj*> maObjs;
162 
163  size_t nSize;
164  std::unique_ptr<AutoTimer> pTimer;
165 
166  static bool UnloadObj( SdrOle2Obj* pObj );
167  DECL_LINK( UnloadCheckHdl, Timer*, void );
168 
169 public:
170  OLEObjCache();
172 
173  void InsertObj(SdrOle2Obj* pObj);
174  void RemoveObj(SdrOle2Obj* pObj);
175 
176  SVX_DLLPUBLIC size_t size() const;
177  SVX_DLLPUBLIC SdrOle2Obj* operator[](size_t nPos);
178  SVX_DLLPUBLIC const SdrOle2Obj* operator[](size_t nPos) const;
179 };
180 
181 
183 {
184  const SvtSysLocale* pSysLocale; // follows always locale settings
185  const LocaleDataWrapper* pLocaleData; // follows always SysLocale
186 public:
187  std::vector<Link<SdrObjCreatorParams, SdrObject*>>
190 
191 
192  const SvtSysLocale* GetSysLocale(); // follows always locale settings
193  const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale
194 public:
195  SdrGlobalData();
196 
197  OLEObjCache& GetOLEObjCache() { return aOLEObjCache; }
198 };
199 
201 
202 
203 // #i101872# isolated GetTextEditBackgroundColor for tooling
204 class SdrObjEditView;
205 
207 
208 
209 #endif // INCLUDED_SVX_SVDETC_HXX
210 
211 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
size_t GetCurObj() const
Definition: svdetc.hxx:142
OutlinerMode
size_t GetSumCurAction() const
Definition: svdetc.hxx:140
void Init()
Global default settings for the DrawingEngine.
Definition: svdetc.hxx:64
size_t GetInsertCount() const
Definition: svdetc.hxx:147
Color GetFontColor()
Definition: svdetc.hxx:67
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
SVX_DLLPUBLIC ~OLEObjCache()
Definition: svdetc.cxx:117
size_t GetCurAction() const
Definition: svdetc.hxx:145
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
SVX_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:246
const SvtSysLocale * pSysLocale
Definition: svdetc.hxx:184
void RemoveObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:198
const LocaleDataWrapper * pLocaleData
Definition: svdetc.hxx:185
std::vector< SdrOle2Obj * > maObjs
Definition: svdetc.hxx:161
OLEObjCache & GetOLEObjCache()
Definition: svdetc.hxx:197
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE=nullptr)
Search an ItemSet for Outliner/EditEngine Items.
Definition: svdetc.cxx:358
static bool UnloadObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:222
size_t nSize
Definition: svdetc.hxx:163
size_t GetCurInsert() const
Definition: svdetc.hxx:148
size_t GetObjCount() const
Definition: svdetc.hxx:141
size_t m_nSumCurAction
Definition: svdetc.hxx:114
size_t m_nObjCount
Definition: svdetc.hxx:122
std::vector< Link< SdrObjCreatorParams, SdrObject * > > & ImpGetUserMakeObjHdl()
Definition: svdetc.cxx:352
size_t m_nInsertCount
Definition: svdetc.hxx:119
size_t m_nActionCount
Definition: svdetc.hxx:116
size_t m_nCurInsert
Definition: svdetc.hxx:120
Link< void *, bool > maLink
Definition: svdetc.hxx:125
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
Definition: svdetc.hxx:111
OLEObjCache aOLEObjCache
Definition: svdetc.hxx:189
Fraction GetMapFraction()
Definition: svdetc.hxx:81
SVX_DLLPUBLIC SdrGlobalData & GetSdrGlobalData()
Definition: svdetc.cxx:101
size_t m_nCurAction
Definition: svdetc.hxx:117
MapUnit GetMapUnit()
Definition: svdetc.hxx:78
size_t GetActionCount() const
Definition: svdetc.hxx:144
size_t GetFontHeight()
Definition: svdetc.hxx:73
SVX_DLLPUBLIC std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rMod)
Create an Outliner with the engine-global default settings on the heap.
Definition: svdetc.cxx:338
std::unique_ptr< sal_uInt16[]> RemoveWhichRange(const sal_uInt16 *pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
Definition: svdetc.cxx:381
MapUnit
std::vector< Link< SdrObjCreatorParams, SdrObject * > > aUserMakeObjHdl
Definition: svdetc.hxx:188
void InsertObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:171
SVX_DLLPUBLIC SdrOle2Obj * operator[](size_t nPos)
Definition: svdetc.cxx:212
size_t m_nCurObj
Definition: svdetc.hxx:123
SVX_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
Definition: svdetc.cxx:713
DECL_LINK(UnloadCheckHdl, Timer *, void)
SVX_DLLPUBLIC size_t size() const
Definition: svdetc.cxx:207
std::unique_ptr< AutoTimer > pTimer
Definition: svdetc.hxx:164
const LocaleDataWrapper & GetLocaleData()