1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SC_DRAWVIEW_HXX 25 #define SC_DRAWVIEW_HXX 26 27 #include <svx/fmview.hxx> 28 29 #include "global.hxx" 30 31 namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } } 32 33 class ScDocument; 34 class ScViewData; 35 class ScDrawObjData; 36 37 class ScDrawView: public FmFormView 38 { 39 ScViewData* pViewData; 40 OutputDevice* pDev; //! noetig ? 41 ScDocument* pDoc; 42 SCTAB nTab; 43 Fraction aScaleX; // Faktor fuer Drawing-MapMode 44 Fraction aScaleY; 45 SdrDropMarkerOverlay* pDropMarker; 46 SdrObject* pDropMarkObj; 47 sal_Bool bInConstruct; 48 //HMHBOOL bDisableHdl; 49 50 void Construct(); 51 void UpdateBrowser(); 52 53 protected: 54 virtual void ModelHasChanged(); 55 56 // add custom handles (used by other apps, e.g. AnchorPos) 57 virtual void AddCustomHdl(); 58 59 void ImplClearCalcDropMarker(); 60 61 public: 62 ScDrawView( OutputDevice* pOut, ScViewData* pData ); 63 virtual ~ScDrawView(); 64 65 virtual void MarkListHasChanged(); 66 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 67 68 virtual void DoConnect(SdrOle2Obj* pOleObj); 69 70 virtual void MakeVisible( const Rectangle& rRect, Window& rWin ); 71 72 virtual void DeleteMarked(); 73 74 void DrawMarks( OutputDevice* pOut ) const; 75 76 void MarkDropObj( SdrObject* pObj ); 77 78 //HMHBOOL IsDisableHdl() const { return bDisableHdl; } 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 SCTAB GetTab() const { return nTab; } 93 94 void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const; 95 96 void SetAnchor( ScAnchorType ); 97 ScAnchorType GetAnchor() const; 98 99 void VCAddWin( Window* pWin ); 100 void VCRemoveWin( Window* pWin ); 101 102 void UpdateIMap( SdrObject* pObj ); 103 104 sal_uInt16 GetPopupMenuId(); 105 void UpdateUserViewOptions(); 106 107 void SetMarkedOriginalSize(); 108 109 sal_Bool SelectObject( const String& rName ); 110 //UNUSED2008-05 String GetSelectedChartName() const; 111 bool HasMarkedControl() const; 112 bool HasMarkedInternal() const; 113 114 FASTBOOL 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 inline void LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); } 129 /** Unlocks the background layer that contains background objects. */ 130 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 inline void LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); } 135 /** Unlocks the internal layer that contains caption objects of cell notes. */ 136 inline void UnlockInternalLayer() { LockInternalLayer( false ); } 137 138 SdrEndTextEditKind ScEndTextEdit(); // ruft SetDrawTextUndo(0) 139 //UNUSED2009-05 void CaptionTextDirection(sal_uInt16 nSlot); 140 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable(); 141 }; 142 143 144 145 146 #endif 147 148