sync master with lastest vba changes
[ooovba.git] / reportdesign / source / ui / inc / dlgedfunc.hxx
blob243f54348cbe72c0b0afb5cd240c728f56b7295e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgedfunc.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _REPORT_RPTUIFUNC_HXX
31 #define _REPORT_RPTUIFUNC_HXX
33 #include <vcl/timer.hxx>
35 class Timer;
36 class MouseEvent;
37 class Point;
38 class SdrTextObj;
39 class SdrObject;
40 namespace rptui
43 class OReportSection;
44 class OSectionView;
46 //============================================================================
47 // DlgEdFunc
48 //============================================================================
50 class DlgEdFunc /* : public LinkHdl */
52 DlgEdFunc(const DlgEdFunc&);
53 void operator =(const DlgEdFunc&);
54 protected:
55 OReportSection* m_pParent;
56 OSectionView& m_rView;
57 Timer aScrollTimer;
58 Point m_aMDPos;
59 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> m_xOverlappingObj;
60 SdrObject * m_pOverlappingObj;
61 sal_Int32 m_nOverlappedControlColor;
62 sal_Int32 m_nOldColor;
63 bool m_bSelectionMode;
64 bool m_bUiActive;
65 bool m_bShowPropertyBrowser;
67 DECL_LINK( ScrollTimeout, Timer * );
68 void ForceScroll( const Point& rPos );
69 /** checks that no other object is overlapped.
71 * \param rMEvt
73 void checkMovementAllowed(const MouseEvent& rMEvt);
75 /** sets the correct mouse pointer when moving a object
77 * \param rMEvt
78 * \return <TRUE/> when the pointer was already set.
80 bool setMovementPointer(const MouseEvent& rMEvt);
82 bool isRectangleHit(const MouseEvent& rMEvt);
83 /**
84 returns true, as long as only customshapes in the marked list,
85 custom shapes can drop every where
87 bool isOnlyCustomShapeMarked();
89 /** activate object if it is of type OBJ_OLE2
91 void activateOle(SdrObject* _pObj);
93 void checkTwoCklicks(const MouseEvent& rMEvt);
95 public:
96 DlgEdFunc( OReportSection* pParent );
97 virtual ~DlgEdFunc();
99 virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
100 virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
101 virtual BOOL MouseMove( const MouseEvent& rMEvt );
103 /** checks if the keycode is known by the child windows
104 @param _rCode the keycode
105 @return <TRUE/> if the keycode is handled otherwise <FALSE/>
107 virtual sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
109 /** returns <TRUE/> if the mouse event is over an existing object
111 * \param rMEvt
112 * \return <TRUE/> if overlapping, otherwise <FALSE/>
114 bool isOverlapping(const MouseEvent& rMEvt);
115 void setOverlappedControlColor(sal_Int32 _nColor);
116 void stopScrollTimer();
118 /** deactivate all ole object
120 void deactivateOle(bool _bSelect = false);
122 inline bool isUiActive() const { return m_bUiActive; }
123 protected:
124 void colorizeOverlappedObject(SdrObject* _pOverlappedObj);
125 void unColorizeOverlappedObj();
130 //============================================================================
131 // DlgEdFuncInsert
132 //============================================================================
134 class DlgEdFuncInsert : public DlgEdFunc
136 public:
137 DlgEdFuncInsert( OReportSection* pParent );
138 ~DlgEdFuncInsert();
140 virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
141 virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
142 virtual BOOL MouseMove( const MouseEvent& rMEvt );
145 //============================================================================
146 // DlgEdFuncSelect
147 //============================================================================
149 class DlgEdFuncSelect : public DlgEdFunc
151 public:
152 DlgEdFuncSelect( OReportSection* pParent );
153 ~DlgEdFuncSelect();
155 virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
156 virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
157 virtual BOOL MouseMove( const MouseEvent& rMEvt );
159 void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag);
163 #endif //_REPORT_RPTUIFUNC_HXX