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
42class SdrOutliner;
43class SdrModel;
44class SvtSysLocale;
46
47namespace com::sun::star::lang {
48 struct Locale;
49}
50
57SVXCORE_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
85class SfxItemSet;
86
93
94
100bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE=nullptr);
101
105WhichRangesContainer RemoveWhichRange(const WhichRangesContainer& pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd);
106
113{
114private:
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
128public:
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
155std::vector<Link<SdrObjCreatorParams, rtl::Reference<SdrObject>>>& ImpGetUserMakeObjHdl();
156
157class SdrOle2Obj;
158class 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
170public:
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
186public:
187 std::vector<Link<SdrObjCreatorParams, rtl::Reference<SdrObject>>>
190
191
192 const SvtSysLocale* GetSysLocale(); // follows always locale settings
193 const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale
194public:
196
197 OLEObjCache& GetOLEObjCache() { return aOLEObjCache; }
198};
199
201
202
203// #i101872# isolated GetTextEditBackgroundColor for tooling
204class SdrObjEditView;
205
207
208
209#endif // INCLUDED_SVX_SVDETC_HXX
210
211/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OLEObjCache()
Definition: svdetc.cxx:93
std::vector< SdrOle2Obj * > maObjs
Definition: svdetc.hxx:162
SVXCORE_DLLPUBLIC ~OLEObjCache()
Definition: svdetc.cxx:113
void InsertObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:175
size_t nSize
Definition: svdetc.hxx:164
SVXCORE_DLLPUBLIC size_t size() const
Definition: svdetc.cxx:211
static bool UnloadObj(SdrOle2Obj &rObj)
Definition: svdetc.cxx:226
SVXCORE_DLLPUBLIC SdrOle2Obj * operator[](size_t nPos)
Definition: svdetc.cxx:216
void RemoveObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:202
DECL_LINK(UnloadCheckHdl, Timer *, void)
std::unique_ptr< AutoTimer > pTimer
Definition: svdetc.hxx:165
std::vector< Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > > aUserMakeObjHdl
Definition: svdetc.hxx:188
const SvtSysLocale * pSysLocale
Definition: svdetc.hxx:185
OLEObjCache aOLEObjCache
Definition: svdetc.hxx:189
OLEObjCache & GetOLEObjCache()
Definition: svdetc.hxx:197
Helper class for the communication between the dialog In order to break open Metafiles (sd/source/ui/...
Definition: svdetc.hxx:113
size_t GetActionCount() const
Definition: svdetc.hxx:145
Link< void *, bool > maLink
Definition: svdetc.hxx:126
size_t m_nInsertCount
Definition: svdetc.hxx:120
size_t m_nActionCount
Definition: svdetc.hxx:117
size_t GetInsertCount() const
Definition: svdetc.hxx:148
size_t m_nCurAction
Definition: svdetc.hxx:118
size_t m_nCurInsert
Definition: svdetc.hxx:121
size_t m_nSumCurAction
Definition: svdetc.hxx:115
size_t m_nCurObj
Definition: svdetc.hxx:124
size_t GetCurInsert() const
Definition: svdetc.hxx:149
size_t GetCurObj() const
Definition: svdetc.hxx:143
size_t GetCurAction() const
Definition: svdetc.hxx:146
size_t GetObjCount() const
Definition: svdetc.hxx:142
size_t m_nObjCount
Definition: svdetc.hxx:123
size_t GetSumCurAction() const
Definition: svdetc.hxx:141
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void Init()
MapUnit
Global default settings for the DrawingEngine.
Definition: svdetc.hxx:66
size_t GetFontHeight()
Definition: svdetc.hxx:74
MapUnit GetMapUnit()
Definition: svdetc.hxx:79
Fraction GetMapFraction()
Definition: svdetc.hxx:82
Color GetFontColor()
Definition: svdetc.hxx:68
const LocaleDataWrapper & GetLocaleData()
OutlinerMode
SVXCORE_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:248
SVXCORE_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
Definition: svdetc.cxx:681
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE=nullptr)
Search an ItemSet for Outliner/EditEngine Items.
Definition: svdetc.cxx:360
WhichRangesContainer RemoveWhichRange(const WhichRangesContainer &pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
Definition: svdetc.cxx:383
std::vector< Link< SdrObjCreatorParams, rtl::Reference< SdrObject > > > & ImpGetUserMakeObjHdl()
Definition: svdetc.cxx:354
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:340
SVXCORE_DLLPUBLIC SdrGlobalData & GetSdrGlobalData()
Definition: svdetc.cxx:89
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35