xref: /trunk/main/sc/source/ui/inc/drawview.hxx (revision 14af77b6d25ba272273c2e5e4523fbde7e527166)
138d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
338d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
438d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
538d50f7bSAndrew Rist  * distributed with this work for additional information
638d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
738d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
838d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
938d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
1138d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
1338d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1438d50f7bSAndrew Rist  * software distributed under the License is distributed on an
1538d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1638d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
1738d50f7bSAndrew Rist  * specific language governing permissions and limitations
1838d50f7bSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
2038d50f7bSAndrew Rist  *************************************************************/
2138d50f7bSAndrew Rist 
2238d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_DRAWVIEW_HXX
25cdf0e10cSrcweir #define SC_DRAWVIEW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/fmview.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "global.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class ScDocument;
34cdf0e10cSrcweir class ScViewData;
35cdf0e10cSrcweir class ScDrawObjData;
36*14af77b6SArmin Le Grand class SdrUndoManager;
37cdf0e10cSrcweir 
38cdf0e10cSrcweir class ScDrawView: public FmFormView
39cdf0e10cSrcweir {
40cdf0e10cSrcweir     ScViewData*             pViewData;
41cdf0e10cSrcweir     OutputDevice*           pDev;                   //! noetig ?
42cdf0e10cSrcweir     ScDocument*             pDoc;
43cdf0e10cSrcweir     SCTAB                   nTab;
44cdf0e10cSrcweir     Fraction                aScaleX;                // Faktor fuer Drawing-MapMode
45cdf0e10cSrcweir     Fraction                aScaleY;
46cdf0e10cSrcweir     SdrDropMarkerOverlay*   pDropMarker;
47cdf0e10cSrcweir     SdrObject*              pDropMarkObj;
48cdf0e10cSrcweir     sal_Bool                    bInConstruct;
49cdf0e10cSrcweir     //HMHBOOL                   bDisableHdl;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     void            Construct();
52cdf0e10cSrcweir     void            UpdateBrowser();
53cdf0e10cSrcweir 
54cdf0e10cSrcweir protected:
55cdf0e10cSrcweir     virtual void    ModelHasChanged();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     // add custom handles (used by other apps, e.g. AnchorPos)
58cdf0e10cSrcweir     virtual void AddCustomHdl();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     void ImplClearCalcDropMarker();
61cdf0e10cSrcweir 
62*14af77b6SArmin Le Grand     // support enhanced text edit for draw objects
63*14af77b6SArmin Le Grand     virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const;
64*14af77b6SArmin Le Grand 
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir                     ScDrawView( OutputDevice* pOut, ScViewData* pData );
67cdf0e10cSrcweir     virtual         ~ScDrawView();
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     virtual void    MarkListHasChanged();
70cdf0e10cSrcweir     virtual void    Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     virtual void    DoConnect(SdrOle2Obj* pOleObj);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     virtual void    MakeVisible( const Rectangle& rRect, Window& rWin );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     virtual void    DeleteMarked();
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     void            DrawMarks( OutputDevice* pOut ) const;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     void            MarkDropObj( SdrObject* pObj );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     //HMHBOOL           IsDisableHdl() const    { return bDisableHdl; }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     void            SetMarkedToLayer( sal_uInt8 nLayerNo );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     void            InvalidateAttribs();
87cdf0e10cSrcweir     void            InvalidateDrawTextAttrs();
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     sal_Bool            BeginDrag( Window* pWindow, const Point& rStartPos );
90cdf0e10cSrcweir     void            DoCut();
91cdf0e10cSrcweir     void            DoCopy();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     void            GetScale( Fraction& rFractX, Fraction& rFractY ) const;
94cdf0e10cSrcweir     void            RecalcScale();
95cdf0e10cSrcweir     void            UpdateWorkArea();
96cdf0e10cSrcweir     SCTAB           GetTab() const      { return nTab; }
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     void            CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     void            SetAnchor( ScAnchorType );
101cdf0e10cSrcweir     ScAnchorType    GetAnchor() const;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     void            VCAddWin( Window* pWin );
104cdf0e10cSrcweir     void            VCRemoveWin( Window* pWin );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     void            UpdateIMap( SdrObject* pObj );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     sal_uInt16          GetPopupMenuId();
109cdf0e10cSrcweir     void            UpdateUserViewOptions();
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     void            SetMarkedOriginalSize();
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     sal_Bool            SelectObject( const String& rName );
114cdf0e10cSrcweir //UNUSED2008-05  String         GetSelectedChartName() const;
115cdf0e10cSrcweir     bool            HasMarkedControl() const;
116cdf0e10cSrcweir     bool            HasMarkedInternal() const;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     FASTBOOL        InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     /** Returns the selected object, if it is the caption object of a cell note.
121cdf0e10cSrcweir         @param ppCaptData  (out-param) If not null, returns the pointer to the caption object data. */
122cdf0e10cSrcweir     SdrObject*      GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 );
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     /** Locks/unlocks the specified layer in the draw page.
125cdf0e10cSrcweir         Unlocked layer is required to be able to edit the contained objects. */
126cdf0e10cSrcweir     void            LockCalcLayer( SdrLayerID nLayer, bool bLock = true );
127cdf0e10cSrcweir     /** Unlocks the specified layer in the draw page. */
128cdf0e10cSrcweir     inline void     UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     /** Locks/unlocks the background layer that contains background objects.
131cdf0e10cSrcweir         Unlocked layer is required to be able to edit the objects. */
132cdf0e10cSrcweir     inline void     LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); }
133cdf0e10cSrcweir     /** Unlocks the background layer that contains background objects. */
134cdf0e10cSrcweir     inline void     UnlockBackgroundLayer() { LockBackgroundLayer( false ); }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     /** Locks/unlocks the internal layer that contains caption objects of cell notes.
137cdf0e10cSrcweir         Unlocked layer is required to be able to edit the contained objects. */
138cdf0e10cSrcweir     inline void     LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); }
139cdf0e10cSrcweir     /** Unlocks the internal layer that contains caption objects of cell notes. */
140cdf0e10cSrcweir     inline void     UnlockInternalLayer() { LockInternalLayer( false ); }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     SdrEndTextEditKind  ScEndTextEdit();    // ruft SetDrawTextUndo(0)
143cdf0e10cSrcweir //UNUSED2009-05 void                    CaptionTextDirection(sal_uInt16 nSlot);
144cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
145cdf0e10cSrcweir };
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 
150cdf0e10cSrcweir #endif
151cdf0e10cSrcweir 
152