1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _REPORT_RPTUIFUNC_HXX
20 #define _REPORT_RPTUIFUNC_HXX
22 #include <vcl/timer.hxx>
35 //============================================================================
37 //============================================================================
39 class DlgEdFunc
/* : public LinkHdl */
41 DlgEdFunc(const DlgEdFunc
&);
42 void operator =(const DlgEdFunc
&);
44 OReportSection
* m_pParent
;
45 OSectionView
& m_rView
;
48 com::sun::star::uno::Reference
<com::sun::star::uno::XInterface
> m_xOverlappingObj
;
49 SdrObject
* m_pOverlappingObj
;
50 sal_Int32 m_nOverlappedControlColor
;
51 sal_Int32 m_nOldColor
;
52 bool m_bSelectionMode
;
54 bool m_bShowPropertyBrowser
;
56 DECL_LINK( ScrollTimeout
, Timer
* );
57 void ForceScroll( const Point
& rPos
);
58 /** checks that no other object is overlapped.
62 void checkMovementAllowed(const MouseEvent
& rMEvt
);
64 /** sets the correct mouse pointer when moving a object
67 * \return <TRUE/> when the pointer was already set.
69 bool setMovementPointer(const MouseEvent
& rMEvt
);
71 bool isRectangleHit(const MouseEvent
& rMEvt
);
73 returns true, as long as only customshapes in the marked list,
74 custom shapes can drop every where
76 bool isOnlyCustomShapeMarked();
78 /** activate object if it is of type OBJ_OLE2
80 void activateOle(SdrObject
* _pObj
);
82 void checkTwoCklicks(const MouseEvent
& rMEvt
);
85 DlgEdFunc( OReportSection
* pParent
);
88 virtual sal_Bool
MouseButtonDown( const MouseEvent
& rMEvt
);
89 virtual sal_Bool
MouseButtonUp( const MouseEvent
& rMEvt
);
90 virtual sal_Bool
MouseMove( const MouseEvent
& rMEvt
);
92 /** checks if the keycode is known by the child windows
93 @param _rCode the keycode
94 @return <TRUE/> if the keycode is handled otherwise <FALSE/>
96 virtual sal_Bool
handleKeyEvent(const KeyEvent
& _rEvent
);
98 /** returns <TRUE/> if the mouse event is over an existing object
101 * \return <TRUE/> if overlapping, otherwise <FALSE/>
103 bool isOverlapping(const MouseEvent
& rMEvt
);
104 void setOverlappedControlColor(sal_Int32 _nColor
);
105 void stopScrollTimer();
107 /** deactivate all ole object
109 void deactivateOle(bool _bSelect
= false);
111 inline bool isUiActive() const { return m_bUiActive
; }
113 void colorizeOverlappedObject(SdrObject
* _pOverlappedObj
);
114 void unColorizeOverlappedObj();
119 //============================================================================
121 //============================================================================
123 class DlgEdFuncInsert
: public DlgEdFunc
126 DlgEdFuncInsert( OReportSection
* pParent
);
129 virtual sal_Bool
MouseButtonDown( const MouseEvent
& rMEvt
);
130 virtual sal_Bool
MouseButtonUp( const MouseEvent
& rMEvt
);
131 virtual sal_Bool
MouseMove( const MouseEvent
& rMEvt
);
134 //============================================================================
136 //============================================================================
138 class DlgEdFuncSelect
: public DlgEdFunc
141 DlgEdFuncSelect( OReportSection
* pParent
);
144 virtual sal_Bool
MouseButtonDown( const MouseEvent
& rMEvt
);
145 virtual sal_Bool
MouseButtonUp( const MouseEvent
& rMEvt
);
146 virtual sal_Bool
MouseMove( const MouseEvent
& rMEvt
);
148 void SetInEditMode(SdrTextObj
* _pTextObj
,const MouseEvent
& rMEvt
, sal_Bool bQuickDrag
);
152 #endif //_REPORT_RPTUIFUNC_HXX
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */