Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVDXCGV_HXX
30 : : #define _SVDXCGV_HXX
31 : :
32 : : #include <svx/svdedxv.hxx>
33 : :
34 : : #include <vcl/gdimtf.hxx>
35 : : #include "svx/svxdllapi.h"
36 : :
37 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
38 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
39 : : //
40 : : // @@@@@ @@ @@ @@@@ @@ @@ @@@@ @@ @@ @@@@ @@@@@ @@ @@ @@ @@@@@ @@ @@
41 : : // @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
42 : : // @@ @@@@@ @@ @@ @@ @@ @@ @@@@@@ @@ @@ @@ @@ @@ @@ @@ @ @@
43 : : // @@@@ @@@ @@ @@@@@@ @@@@@@ @@@@@@ @@ @@@ @@@@ @@@@@ @@ @@@@ @@@@@@@
44 : : // @@ @@@@@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@ @@@ @@ @@ @@@@@@@
45 : : // @@ @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@@ @@ @@ @@@ @@@
46 : : // @@@@@ @@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @ @@ @@@@@ @@ @@
47 : : //
48 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
49 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
50 : :
51 [ # # ]: 0 : class SVX_DLLPUBLIC SdrExchangeView: public SdrObjEditView
52 : : {
53 : : friend class SdrPageView;
54 : :
55 : : protected:
56 : :
57 : : void ImpGetPasteObjList(Point& rPos, SdrObjList*& rpLst);
58 : : void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions);
59 : : sal_Bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const;
60 : :
61 : : // liefert True, wenn rPt geaendert wurde
62 : : sal_Bool ImpLimitToWorkArea(Point& rPt) const;
63 : :
64 : : protected:
65 : : // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
66 : : SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut = 0L);
67 : :
68 : : public:
69 : : // Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben.
70 : : virtual void DrawMarkedObj(OutputDevice& rOut) const;
71 : :
72 : : // Z.B. fuer's Clipboard, Drag&Drop, ...
73 : : // Alle markierten Objekte in ein Metafile stecken. Z.Zt. noch etwas
74 : : // buggee (Offset..., Fremdgrafikobjekte (SdrGrafObj), Virtuelle
75 : : // Objektkopien (SdrVirtObj) mit Ankerpos<>(0,0)).
76 : : virtual GDIMetaFile GetMarkedObjMetaFile(sal_Bool bNoVDevIfOneMtfMarked=sal_False) const;
77 : :
78 : : // Alle markierten Objekte auf eine Bitmap malen. Diese hat die Farbtiefe
79 : : // und Aufloesung des Bildschirms.
80 : : virtual Bitmap GetMarkedObjBitmap(sal_Bool bNoVDevIfOneBmpMarked=sal_False) const;
81 : :
82 : : // Alle markierten Objekte in ein neues Model kopieren. Dieses neue Model
83 : : // hat dann genau eine Page. Das Flag PageNotValid an diesem Model ist
84 : : // gesetzt. Daran ist zu erkennen, dass nur die Objekte der Page Gueltikeit
85 : : // haben, die Page sebst jedoch nicht (Seitengroesse, Raender). Das neue
86 : : // Model wird auf dem Heap erzeugt und wird an den Aufrufer dieser Methode
87 : : // uebergeben. Dieser hat es dann spaeter zu entsorgen.
88 : : // Beim einfuegen der markierten Objekte in die eine Page des neuen Model
89 : : // findet ein Merging der seitenlokalen Layer statt. Sollte kein Platz mehr
90 : : // fuer weitere seitenlokale Layer sein, wird den entsprechenden Objekten
91 : : // der Default-Layer zugewiesen (Layer 0, (dokumentglobaler Standardlayer).
92 : : virtual SdrModel* GetMarkedObjModel() const;
93 : :
94 : 0 : GDIMetaFile GetAllMarkedMetaFile(sal_Bool bNoVDevIfOneMtfMarked=sal_False) const { return GetMarkedObjMetaFile(bNoVDevIfOneMtfMarked); }
95 : 0 : Bitmap GetAllMarkedBitmap(sal_Bool bNoVDevIfOneBmpMarked=sal_False) const { return GetMarkedObjBitmap(bNoVDevIfOneBmpMarked); }
96 : : Graphic GetAllMarkedGraphic() const;
97 : 0 : SdrModel* GetAllMarkedModel() const { return GetMarkedObjModel(); }
98 : :
99 : : /** Generate a Graphic for the given draw object in the given model
100 : :
101 : : @param pModel
102 : : Must not be NULL. Denotes the draw model the object is a part
103 : : of.
104 : :
105 : : @param pObj
106 : : The object (can also be a group object) to retrieve a Graphic
107 : : for. Must not be NULL.
108 : :
109 : : @return a graphical representation of the given object, as it
110 : : appears on screen (e.g. with rotation, if any, applied).
111 : : */
112 : : static Graphic GetObjGraphic( const SdrModel* pModel, const SdrObject* pObj );
113 : :
114 : : // Bei allen Paste-Methoden werden die neuen Draw-Objekte markiert.
115 : : // Wird der Parameter bAddMark auf sal_True gesetzt, so werden die neuen
116 : : // DrawObjekte zu einer bereits bestehenden Selektion "hinzumarkiert".
117 : : // Dieser Fall ist fuer Drag&Drop mit mehreren Items gedacht.
118 : : // Die Methoden mit Point-Parameter fuegen neue Objekte zentriert an
119 : : // dieser Position ein, die anderen zentriert am 1.OutputDevice der View.
120 : : // Ist der Parameter pPg gesetzt, werden die Objekte and dieser Seite
121 : : // eingefuegt. Die Positionierung (rPos bzw. Zentrierung) bezieht sich
122 : : // dann nichtmehr auf die View sondern auf die Page.
123 : : // Hinweis: SdrObjList ist Basisklasse von SdrPage.
124 : : // Die Methoden liefern sal_True, wenn die Objekte erfolgreich erzeugt und
125 : : // eingefuegt wurden. Bei pLst=sal_False und kein TextEdit aktiv kann man
126 : : // sich dann auch darauf verlassen, dass diese an der View markiert sind.
127 : : // Andernfalls erfolgt die Markierung nur, wenn pLst z.Zt. auch an der
128 : : // View angezeigt wird.
129 : : // Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
130 : : // SDRINSERT_ADDMARK (siehe svdedtv.hxx).
131 : : virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
132 : : sal_Bool Paste(const String& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
133 : : sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
134 : :
135 : : sal_Bool Cut( sal_uIntPtr nFormat = SDR_ANYFORMAT );
136 : :
137 : : sal_Bool Yank( sal_uIntPtr nFormat = SDR_ANYFORMAT );
138 : :
139 : : sal_Bool Paste( Window* pWin = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT );
140 : : sal_Bool PasteClipboard( OutputDevice* pOut = NULL, sal_uIntPtr nFormat = SDR_ANYFORMAT, sal_uInt32 nOptions = 0 );
141 : : };
142 : :
143 : : #endif //_SVDXCGV_HXX
144 : :
145 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|