LibreOffice Module framework (master) 1
|
can be used as implementation helper of interface css.frame.XTitle More...
#include <titlehelper.hxx>
Public Member Functions | |
TitleHelper (css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::uno::XInterface > &xOwner, const css::uno::Reference< css::frame::XUntitledNumbers > &xNumbers) | |
set an outside component which uses this container and must be set as source of all broadcasted messages, exceptions. More... | |
virtual | ~TitleHelper () override |
free all internally used resources. More... | |
virtual OUString SAL_CALL | getTitle () override |
virtual void SAL_CALL | setTitle (const OUString &sTitle) override |
virtual void SAL_CALL | addTitleChangeListener (const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override |
virtual void SAL_CALL | removeTitleChangeListener (const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override |
virtual void SAL_CALL | titleChanged (const css::frame::TitleChangedEvent &aEvent) override |
virtual void SAL_CALL | documentEventOccured (const css::document::DocumentEvent &aEvent) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &aEvent) override |
virtual void SAL_CALL | frameAction (const css::frame::FrameActionEvent &aEvent) override |
Private Member Functions | |
void | impl_sendTitleChangedEvent () |
void | impl_updateTitle (bool init=false) |
void | impl_updateTitleForModel (const css::uno::Reference< css::frame::XModel3 > &xModel, bool init) |
void | impl_updateTitleForController (const css::uno::Reference< css::frame::XController > &xController, bool init) |
void | impl_updateTitleForFrame (const css::uno::Reference< css::frame::XFrame > &xFrame, bool init) |
void | impl_startListeningForModel (const css::uno::Reference< css::frame::XModel > &xModel) |
void | impl_startListeningForController (const css::uno::Reference< css::frame::XController > &xController) |
void | impl_startListeningForFrame (const css::uno::Reference< css::frame::XFrame > &xFrame) |
void | impl_updateListeningForFrame (const css::uno::Reference< css::frame::XFrame > &xFrame) |
void | impl_appendComponentTitle (OUStringBuffer &sTitle, const css::uno::Reference< css::uno::XInterface > &xComponent) |
void | impl_appendProductName (OUStringBuffer &sTitle) |
void | impl_appendModuleName (OUStringBuffer &sTitle) |
void | impl_appendDebugVersion (OUStringBuffer &sTitle) |
void | impl_appendSafeMode (OUStringBuffer &sTitle) |
void | impl_setSubTitle (const css::uno::Reference< css::frame::XTitle > &xSubTitle) |
OUString | impl_convertURL2Title (std::u16string_view sURL) |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
points to the global uno service manager. More... | |
css::uno::WeakReference< css::uno::XInterface > | m_xOwner |
reference to the outside UNO class using this helper. More... | |
css::uno::WeakReference< css::frame::XUntitledNumbers > | m_xUntitledNumbers |
used to know how an "Untitled X" string can be created right :-) More... | |
css::uno::WeakReference< css::frame::XTitle > | m_xSubTitle |
provides parts of our own title and we listen there for changes too. More... | |
bool | m_bExternalTitle |
if it's set to sal_True the member m_sTitle has not to be changed internally. More... | |
OUString | m_sTitle |
the actual title value More... | |
::sal_Int32 | m_nLeasedNumber |
knows the leased number which must be used for untitled components. More... | |
comphelper::OMultiTypeInterfaceContainerHelper2 | m_aListener |
contains all title change listener More... | |
Private Attributes inherited from cppu::BaseMutex | |
mutable::osl::Mutex | m_aMutex |
can be used as implementation helper of interface css.frame.XTitle
@threadsafe
Definition at line 53 of file titlehelper.hxx.
framework::TitleHelper::TitleHelper | ( | css::uno::Reference< css::uno::XComponentContext > | xContext, |
const css::uno::Reference< css::uno::XInterface > & | xOwner, | ||
const css::uno::Reference< css::frame::XUntitledNumbers > & | xNumbers | ||
) |
set an outside component which uses this container and must be set as source of all broadcasted messages, exceptions.
It's holded weak only so we do not need any complex dispose sessions.
Note: Passing NULL as parameter will be allowed. It will reset the internal member reference only.
xOwner | the new owner of this collection. |
xNumbers | provides the right string and number for an untitled component. |
Definition at line 49 of file titlehelper.cxx.
References impl_startListeningForController(), impl_startListeningForFrame(), impl_startListeningForModel(), m_aListener, cppu::BaseMutex::m_aMutex, m_xOwner, m_xUntitledNumbers, xController, xFrame, and xModel.
|
overridevirtual |
free all internally used resources.
Definition at line 89 of file titlehelper.cxx.
|
overridevirtual |
Definition at line 129 of file titlehelper.cxx.
References comphelper::OMultiTypeInterfaceContainerHelper2::addInterface(), and m_aListener.
|
overridevirtual |
Definition at line 212 of file titlehelper.cxx.
References aEvent, cppu::BaseMutex::m_aMutex, m_nLeasedNumber, m_sTitle, m_xOwner, m_xUntitledNumbers, and xFrame.
|
overridevirtual |
Definition at line 158 of file titlehelper.cxx.
References aEvent, impl_updateTitle(), cppu::BaseMutex::m_aMutex, and m_xOwner.
|
overridevirtual |
Definition at line 185 of file titlehelper.cxx.
References aEvent, impl_updateListeningForFrame(), impl_updateTitle(), cppu::BaseMutex::m_aMutex, and m_xOwner.
|
overridevirtual |
Definition at line 93 of file titlehelper.cxx.
References impl_updateTitle(), cppu::BaseMutex::m_aMutex, m_bExternalTitle, and m_sTitle.
|
private |
Definition at line 525 of file titlehelper.cxx.
Referenced by impl_updateTitleForFrame().
|
private |
Definition at line 584 of file titlehelper.cxx.
References utl::Bootstrap::getBuildIdData(), and utl::ConfigManager::getProductVersion().
Referenced by impl_updateTitleForFrame().
|
private |
Definition at line 549 of file titlehelper.cxx.
References comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), cppu::BaseMutex::m_aMutex, m_xContext, m_xOwner, and framework::OFFICEFACTORY_PROPNAME_ASCII_UINAME.
Referenced by impl_updateTitleForFrame().
|
private |
Definition at line 535 of file titlehelper.cxx.
References FwkResId(), utl::ConfigManager::getProductName(), name, and separator.
Referenced by impl_updateTitleForFrame().
|
private |
Definition at line 600 of file titlehelper.cxx.
References FwkResId(), and Application::IsSafeModeEnabled().
Referenced by impl_updateTitleForFrame().
|
private |
Definition at line 661 of file titlehelper.cxx.
References aURL, INetURLObject::LAST_SEGMENT, and INetURLObject::WithCharset.
Referenced by impl_updateTitleForModel().
|
private |
Definition at line 254 of file titlehelper.cxx.
References aEvent, comphelper::OMultiTypeInterfaceContainerHelper2::getContainer(), comphelper::OInterfaceIteratorHelper2::hasMoreElements(), m_aListener, cppu::BaseMutex::m_aMutex, m_sTitle, m_xOwner, comphelper::OInterfaceIteratorHelper2::next(), comphelper::OInterfaceIteratorHelper2::remove(), and titleChanged().
Referenced by impl_updateTitleForController(), impl_updateTitleForFrame(), impl_updateTitleForModel(), and setTitle().
|
private |
Definition at line 634 of file titlehelper.cxx.
References cppu::BaseMutex::m_aMutex, and m_xSubTitle.
Referenced by impl_startListeningForController(), and impl_updateListeningForFrame().
|
private |
Definition at line 615 of file titlehelper.cxx.
References impl_setSubTitle(), and xController.
Referenced by TitleHelper().
|
private |
Definition at line 622 of file titlehelper.cxx.
References impl_updateListeningForFrame(), and xFrame.
Referenced by TitleHelper().
|
private |
|
private |
Definition at line 628 of file titlehelper.cxx.
References impl_setSubTitle(), and xFrame.
Referenced by frameAction(), and impl_startListeningForFrame().
|
private |
Definition at line 288 of file titlehelper.cxx.
References impl_updateTitleForController(), impl_updateTitleForFrame(), impl_updateTitleForModel(), init(), cppu::BaseMutex::m_aMutex, m_xOwner, xController, xFrame, and xModel.
Referenced by documentEventOccured(), frameAction(), getTitle(), and titleChanged().
|
private |
Definition at line 396 of file titlehelper.cxx.
References aURL, FwkResId(), impl_sendTitleChangedEvent(), init(), cppu::BaseMutex::m_aMutex, m_bExternalTitle, m_nLeasedNumber, m_sTitle, m_xOwner, m_xUntitledNumbers, xController, and xModel.
Referenced by impl_updateTitle().
|
private |
Definition at line 475 of file titlehelper.cxx.
References impl_appendComponentTitle(), impl_appendDebugVersion(), impl_appendModuleName(), impl_appendProductName(), impl_appendSafeMode(), impl_sendTitleChangedEvent(), init(), utl::ConfigManager::IsFuzzing(), cppu::BaseMutex::m_aMutex, m_bExternalTitle, m_sTitle, and xFrame.
Referenced by impl_updateTitle().
|
private |
Definition at line 317 of file titlehelper.cxx.
References impl_convertURL2Title(), impl_sendTitleChangedEvent(), init(), cppu::BaseMutex::m_aMutex, m_bExternalTitle, m_nLeasedNumber, m_sTitle, m_xOwner, m_xUntitledNumbers, utl::MediaDescriptor::PROP_SUGGESTEDSAVEASNAME, sSuggestedSaveAsName, and xModel.
Referenced by impl_updateTitle().
|
overridevirtual |
Definition at line 135 of file titlehelper.cxx.
References m_aListener, and comphelper::OMultiTypeInterfaceContainerHelper2::removeInterface().
|
overridevirtual |
Definition at line 115 of file titlehelper.cxx.
References impl_sendTitleChangedEvent(), cppu::BaseMutex::m_aMutex, m_bExternalTitle, and m_sTitle.
|
overridevirtual |
Definition at line 141 of file titlehelper.cxx.
References aEvent, impl_updateTitle(), cppu::BaseMutex::m_aMutex, and m_xSubTitle.
Referenced by impl_sendTitleChangedEvent().
|
private |
contains all title change listener
Definition at line 174 of file titlehelper.hxx.
Referenced by addTitleChangeListener(), impl_sendTitleChangedEvent(), and removeTitleChangeListener().
|
private |
if it's set to sal_True the member m_sTitle has not to be changed internally.
It was set from outside and so outside code has to make sure it will be updated.
Definition at line 165 of file titlehelper.hxx.
Referenced by getTitle(), impl_updateTitleForController(), impl_updateTitleForFrame(), impl_updateTitleForModel(), and setTitle().
|
private |
knows the leased number which must be used for untitled components.
Definition at line 171 of file titlehelper.hxx.
Referenced by disposing(), impl_updateTitleForController(), and impl_updateTitleForModel().
|
private |
the actual title value
Definition at line 168 of file titlehelper.hxx.
Referenced by disposing(), getTitle(), impl_sendTitleChangedEvent(), impl_updateTitleForController(), impl_updateTitleForFrame(), impl_updateTitleForModel(), and setTitle().
|
private |
points to the global uno service manager.
Definition at line 150 of file titlehelper.hxx.
Referenced by impl_appendModuleName().
|
private |
reference to the outside UNO class using this helper.
Definition at line 153 of file titlehelper.hxx.
Referenced by disposing(), documentEventOccured(), frameAction(), impl_appendModuleName(), impl_sendTitleChangedEvent(), impl_updateTitle(), impl_updateTitleForController(), impl_updateTitleForModel(), and TitleHelper().
|
private |
provides parts of our own title and we listen there for changes too.
Definition at line 159 of file titlehelper.hxx.
Referenced by impl_setSubTitle(), and titleChanged().
|
private |
used to know how an "Untitled X" string can be created right :-)
Definition at line 156 of file titlehelper.hxx.
Referenced by disposing(), impl_updateTitleForController(), impl_updateTitleForModel(), and TitleHelper().