bump product version to 4.1.6.2
[LibreOffice.git] / sc / source / ui / inc / drawview.hxx
blobf5de693af6c4d62f8b1c6957694039c9c5213e4e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SC_DRAWVIEW_HXX
21 #define SC_DRAWVIEW_HXX
23 #include <svx/fmview.hxx>
25 #include "global.hxx"
27 namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
29 class ScDocument;
30 class ScViewData;
31 class ScDrawObjData;
33 class ScDrawView: public FmFormView
35 ScViewData* pViewData;
36 OutputDevice* pDev; //! needed ?
37 ScDocument* pDoc;
38 SCTAB nTab;
39 Fraction aScaleX; // Factor for Drawing-MapMode
40 Fraction aScaleY;
41 SdrDropMarkerOverlay* pDropMarker;
42 SdrObject* pDropMarkObj;
43 sal_Bool bInConstruct;
45 void Construct();
46 void UpdateBrowser();
48 protected:
49 virtual void ModelHasChanged();
51 // add custom handles (used by other apps, e.g. AnchorPos)
52 virtual void AddCustomHdl();
54 void ImplClearCalcDropMarker();
56 public:
57 ScDrawView( OutputDevice* pOut, ScViewData* pData );
58 virtual ~ScDrawView();
60 virtual void MarkListHasChanged();
61 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
63 virtual void DoConnect(SdrOle2Obj* pOleObj);
65 virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
67 virtual void DeleteMarked();
69 virtual sal_Bool SdrBeginTextEdit(
70 SdrObject* pObj,
71 SdrPageView* pPV = 0L,
72 ::Window* pWin = 0L,
73 sal_Bool bIsNewObj = sal_False,
74 SdrOutliner* pGivenOutliner = 0L,
75 OutlinerView* pGivenOutlinerView = 0L,
76 sal_Bool bDontDeleteOutliner = sal_False,
77 sal_Bool bOnlyOneView = sal_False,
78 sal_Bool bGrabFocus = sal_True);
80 virtual SdrEndTextEditKind SdrEndTextEdit( sal_Bool bDontDeleteReally = sal_False );
82 void MarkDropObj( SdrObject* pObj );
84 void SetMarkedToLayer( sal_uInt8 nLayerNo );
86 void InvalidateAttribs();
87 void InvalidateDrawTextAttrs();
89 sal_Bool BeginDrag( Window* pWindow, const Point& rStartPos );
90 void DoCut();
91 void DoCopy();
93 void GetScale( Fraction& rFractX, Fraction& rFractY ) const;
94 void RecalcScale();
95 void UpdateWorkArea();
96 SCTAB GetTab() const { return nTab; }
98 void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
100 void SetPageAnchored();
101 void SetCellAnchored();
102 ScAnchorType GetAnchorType() const;
104 void VCAddWin( Window* pWin );
105 void VCRemoveWin( Window* pWin );
107 void UpdateIMap( SdrObject* pObj );
109 sal_uInt16 GetPopupMenuId();
110 void UpdateUserViewOptions();
112 void SetMarkedOriginalSize();
114 sal_Bool SelectObject( const String& rName );
115 bool HasMarkedControl() const;
116 bool HasMarkedInternal() const;
118 bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
120 /** Returns the selected object, if it is the caption object of a cell note.
121 @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */
122 SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 );
124 /** Locks/unlocks the specified layer in the draw page.
125 Unlocked layer is required to be able to edit the contained objects. */
126 void LockCalcLayer( SdrLayerID nLayer, bool bLock = true );
127 /** Unlocks the specified layer in the draw page. */
128 inline void UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); }
130 /** Locks/unlocks the background layer that contains background objects.
131 Unlocked layer is required to be able to edit the objects. */
132 inline void LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); }
133 /** Unlocks the background layer that contains background objects. */
134 inline void UnlockBackgroundLayer() { LockBackgroundLayer( false ); }
136 /** Locks/unlocks the internal layer that contains caption objects of cell notes.
137 Unlocked layer is required to be able to edit the contained objects. */
138 inline void LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); }
139 /** Unlocks the internal layer that contains caption objects of cell notes. */
140 inline void UnlockInternalLayer() { LockInternalLayer( false ); }
142 SdrEndTextEditKind ScEndTextEdit(); // calls SetDrawTextUndo(0)
143 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
145 static void CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle );
146 virtual void SyncForGrid( SdrObject* pObj );
152 #endif
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */