LibreOffice Module sc (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ScVbaEventListener Class Reference
Inheritance diagram for ScVbaEventListener:
[legend]
Collaboration diagram for ScVbaEventListener:
[legend]

Public Member Functions

 ScVbaEventListener (ScVbaEventsHelper &rVbaEvents, const uno::Reference< frame::XModel > &rxModel, ScDocShell *pDocShell)
 
void startControllerListening (const uno::Reference< frame::XController > &rxController)
 Starts listening to the passed document controller. More...
 
void stopControllerListening (const uno::Reference< frame::XController > &rxController)
 Stops listening to the passed document controller. More...
 
virtual void SAL_CALL windowOpened (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowClosing (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowClosed (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowMinimized (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowNormalized (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowActivated (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowDeactivated (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowResized (const awt::WindowEvent &rEvent) override
 
virtual void SAL_CALL windowMoved (const awt::WindowEvent &rEvent) override
 
virtual void SAL_CALL windowShown (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL windowHidden (const lang::EventObject &rEvent) override
 
virtual void SAL_CALL borderWidthsChanged (const uno::Reference< uno::XInterface > &rSource, const frame::BorderWidths &aNewSize) override
 
virtual void SAL_CALL changesOccurred (const util::ChangesEvent &rEvent) override
 
virtual void SAL_CALL disposing (const lang::EventObject &rEvent) override
 

Private Types

typedef ::std::map< VclPtr< vcl::Window >, uno::Reference< frame::XController > > WindowControllerMap
 

Private Member Functions

void startModelListening ()
 Starts listening to the document model. More...
 
void stopModelListening ()
 Stops listening to the document model. More...
 
uno::Reference< frame::XController > getControllerForWindow (vcl::Window *pWindow) const
 Returns the controller for the passed VCL window. More...
 
void processWindowActivateEvent (vcl::Window *pWindow, bool bActivate)
 Calls the Workbook_Window[Activate|Deactivate] event handler. More...
 
void postWindowResizeEvent (vcl::Window *pWindow)
 Posts a Workbook_WindowResize user event. More...
 
 DECL_LINK (processWindowResizeEvent, void *, void)
 Callback link for Application::PostUserEvent(). More...
 

Private Attributes

::osl::Mutex maMutex
 
ScVbaEventsHelpermrVbaEvents
 
uno::Reference< frame::XModel > mxModel
 
ScDocShellmpDocShell
 
WindowControllerMap maControllers
 
std::multiset< VclPtr< vcl::Window > > m_PostedWindows
 Maps VCL top windows to their controllers. More...
 
VclPtr< vcl::WindowmpActiveWindow
 Keeps processWindowResizeEvent windows from being deleted between postWindowResizeEvent and processWindowResizeEvent. More...
 
bool mbWindowResized
 Currently activated window, to prevent multiple (de)activation. More...
 
bool mbBorderChanged
 True = window resize system event processed. More...
 
bool mbDisposed
 True = borders changed system event processed. More...
 

Detailed Description

Definition at line 120 of file vbaeventshelper.cxx.

Member Typedef Documentation

◆ WindowControllerMap

typedef ::std::map< VclPtr<vcl::Window>, uno::Reference< frame::XController > > ScVbaEventListener::WindowControllerMap
private

Definition at line 174 of file vbaeventshelper.cxx.

Constructor & Destructor Documentation

◆ ScVbaEventListener()

ScVbaEventListener::ScVbaEventListener ( ScVbaEventsHelper rVbaEvents,
const uno::Reference< frame::XModel > &  rxModel,
ScDocShell pDocShell 
)

Member Function Documentation

◆ borderWidthsChanged()

void SAL_CALL ScVbaEventListener::borderWidthsChanged ( const uno::Reference< uno::XInterface > &  rSource,
const frame::BorderWidths &  aNewSize 
)
overridevirtual

◆ changesOccurred()

void SAL_CALL ScVbaEventListener::changesOccurred ( const util::ChangesEvent &  rEvent)
overridevirtual

◆ DECL_LINK()

ScVbaEventListener::DECL_LINK ( processWindowResizeEvent  ,
void *  ,
void   
)
private

Callback link for Application::PostUserEvent().

◆ disposing()

void SAL_CALL ScVbaEventListener::disposing ( const lang::EventObject &  rEvent)
overridevirtual

◆ getControllerForWindow()

uno::Reference< frame::XController > ScVbaEventListener::getControllerForWindow ( vcl::Window pWindow) const
private

Returns the controller for the passed VCL window.

Definition at line 450 of file vbaeventshelper.cxx.

References maControllers.

Referenced by processWindowActivateEvent().

◆ postWindowResizeEvent()

void ScVbaEventListener::postWindowResizeEvent ( vcl::Window pWindow)
private

Posts a Workbook_WindowResize user event.

Definition at line 466 of file vbaeventshelper.cxx.

References LINK, m_PostedWindows, maControllers, mbBorderChanged, mbWindowResized, and Application::PostUserEvent().

Referenced by borderWidthsChanged(), and windowResized().

◆ processWindowActivateEvent()

void ScVbaEventListener::processWindowActivateEvent ( vcl::Window pWindow,
bool  bActivate 
)
private

Calls the Workbook_Window[Activate|Deactivate] event handler.

Definition at line 456 of file vbaeventshelper.cxx.

References getControllerForWindow(), mrVbaEvents, VbaEventsHelperBase::processVbaEventNoThrow(), and xController.

Referenced by windowActivated(), and windowDeactivated().

◆ startControllerListening()

void ScVbaEventListener::startControllerListening ( const uno::Reference< frame::XController > &  rxController)

Starts listening to the passed document controller.

Definition at line 211 of file vbaeventshelper.cxx.

References VCLUnoHelper::GetWindow(), maControllers, and maMutex.

Referenced by ScVbaEventListener().

◆ startModelListening()

void ScVbaEventListener::startModelListening ( )
private

Starts listening to the document model.

Definition at line 426 of file vbaeventshelper.cxx.

References mxModel.

Referenced by ScVbaEventListener().

◆ stopControllerListening()

void ScVbaEventListener::stopControllerListening ( const uno::Reference< frame::XController > &  rxController)

Stops listening to the passed document controller.

Definition at line 233 of file vbaeventshelper.cxx.

References VCLUnoHelper::GetWindow(), maControllers, maMutex, and mpActiveWindow.

Referenced by disposing().

◆ stopModelListening()

void ScVbaEventListener::stopModelListening ( )
private

Stops listening to the document model.

Definition at line 438 of file vbaeventshelper.cxx.

References mxModel.

Referenced by disposing().

◆ windowActivated()

void SAL_CALL ScVbaEventListener::windowActivated ( const lang::EventObject &  rEvent)
overridevirtual

◆ windowClosed()

void SAL_CALL ScVbaEventListener::windowClosed ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 265 of file vbaeventshelper.cxx.

◆ windowClosing()

void SAL_CALL ScVbaEventListener::windowClosing ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 261 of file vbaeventshelper.cxx.

◆ windowDeactivated()

void SAL_CALL ScVbaEventListener::windowDeactivated ( const lang::EventObject &  rEvent)
overridevirtual

◆ windowHidden()

void SAL_CALL ScVbaEventListener::windowHidden ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 334 of file vbaeventshelper.cxx.

◆ windowMinimized()

void SAL_CALL ScVbaEventListener::windowMinimized ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 269 of file vbaeventshelper.cxx.

◆ windowMoved()

void SAL_CALL ScVbaEventListener::windowMoved ( const awt::WindowEvent &  rEvent)
overridevirtual

Definition at line 326 of file vbaeventshelper.cxx.

◆ windowNormalized()

void SAL_CALL ScVbaEventListener::windowNormalized ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 273 of file vbaeventshelper.cxx.

◆ windowOpened()

void SAL_CALL ScVbaEventListener::windowOpened ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 257 of file vbaeventshelper.cxx.

◆ windowResized()

void SAL_CALL ScVbaEventListener::windowResized ( const awt::WindowEvent &  rEvent)
overridevirtual

◆ windowShown()

void SAL_CALL ScVbaEventListener::windowShown ( const lang::EventObject &  rEvent)
overridevirtual

Definition at line 330 of file vbaeventshelper.cxx.

Member Data Documentation

◆ m_PostedWindows

std::multiset< VclPtr<vcl::Window> > ScVbaEventListener::m_PostedWindows
private

Maps VCL top windows to their controllers.

Definition at line 181 of file vbaeventshelper.cxx.

Referenced by postWindowResizeEvent().

◆ maControllers

WindowControllerMap ScVbaEventListener::maControllers
private

◆ maMutex

::osl::Mutex ScVbaEventListener::maMutex
private

◆ mbBorderChanged

bool ScVbaEventListener::mbBorderChanged
private

True = window resize system event processed.

Definition at line 184 of file vbaeventshelper.cxx.

Referenced by borderWidthsChanged(), postWindowResizeEvent(), and windowResized().

◆ mbDisposed

bool ScVbaEventListener::mbDisposed
private

True = borders changed system event processed.

Definition at line 185 of file vbaeventshelper.cxx.

Referenced by borderWidthsChanged(), changesOccurred(), disposing(), windowActivated(), windowDeactivated(), and windowResized().

◆ mbWindowResized

bool ScVbaEventListener::mbWindowResized
private

Currently activated window, to prevent multiple (de)activation.

Definition at line 183 of file vbaeventshelper.cxx.

Referenced by borderWidthsChanged(), postWindowResizeEvent(), and windowResized().

◆ mpActiveWindow

VclPtr<vcl::Window> ScVbaEventListener::mpActiveWindow
private

Keeps processWindowResizeEvent windows from being deleted between postWindowResizeEvent and processWindowResizeEvent.

Definition at line 182 of file vbaeventshelper.cxx.

Referenced by stopControllerListening(), windowActivated(), and windowDeactivated().

◆ mpDocShell

ScDocShell* ScVbaEventListener::mpDocShell
private

Definition at line 179 of file vbaeventshelper.cxx.

Referenced by changesOccurred().

◆ mrVbaEvents

ScVbaEventsHelper& ScVbaEventListener::mrVbaEvents
private

Definition at line 177 of file vbaeventshelper.cxx.

Referenced by changesOccurred(), and processWindowActivateEvent().

◆ mxModel

uno::Reference< frame::XModel > ScVbaEventListener::mxModel
private

The documentation for this class was generated from the following file: