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