1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgedfunc.hxx,v $
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>
46 //============================================================================
48 //============================================================================
50 class DlgEdFunc
/* : public LinkHdl */
52 DlgEdFunc(const DlgEdFunc
&);
53 void operator =(const DlgEdFunc
&);
55 OReportSection
* m_pParent
;
56 OSectionView
& m_rView
;
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
;
65 bool m_bShowPropertyBrowser
;
67 DECL_LINK( ScrollTimeout
, Timer
* );
68 void ForceScroll( const Point
& rPos
);
69 /** checks that no other object is overlapped.
73 void checkMovementAllowed(const MouseEvent
& rMEvt
);
75 /** sets the correct mouse pointer when moving a object
78 * \return <TRUE/> when the pointer was already set.
80 bool setMovementPointer(const MouseEvent
& rMEvt
);
82 bool isRectangleHit(const MouseEvent
& rMEvt
);
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
);
96 DlgEdFunc( OReportSection
* pParent
);
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
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
; }
124 void colorizeOverlappedObject(SdrObject
* _pOverlappedObj
);
125 void unColorizeOverlappedObj();
130 //============================================================================
132 //============================================================================
134 class DlgEdFuncInsert
: public DlgEdFunc
137 DlgEdFuncInsert( OReportSection
* pParent
);
140 virtual BOOL
MouseButtonDown( const MouseEvent
& rMEvt
);
141 virtual BOOL
MouseButtonUp( const MouseEvent
& rMEvt
);
142 virtual BOOL
MouseMove( const MouseEvent
& rMEvt
);
145 //============================================================================
147 //============================================================================
149 class DlgEdFuncSelect
: public DlgEdFunc
152 DlgEdFuncSelect( OReportSection
* pParent
);
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