LibreOffice Module framework (master) 1
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
framework::PersistentWindowState Class Referencefinal

#include <persistentwindowstate.hxx>

Inheritance diagram for framework::PersistentWindowState:
[legend]
Collaboration diagram for framework::PersistentWindowState:
[legend]

Public Member Functions

 PersistentWindowState (css::uno::Reference< css::uno::XComponentContext > xContext)
 
virtual ~PersistentWindowState () override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &lArguments) override
 
virtual void SAL_CALL frameAction (const css::frame::FrameActionEvent &aEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &aEvent) override
 

Static Private Member Functions

static OUString implst_identifyModule (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XFrame > &xFrame)
 identify the application module, which is used behind the component of our frame. More...
 
static OUString implst_getWindowStateFromConfig (const css::uno::Reference< css::uno::XComponentContext > &rxContext, std::u16string_view sModuleName)
 retrieve the window state from the configuration. More...
 
static OUString implst_getWindowStateFromWindow (const css::uno::Reference< css::awt::XWindow > &xWindow)
 retrieve the window state from the container window. More...
 
static void implst_setWindowStateOnConfig (const css::uno::Reference< css::uno::XComponentContext > &rxContext, std::u16string_view sModuleName, const OUString &sWindowState)
 restore the position and size on the container window. More...
 
static void implst_setWindowStateOnWindow (const css::uno::Reference< css::awt::XWindow > &xWindow, std::u16string_view sWindowState)
 restore the position and size on the container window. More...
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 may we need a uno service manager to create own services More...
 
css::uno::WeakReference< css::frame::XFrame > m_xFrame
 reference to the frame which was created by the office himself More...
 
bool m_bWindowStateAlreadySet
 we call SetWindowState one times only for the same frame! More...
 

Detailed Description

Definition at line 52 of file persistentwindowstate.hxx.

Constructor & Destructor Documentation

◆ PersistentWindowState()

framework::PersistentWindowState::PersistentWindowState ( css::uno::Reference< css::uno::XComponentContext >  xContext)

Definition at line 38 of file persistentwindowstate.cxx.

◆ ~PersistentWindowState()

framework::PersistentWindowState::~PersistentWindowState ( )
overridevirtual

Definition at line 44 of file persistentwindowstate.cxx.

Member Function Documentation

◆ disposing()

void SAL_CALL framework::PersistentWindowState::disposing ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 136 of file persistentwindowstate.cxx.

References m_xFrame, and xFrame.

◆ frameAction()

void SAL_CALL framework::PersistentWindowState::frameAction ( const css::frame::FrameActionEvent &  aEvent)
overridevirtual

◆ implst_getWindowStateFromConfig()

OUString framework::PersistentWindowState::implst_getWindowStateFromConfig ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
std::u16string_view  sModuleName 
)
staticprivate

retrieve the window state from the configuration.

Parameters
rxContextneeded to create the configuration access.
sModuleNameidentifies the application module, where the information should be obtained for.
Returns
[string] contains the information about position and size.

Definition at line 165 of file persistentwindowstate.cxx.

References comphelper::ConfigurationHelper::readDirectKey(), and comphelper::ReadOnly.

Referenced by frameAction().

◆ implst_getWindowStateFromWindow()

OUString framework::PersistentWindowState::implst_getWindowStateFromWindow ( const css::uno::Reference< css::awt::XWindow > &  xWindow)
staticprivate

retrieve the window state from the container window.

Parameters
xWindowmust point to the container window of the frame. We use it VCL part here - because the toolkit doesn't provide the right functionality!
Returns
[string] contains the information about position and size.

Definition at line 205 of file persistentwindowstate.cxx.

References vcl::All, VclPtr< class reference_type >::get(), and VCLUnoHelper::GetWindow().

Referenced by frameAction().

◆ implst_identifyModule()

OUString framework::PersistentWindowState::implst_identifyModule ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::frame::XFrame > &  xFrame 
)
staticprivate

identify the application module, which is used behind the component of our frame.

Parameters
rxContextneeded to create needed uno resources.
xFramecontains the component, which must be identified.
Returns
[string] a module identifier for the current frame component.

Definition at line 145 of file persistentwindowstate.cxx.

References xFrame.

Referenced by frameAction().

◆ implst_setWindowStateOnConfig()

void framework::PersistentWindowState::implst_setWindowStateOnConfig ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
std::u16string_view  sModuleName,
const OUString &  sWindowState 
)
staticprivate

restore the position and size on the container window.

Parameters
rxContextneeded to create the configuration access.
sModuleNameidentifies the application module, where the information should be set on.
sWindowStatecontains the information about position and size.

Definition at line 186 of file persistentwindowstate.cxx.

References comphelper::Standard, and comphelper::ConfigurationHelper::writeDirectKey().

Referenced by frameAction().

◆ implst_setWindowStateOnWindow()

void framework::PersistentWindowState::implst_setWindowStateOnWindow ( const css::uno::Reference< css::awt::XWindow > &  xWindow,
std::u16string_view  sWindowState 
)
staticprivate

restore the position and size on the container window.

Parameters
xWindowmust point to the container window of the frame. We use it VCL part here - because the toolkit doesn't provide the right functionality!
sWindowStatecontains the information about position and size.

Definition at line 227 of file persistentwindowstate.cxx.

References VclPtr< class reference_type >::get(), VCLUnoHelper::GetWindow(), SystemWindow::GetWindowState(), WorkWindow::IsMinimized(), and SystemWindow::SetWindowState().

Referenced by frameAction().

◆ initialize()

void SAL_CALL framework::PersistentWindowState::initialize ( const css::uno::Sequence< css::uno::Any > &  lArguments)
overridevirtual

Definition at line 48 of file persistentwindowstate.cxx.

References m_xFrame, and xFrame.

Member Data Documentation

◆ m_bWindowStateAlreadySet

bool framework::PersistentWindowState::m_bWindowStateAlreadySet
private

we call SetWindowState one times only for the same frame!

Definition at line 68 of file persistentwindowstate.hxx.

Referenced by frameAction().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > framework::PersistentWindowState::m_xContext
private

may we need a uno service manager to create own services

Definition at line 62 of file persistentwindowstate.hxx.

Referenced by frameAction().

◆ m_xFrame

css::uno::WeakReference< css::frame::XFrame > framework::PersistentWindowState::m_xFrame
private

reference to the frame which was created by the office himself

Definition at line 65 of file persistentwindowstate.hxx.

Referenced by disposing(), frameAction(), and initialize().


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