LibreOffice Module svx (master)
1
include
svx
svdxcgv.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/svdedxv.hxx
>
23
24
#include <
vcl/gdimtf.hxx
>
25
#include <
svx/svxdllapi.h
>
26
27
class
SVXCORE_DLLPUBLIC
SdrExchangeView
:
public
SdrObjEditView
28
{
29
friend
class
SdrPageView
;
30
31
protected
:
32
33
void
ImpGetPasteObjList(
Point
& rPos,
SdrObjList
*& rpLst);
34
void
ImpPasteObject(
SdrObject
* pObj,
SdrObjList
& rLst,
const
Point
& rCenter,
const
Size
& rSiz,
const
MapMode
& rMap,
SdrInsertFlags
nOptions);
35
bool
ImpGetPasteLayer(
const
SdrObjList
* pObjList,
SdrLayerID
& rLayer)
const
;
36
37
// Returns true if rPt has changed
38
bool
ImpLimitToWorkArea(
Point
& rPt)
const
;
39
40
protected
:
41
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
42
SdrExchangeView
(
43
SdrModel
& rSdrModel,
44
OutputDevice
* pOut);
45
46
public
:
47
// Output all marked objects on the specified OutputDevice
48
::std::vector< SdrObject* > GetMarkedObjects()
const
;
49
virtual
void
DrawMarkedObj(
OutputDevice
& rOut)
const
;
50
51
// E.g. for Clipboard, Drag'n'Drop, ...
52
// Add all marked objects to a metafile.
53
// FIXME: This is known to be somewhat buggy still (Offset...,
54
// foreign graphics objects (SdrGrafObj), virtual object
55
// copies (SdrVirtObj) with anchor position <>(0,0)).
56
GDIMetaFile
GetMarkedObjMetaFile(
bool
bNoVDevIfOneMtfMarked =
false
)
const
;
57
58
// Draw all marked objects onto a bitmap, with the display's color depth
59
// and resolution
60
BitmapEx
GetMarkedObjBitmapEx(
bool
bNoVDevIfOneBmpMarked =
false
,
const
sal_uInt32 nMaximumQuadraticPixels = 500000,
const
std::optional<Size>& rTargetDPI = std::nullopt)
const
;
61
62
// Copy all marked objects to a new model, consisting of exactly one page,
63
// with the flag PageNotValid set. This means, that only the page's objects
64
// are valid and not the page itself (page size, margins).
65
// The new model is created on the free store and passed to the caller of
66
// this method, which is responsible to dispose it later on.
67
//
68
// When inserting the marked objects into the one page of the new model,
69
// the page-local layer is merged. If there's no more room left for
70
// additional page-local layers, the corresponding objects are assigned
71
// the default layer (layer 0, document-global standard layer).
72
virtual
std::unique_ptr<SdrModel> CreateMarkedObjModel()
const
;
73
74
Graphic
GetAllMarkedGraphic()
const
;
75
89
static
Graphic
GetObjGraphic(
const
SdrObject
& rSdrObject,
bool
bSVG =
false
);
90
91
// The new Draw objects are marked for all paste methods.
92
// If bAddMark is true, the new Draw objects are added to an existing
93
// selection, which is meant for Drag'n'Drop with multiple items.
94
//
95
// The methods with a point parameter insert objects centered at that
96
// position, all others are centered at the 1st OutputDevice of the View.
97
//
98
// If pPg is set, the objects are inserted at that page. The positioning
99
// (rPos or alignment) are not relative to the View, but to the Page.
100
//
101
// Note: SdrObjList is the base class of SdrPage.
102
// All methods return true, if the objects have been successfully created
103
// and inserted.
104
// If pLst = false and no TextEdit active, we can rely on the fact, that
105
// it is marked at the View. Or else the marking only happens if the pLst
106
// is also shown at the View at the moment.
107
//
108
// Valid values for nOptions are SDRINSERT_DONTMARK and SDRINSERT_ADDMARK
109
// (@see svdedtv.hxx).
110
virtual
bool
Paste
(
111
const
SdrModel
& rMod,
const
Point
& rPos,
SdrObjList
* pLst,
SdrInsertFlags
nOptions);
112
113
bool
Paste
(
const
OUString& rStr,
const
Point
& rPos,
SdrObjList
* pLst,
SdrInsertFlags
nOptions);
114
bool
Paste
(
SvStream
& rInput,
EETextFormat
eFormat,
const
Point
& rPos,
SdrObjList
* pLst,
SdrInsertFlags
nOptions);
115
};
116
117
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
BitmapEx
GDIMetaFile
Graphic
Point
SdrExchangeView
Definition:
svdxcgv.hxx:28
SdrModel
Definition:
svdmodel.hxx:149
SdrObjEditView
Definition:
svdedxv.hxx:63
SdrObjList
Definition:
svdpage.hxx:62
SdrObject
Abstract DrawObject.
Definition:
svdobj.hxx:260
SdrPageView
Definition:
svdpagv.hxx:56
Size
SvStream
PROT::Paste
@ Paste
EETextFormat
EETextFormat
gdimtf.hxx
MapMode
OutputDevice
o3tl::strong_int< sal_Int16, struct SdrLayerIDTag >
SdrInsertFlags
SdrInsertFlags
Definition:
svdedtv.hxx:59
svdedxv.hxx
svxdllapi.h
SVXCORE_DLLPUBLIC
#define SVXCORE_DLLPUBLIC
Definition:
svxdllapi.h:35
Generated on Sun Jul 30 2023 04:27:39 for LibreOffice Module svx (master) by
1.9.3