xref: /trunk/main/sc/source/ui/inc/drawview.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_DRAWVIEW_HXX
29 #define SC_DRAWVIEW_HXX
30 
31 #include <svx/fmview.hxx>
32 
33 #include "global.hxx"
34 
35 namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } }
36 
37 class ScDocument;
38 class ScViewData;
39 class ScDrawObjData;
40 
41 class ScDrawView: public FmFormView
42 {
43     ScViewData*             pViewData;
44     OutputDevice*           pDev;                   //! noetig ?
45     ScDocument*             pDoc;
46     SCTAB                   nTab;
47     Fraction                aScaleX;                // Faktor fuer Drawing-MapMode
48     Fraction                aScaleY;
49     SdrDropMarkerOverlay*   pDropMarker;
50     SdrObject*              pDropMarkObj;
51     sal_Bool                    bInConstruct;
52     //HMHBOOL                   bDisableHdl;
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            DrawMarks( OutputDevice* pOut ) const;
79 
80     void            MarkDropObj( SdrObject* pObj );
81 
82     //HMHBOOL           IsDisableHdl() const    { return bDisableHdl; }
83 
84     void            SetMarkedToLayer( sal_uInt8 nLayerNo );
85 
86     void            InvalidateAttribs();
87     void            InvalidateDrawTextAttrs();
88 
89     sal_Bool            BeginDrag( Window* pWindow, const Point& rStartPos );
90     void            DoCut();
91     void            DoCopy();
92 
93     void            GetScale( Fraction& rFractX, Fraction& rFractY ) const;
94     void            RecalcScale();
95     void            UpdateWorkArea();
96     SCTAB           GetTab() const      { return nTab; }
97 
98     void            CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const;
99 
100     void            SetAnchor( ScAnchorType );
101     ScAnchorType    GetAnchor() const;
102 
103     void            VCAddWin( Window* pWin );
104     void            VCRemoveWin( Window* pWin );
105 
106     void            UpdateIMap( SdrObject* pObj );
107 
108     sal_uInt16          GetPopupMenuId();
109     void            UpdateUserViewOptions();
110 
111     void            SetMarkedOriginalSize();
112 
113     sal_Bool            SelectObject( const String& rName );
114 //UNUSED2008-05  String         GetSelectedChartName() const;
115     bool            HasMarkedControl() const;
116     bool            HasMarkedInternal() const;
117 
118     FASTBOOL        InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0);
119 
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 );
123 
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 ); }
129 
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 ); }
135 
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 ); }
141 
142     SdrEndTextEditKind  ScEndTextEdit();    // ruft SetDrawTextUndo(0)
143 //UNUSED2009-05 void                    CaptionTextDirection(sal_uInt16 nSlot);
144     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable();
145 };
146 
147 
148 
149 
150 #endif
151 
152