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