1*9ee13d13SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9ee13d13SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ee13d13SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ee13d13SAndrew Rist  * distributed with this work for additional information
6*9ee13d13SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ee13d13SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ee13d13SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ee13d13SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ee13d13SAndrew Rist  *
11*9ee13d13SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ee13d13SAndrew Rist  *
13*9ee13d13SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ee13d13SAndrew Rist  * software distributed under the License is distributed on an
15*9ee13d13SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ee13d13SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ee13d13SAndrew Rist  * specific language governing permissions and limitations
18*9ee13d13SAndrew Rist  * under the License.
19*9ee13d13SAndrew Rist  *
20*9ee13d13SAndrew Rist  *************************************************************/
21*9ee13d13SAndrew Rist 
22*9ee13d13SAndrew Rist 
23cdf0e10cSrcweir #ifndef _REPORT_RPTUIFUNC_HXX
24cdf0e10cSrcweir #define _REPORT_RPTUIFUNC_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/timer.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir class Timer;
29cdf0e10cSrcweir class MouseEvent;
30cdf0e10cSrcweir class Point;
31cdf0e10cSrcweir class SdrTextObj;
32cdf0e10cSrcweir class SdrObject;
33cdf0e10cSrcweir namespace rptui
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class OReportSection;
37cdf0e10cSrcweir class OSectionView;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //============================================================================
40cdf0e10cSrcweir // DlgEdFunc
41cdf0e10cSrcweir //============================================================================
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class DlgEdFunc /* : public LinkHdl */
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     DlgEdFunc(const DlgEdFunc&);
46cdf0e10cSrcweir     void operator =(const DlgEdFunc&);
47cdf0e10cSrcweir protected:
48cdf0e10cSrcweir 	OReportSection* m_pParent;
49cdf0e10cSrcweir     OSectionView&   m_rView;
50cdf0e10cSrcweir 	Timer			aScrollTimer;
51cdf0e10cSrcweir     Point           m_aMDPos;
52cdf0e10cSrcweir     com::sun::star::uno::Reference<com::sun::star::uno::XInterface> m_xOverlappingObj;
53cdf0e10cSrcweir     SdrObject *     m_pOverlappingObj;
54cdf0e10cSrcweir     sal_Int32       m_nOverlappedControlColor;
55cdf0e10cSrcweir     sal_Int32       m_nOldColor;
56cdf0e10cSrcweir 	bool            m_bSelectionMode;
57cdf0e10cSrcweir     bool            m_bUiActive;
58cdf0e10cSrcweir     bool            m_bShowPropertyBrowser;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	DECL_LINK( ScrollTimeout, Timer * );
61cdf0e10cSrcweir 	void	ForceScroll( const Point& rPos );
62cdf0e10cSrcweir     /** checks that no other object is overlapped.
63cdf0e10cSrcweir     *
64cdf0e10cSrcweir     * \param rMEvt
65cdf0e10cSrcweir     */
66cdf0e10cSrcweir     void    checkMovementAllowed(const MouseEvent& rMEvt);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     /** sets the correct mouse pointer when moving a object
69cdf0e10cSrcweir     *
70cdf0e10cSrcweir     * \param rMEvt
71cdf0e10cSrcweir     * \return <TRUE/> when the pointer was already set.
72cdf0e10cSrcweir     */
73cdf0e10cSrcweir     bool    setMovementPointer(const MouseEvent& rMEvt);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     bool    isRectangleHit(const MouseEvent& rMEvt);
76cdf0e10cSrcweir 	/**
77cdf0e10cSrcweir 		returns true, as long as only customshapes in the marked list,
78cdf0e10cSrcweir 		custom shapes can drop every where
79cdf0e10cSrcweir 	*/
80cdf0e10cSrcweir 	bool    isOnlyCustomShapeMarked();
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     /** activate object if it is of type OBJ_OLE2
83cdf0e10cSrcweir     */
84cdf0e10cSrcweir     void    activateOle(SdrObject* _pObj);
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     void checkTwoCklicks(const MouseEvent& rMEvt);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir public:
89cdf0e10cSrcweir 	DlgEdFunc( OReportSection* pParent );
90cdf0e10cSrcweir 	virtual ~DlgEdFunc();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
93cdf0e10cSrcweir 	virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt );
94cdf0e10cSrcweir 	virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	/** checks if the keycode is known by the child windows
97cdf0e10cSrcweir 		@param	_rCode	the keycode
98cdf0e10cSrcweir 		@return <TRUE/> if the keycode is handled otherwise <FALSE/>
99cdf0e10cSrcweir 	*/
100cdf0e10cSrcweir 	virtual sal_Bool	handleKeyEvent(const KeyEvent& _rEvent);
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     /** returns <TRUE/> if the mouse event is over an existing object
103cdf0e10cSrcweir     *
104cdf0e10cSrcweir     * \param rMEvt
105cdf0e10cSrcweir     * \return <TRUE/> if overlapping, otherwise <FALSE/>
106cdf0e10cSrcweir     */
107cdf0e10cSrcweir     bool isOverlapping(const MouseEvent& rMEvt);
108cdf0e10cSrcweir     void setOverlappedControlColor(sal_Int32 _nColor);
109cdf0e10cSrcweir     void stopScrollTimer();
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     /** deactivate all ole object
112cdf0e10cSrcweir     */
113cdf0e10cSrcweir     void    deactivateOle(bool _bSelect = false);
114cdf0e10cSrcweir 
isUiActive() const115cdf0e10cSrcweir     inline bool isUiActive() const { return m_bUiActive; }
116cdf0e10cSrcweir protected:
117cdf0e10cSrcweir     void colorizeOverlappedObject(SdrObject* _pOverlappedObj);
118cdf0e10cSrcweir     void unColorizeOverlappedObj();
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 
121cdf0e10cSrcweir };
122cdf0e10cSrcweir 
123cdf0e10cSrcweir //============================================================================
124cdf0e10cSrcweir // DlgEdFuncInsert
125cdf0e10cSrcweir //============================================================================
126cdf0e10cSrcweir 
127cdf0e10cSrcweir class DlgEdFuncInsert : public DlgEdFunc
128cdf0e10cSrcweir {
129cdf0e10cSrcweir public:
130cdf0e10cSrcweir 	DlgEdFuncInsert( OReportSection* pParent );
131cdf0e10cSrcweir 	~DlgEdFuncInsert();
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
134cdf0e10cSrcweir 	virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt );
135cdf0e10cSrcweir 	virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
136cdf0e10cSrcweir };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir //============================================================================
139cdf0e10cSrcweir // DlgEdFuncSelect
140cdf0e10cSrcweir //============================================================================
141cdf0e10cSrcweir 
142cdf0e10cSrcweir class DlgEdFuncSelect : public DlgEdFunc
143cdf0e10cSrcweir {
144cdf0e10cSrcweir public:
145cdf0e10cSrcweir 	DlgEdFuncSelect( OReportSection* pParent );
146cdf0e10cSrcweir 	~DlgEdFuncSelect();
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt );
149cdf0e10cSrcweir 	virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt );
150cdf0e10cSrcweir 	virtual sal_Bool MouseMove( const MouseEvent& rMEvt );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, sal_Bool bQuickDrag);
153cdf0e10cSrcweir };
154cdf0e10cSrcweir 
155cdf0e10cSrcweir }
156cdf0e10cSrcweir #endif //_REPORT_RPTUIFUNC_HXX
157