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 <svl/whichranges.hxx>
29 #include <memory>
30 
31 
42 class SdrOutliner;
43 class SdrModel;
44 class SvtSysLocale;
45 class LocaleDataWrapper;
46 
47 namespace com::sun::star::lang {
48  struct Locale;
49 }
50 
57 SVXCORE_DLLPUBLIC std::unique_ptr<SdrOutliner> SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rMod);
58 
66 {
67  // Default FontColor is COL_AUTO
68  inline Color GetFontColor() { return COL_AUTO; }
69 
70  // Default FontHeight is 847. The font height uses logical units (MapUnit/MapFraction
71  // see below for further details). The default setting 847/100mm corresponds to about
72  // 24 Point. If e.g. one would use Twips (SetMapUnit(MapUnit::MapTwip)) (20 Twip = 1 Point)
73  // instead, one would need to set the font height to 480, in order to get a 24 Point height.
74  inline size_t GetFontHeight() { return 847; }
75 
76  // The MapMode is needed for the global Outliner.
77  // Incidentally, every newly instantiated SdrModel is assigned this MapMode by default.
78  // Default MapUnit is MapUnit::Map100thMM
79  inline MapUnit GetMapUnit() { return MapUnit::Map100thMM; }
80 
81  // Default MapFraction is 1/1.
82  inline Fraction GetMapFraction() { return Fraction(1, 1); }
83 };
84 
85 class SfxItemSet;
86 
92 SVXCORE_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol);
93 
94 
100 bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE=nullptr);
101 
105 WhichRangesContainer RemoveWhichRange(const WhichRangesContainer& pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd);
106 
113 {
114 private:
115  size_t m_nSumCurAction; // Sum of all handled Actions
116 
117  size_t m_nActionCount; // Count of Actions in the current object
118  size_t m_nCurAction; // Count of handled Actions in the current object
119 
120  size_t m_nInsertCount; // Count of to-be-inserted Actions in the current object
121  size_t m_nCurInsert; // Count of already inserted Actions
122 
123  size_t m_nObjCount; // Count of selected objects
124  size_t m_nCurObj; // Current object
125 
127 
128 public:
129  SvdProgressInfo( const Link<void*,bool>& _pLink );
130 
131  void Init( size_t _nObjCount );
132 
133  void SetNextObject();
134 
135  void SetActionCount( size_t _nActionCount );
136  void SetInsertCount( size_t _nInsertCount );
137 
138  bool ReportActions( size_t nActionCount );
139  void ReportInserts( size_t nInsertCount );
140 
141  size_t GetSumCurAction() const { return m_nSumCurAction; };
142  size_t GetObjCount() const { return m_nObjCount; };
143  size_t GetCurObj() const { return m_nCurObj; };
144 
145  size_t GetActionCount() const { return m_nActionCount; };
146  size_t GetCurAction() const { return m_nCurAction; };
147 
148  size_t GetInsertCount() const { return m_nInsertCount; };
149  size_t GetCurInsert() const { return m_nCurInsert; };
150 
151  void ReportRescales( size_t nRescaleCount );
152 };
153 
154 
155 std::vector<Link<SdrObjCreatorParams, SdrObject*>>& ImpGetUserMakeObjHdl();
156 
157 class SdrOle2Obj;
158 class AutoTimer;
159 
161 {
162  std::vector<SdrOle2Obj*> maObjs;
163 
164  size_t nSize;
165  std::unique_ptr<AutoTimer> pTimer;
166 
167  static bool UnloadObj(SdrOle2Obj& rObj);
168  DECL_LINK( UnloadCheckHdl, Timer*, void );
169 
170 public:
171  OLEObjCache();
173 
174  void InsertObj(SdrOle2Obj* pObj);
175  void RemoveObj(SdrOle2Obj* pObj);
176 
177  SVXCORE_DLLPUBLIC size_t size() const;
179  SVXCORE_DLLPUBLIC const SdrOle2Obj* operator[](size_t nPos) const;
180 };
181 
182 
184 {
185  const SvtSysLocale* pSysLocale; // follows always locale settings
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:143
OutlinerMode
size_t GetSumCurAction() const
Definition: svdetc.hxx:141
void Init()
Global default settings for the DrawingEngine.
Definition: svdetc.hxx:65
size_t GetInsertCount() const
Definition: svdetc.hxx:148
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Color GetFontColor()
Definition: svdetc.hxx:68
SVXCORE_DLLPUBLIC ~OLEObjCache()
Definition: svdetc.cxx:106
size_t GetCurAction() const
Definition: svdetc.hxx:146
WhichRangesContainer RemoveWhichRange(const WhichRangesContainer &pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
Definition: svdetc.cxx:376
const SvtSysLocale * pSysLocale
Definition: svdetc.hxx:185
void RemoveObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:195
std::vector< SdrOle2Obj * > maObjs
Definition: svdetc.hxx:162
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:353
size_t nSize
Definition: svdetc.hxx:164
SVXCORE_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:241
size_t GetCurInsert() const
Definition: svdetc.hxx:149
size_t GetObjCount() const
Definition: svdetc.hxx:142
size_t m_nSumCurAction
Definition: svdetc.hxx:115
size_t m_nObjCount
Definition: svdetc.hxx:123
std::vector< Link< SdrObjCreatorParams, SdrObject * > > & ImpGetUserMakeObjHdl()
Definition: svdetc.cxx:347
SVXCORE_DLLPUBLIC SdrGlobalData & GetSdrGlobalData()
Definition: svdetc.cxx:90
size_t m_nInsertCount
Definition: svdetc.hxx:120
size_t m_nActionCount
Definition: svdetc.hxx:117
size_t m_nCurInsert
Definition: svdetc.hxx:121
Link< void *, bool > maLink
Definition: svdetc.hxx:126
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
Definition: svdetc.hxx:112
OLEObjCache aOLEObjCache
Definition: svdetc.hxx:189
Fraction GetMapFraction()
Definition: svdetc.hxx:82
SVXCORE_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:333
size_t m_nCurAction
Definition: svdetc.hxx:118
MapUnit GetMapUnit()
Definition: svdetc.hxx:79
static bool UnloadObj(SdrOle2Obj &rObj)
Definition: svdetc.cxx:219
size_t GetActionCount() const
Definition: svdetc.hxx:145
size_t GetFontHeight()
Definition: svdetc.hxx:74
OLEObjCache()
Definition: svdetc.cxx:94
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
MapUnit
std::vector< Link< SdrObjCreatorParams, SdrObject * > > aUserMakeObjHdl
Definition: svdetc.hxx:188
void InsertObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:168
SVXCORE_DLLPUBLIC SdrOle2Obj * operator[](size_t nPos)
Definition: svdetc.cxx:209
size_t m_nCurObj
Definition: svdetc.hxx:124
SVXCORE_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
Definition: svdetc.cxx:674
DECL_LINK(UnloadCheckHdl, Timer *, void)
SVXCORE_DLLPUBLIC size_t size() const
Definition: svdetc.cxx:204
std::unique_ptr< AutoTimer > pTimer
Definition: svdetc.hxx:165
const LocaleDataWrapper & GetLocaleData()