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

#include <titlebarupdate.hxx>

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

Classes

struct  TModuleInfo
 

Public Member Functions

 TitleBarUpdate (css::uno::Reference< css::uno::XComponentContext > xContext)
 
virtual ~TitleBarUpdate () 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 titleChanged (const css::frame::TitleChangedEvent &aEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &aEvent) override
 

Private Member Functions

bool implst_getModuleInfo (const css::uno::Reference< css::frame::XFrame > &xFrame, TModuleInfo &rInfo)
 identify the application module, which is used behind the component of our frame. More...
 
void impl_forceUpdate ()
 set a new icon and title on the title bar of our connected frame window. More...
 
void impl_updateIcon (const css::uno::Reference< css::frame::XFrame > &xFrame)
 identify the current component (inside the connected frame) and set the right module icon on the title bar. More...
 
void impl_updateTitle (const css::uno::Reference< css::frame::XFrame > &xFrame)
 gets the current title from the frame and set it on the window. More...
 
void impl_updateApplicationID (const css::uno::Reference< css::frame::XFrame > &xFrame)
 

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...
 

Detailed Description

Definition at line 38 of file titlebarupdate.hxx.

Constructor & Destructor Documentation

◆ TitleBarUpdate()

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

Definition at line 45 of file titlebarupdate.cxx.

◆ ~TitleBarUpdate()

framework::TitleBarUpdate::~TitleBarUpdate ( )
overridevirtual

Definition at line 50 of file titlebarupdate.cxx.

Member Function Documentation

◆ disposing()

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

Definition at line 104 of file titlebarupdate.cxx.

References m_xFrame, and xFrame.

◆ frameAction()

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

Definition at line 85 of file titlebarupdate.cxx.

References aEvent, and impl_forceUpdate().

◆ impl_forceUpdate()

void framework::TitleBarUpdate::impl_forceUpdate ( )
private

set a new icon and title on the title bar of our connected frame window.

@descr It does not check if an update is really needed. That has to be done outside. It retrieves all needed information and update the title bar - nothing less - nothing more.

Definition at line 197 of file titlebarupdate.cxx.

References impl_updateApplicationID(), impl_updateIcon(), impl_updateTitle(), m_xFrame, and xFrame.

Referenced by frameAction(), and titleChanged().

◆ impl_updateApplicationID()

void framework::TitleBarUpdate::impl_updateApplicationID ( const css::uno::Reference< css::frame::XFrame > &  xFrame)
private

◆ impl_updateIcon()

void framework::TitleBarUpdate::impl_updateIcon ( const css::uno::Reference< css::frame::XFrame > &  xFrame)
private

identify the current component (inside the connected frame) and set the right module icon on the title bar.

Parameters
xFramethe frame which contains the component and where the icon must be set on the window title bar.

Definition at line 221 of file titlebarupdate.cxx.

References aURL, DBG_UNHANDLED_EXCEPTION, framework::DEFAULT_ICON_ID, VclPtr< class reference_type >::get(), VCLUnoHelper::GetWindow(), implst_getModuleInfo(), framework::INVALID_ICON_ID, framework::TitleBarUpdate::TModuleInfo::nIcon, SystemWindow::SetIcon(), SystemWindow::SetRepresentedURL(), xController, xFrame, and xModel.

Referenced by impl_forceUpdate().

◆ impl_updateTitle()

void framework::TitleBarUpdate::impl_updateTitle ( const css::uno::Reference< css::frame::XFrame > &  xFrame)
private

gets the current title from the frame and set it on the window.

Parameters
xFramethe frame which contains the component and where the title must be set on the window title bar.

Definition at line 289 of file titlebarupdate.cxx.

References VclPtr< class reference_type >::get(), VCLUnoHelper::GetWindow(), SystemWindow::SetText(), and xFrame.

Referenced by impl_forceUpdate().

◆ implst_getModuleInfo()

bool framework::TitleBarUpdate::implst_getModuleInfo ( const css::uno::Reference< css::frame::XFrame > &  xFrame,
TModuleInfo rInfo 
)
private

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

Parameters
xFramecontains the component, which must be identified.
rInfodescribe the module in its details. Is set only if return value is true.
Returns
[sal_Bool] sal_True in case module could be identified and all needed values could be read. sal_False otherwise.

Definition at line 170 of file titlebarupdate.cxx.

References comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), framework::INVALID_ICON_ID, m_xContext, framework::TitleBarUpdate::TModuleInfo::nIcon, framework::OFFICEFACTORY_PROPNAME_ASCII_ICON, framework::TitleBarUpdate::TModuleInfo::sID, and xFrame.

Referenced by impl_updateIcon().

◆ initialize()

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

Definition at line 54 of file titlebarupdate.cxx.

References m_xFrame, and xFrame.

◆ titleChanged()

void SAL_CALL framework::TitleBarUpdate::titleChanged ( const css::frame::TitleChangedEvent &  aEvent)
overridevirtual

Definition at line 99 of file titlebarupdate.cxx.

References impl_forceUpdate().

Member Data Documentation

◆ m_xContext

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

may we need a uno service manager to create own services

Definition at line 61 of file titlebarupdate.hxx.

Referenced by impl_updateApplicationID(), and implst_getModuleInfo().

◆ m_xFrame

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

reference to the frame which was created by the office himself

Definition at line 64 of file titlebarupdate.hxx.

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


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