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 SC_DRAWVIEW_HXX
30 : : #define SC_DRAWVIEW_HXX
31 : :
32 : : #include <svx/fmview.hxx>
33 : :
34 : : #include "global.hxx"
35 : :
36 : : namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
37 : :
38 : : class ScDocument;
39 : : class ScViewData;
40 : : class ScDrawObjData;
41 : :
42 : : class ScDrawView: public FmFormView
43 : : {
44 : : ScViewData* pViewData;
45 : : OutputDevice* pDev; //! needed ?
46 : : ScDocument* pDoc;
47 : : SCTAB nTab;
48 : : Fraction aScaleX; // Factor for Drawing-MapMode
49 : : Fraction aScaleY;
50 : : SdrDropMarkerOverlay* pDropMarker;
51 : : SdrObject* pDropMarkObj;
52 : : sal_Bool bInConstruct;
53 : :
54 : : void Construct();
55 : : void UpdateBrowser();
56 : :
57 : : protected:
58 : : virtual void ModelHasChanged();
59 : :
60 : : // add custom handles (used by other apps, e.g. AnchorPos)
61 : : virtual void AddCustomHdl();
62 : :
63 : : void ImplClearCalcDropMarker();
64 : :
65 : : public:
66 : : ScDrawView( OutputDevice* pOut, ScViewData* pData );
67 : : virtual ~ScDrawView();
68 : :
69 : : virtual void MarkListHasChanged();
70 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
71 : :
72 : : virtual void DoConnect(SdrOle2Obj* pOleObj);
73 : :
74 : : virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
75 : :
76 : : virtual void DeleteMarked();
77 : :
78 : : void MarkDropObj( SdrObject* pObj );
79 : :
80 : : void SetMarkedToLayer( sal_uInt8 nLayerNo );
81 : :
82 : : void InvalidateAttribs();
83 : : void InvalidateDrawTextAttrs();
84 : :
85 : : sal_Bool BeginDrag( Window* pWindow, const Point& rStartPos );
86 : : void DoCut();
87 : : void DoCopy();
88 : :
89 : : void GetScale( Fraction& rFractX, Fraction& rFractY ) const;
90 : : void RecalcScale();
91 : : void UpdateWorkArea();
92 : 0 : SCTAB GetTab() const { return nTab; }
93 : :
94 : : void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
95 : :
96 : : void SetPageAnchored();
97 : : void SetCellAnchored();
98 : : ScAnchorType GetAnchorType() const;
99 : :
100 : : void VCAddWin( Window* pWin );
101 : : void VCRemoveWin( Window* pWin );
102 : :
103 : : void UpdateIMap( SdrObject* pObj );
104 : :
105 : : sal_uInt16 GetPopupMenuId();
106 : : void UpdateUserViewOptions();
107 : :
108 : : void SetMarkedOriginalSize();
109 : :
110 : : sal_Bool SelectObject( const String& rName );
111 : : bool HasMarkedControl() const;
112 : : bool HasMarkedInternal() const;
113 : :
114 : : bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
115 : :
116 : : /** Returns the selected object, if it is the caption object of a cell note.
117 : : @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */
118 : : SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 );
119 : :
120 : : /** Locks/unlocks the specified layer in the draw page.
121 : : Unlocked layer is required to be able to edit the contained objects. */
122 : : void LockCalcLayer( SdrLayerID nLayer, bool bLock = true );
123 : : /** Unlocks the specified layer in the draw page. */
124 : : inline void UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); }
125 : :
126 : : /** Locks/unlocks the background layer that contains background objects.
127 : : Unlocked layer is required to be able to edit the objects. */
128 : 0 : inline void LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); }
129 : : /** Unlocks the background layer that contains background objects. */
130 : 0 : inline void UnlockBackgroundLayer() { LockBackgroundLayer( false ); }
131 : :
132 : : /** Locks/unlocks the internal layer that contains caption objects of cell notes.
133 : : Unlocked layer is required to be able to edit the contained objects. */
134 : 0 : inline void LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); }
135 : : /** Unlocks the internal layer that contains caption objects of cell notes. */
136 : 0 : inline void UnlockInternalLayer() { LockInternalLayer( false ); }
137 : :
138 : : SdrEndTextEditKind ScEndTextEdit(); // calls SetDrawTextUndo(0)
139 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
140 : : };
141 : :
142 : :
143 : :
144 : :
145 : : #endif
146 : :
147 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|