20#ifndef INCLUDED_FRAMEWORK_TITLEHELPER_HXX
21#define INCLUDED_FRAMEWORK_TITLEHELPER_HXX
23#include <com/sun/star/uno/Reference.hxx>
24#include <com/sun/star/frame/XTitle.hpp>
25#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
26#include <com/sun/star/frame/XFrameActionListener.hpp>
27#include <com/sun/star/document/XDocumentEventListener.hpp>
34#include <rtl/ustrbuf.hxx>
54 ,
public ::cppu::WeakImplHelper< css::frame::XTitle ,
55 css::frame::XTitleChangeBroadcaster,
56 css::frame::XTitleChangeListener ,
57 css::frame::XFrameActionListener ,
58 css::document::XDocumentEventListener >
78 TitleHelper(css::uno::Reference< css::uno::XComponentContext > xContext,
79 const css::uno::Reference< css::uno::XInterface >& xOwner,
80 const css::uno::Reference< css::frame::XUntitledNumbers >& xNumbers);
88 virtual OUString SAL_CALL
getTitle()
override;
92 virtual void SAL_CALL setTitle(
const OUString& sTitle)
override;
96 virtual void SAL_CALL addTitleChangeListener(
const css::uno::Reference< css::frame::XTitleChangeListener >& xListener)
override;
100 virtual void SAL_CALL removeTitleChangeListener(
const css::uno::Reference< css::frame::XTitleChangeListener >& xListener)
override;
104 virtual void SAL_CALL titleChanged(
const css::frame::TitleChangedEvent&
aEvent)
override;
108 virtual void SAL_CALL documentEventOccured(
const css::document::DocumentEvent&
aEvent)
override;
112 virtual void SAL_CALL disposing(
const css::lang::EventObject&
aEvent)
override;
116 virtual void SAL_CALL frameAction(
const css::frame::FrameActionEvent&
aEvent)
override;
122 void impl_sendTitleChangedEvent ();
124 void impl_updateTitle (
bool init =
false);
125 void impl_updateTitleForModel (
const css::uno::Reference< css::frame::XModel3 >&
xModel,
bool init);
126 void impl_updateTitleForController (
const css::uno::Reference< css::frame::XController >&
xController,
bool init);
127 void impl_updateTitleForFrame (
const css::uno::Reference< css::frame::XFrame >&
xFrame,
bool init);
129 void impl_startListeningForModel (
const css::uno::Reference< css::frame::XModel >&
xModel);
130 void impl_startListeningForController (
const css::uno::Reference< css::frame::XController >&
xController);
131 void impl_startListeningForFrame (
const css::uno::Reference< css::frame::XFrame >&
xFrame);
132 void impl_updateListeningForFrame (
const css::uno::Reference< css::frame::XFrame >&
xFrame);
134 void impl_appendComponentTitle ( OUStringBuffer& sTitle ,
135 const css::uno::Reference< css::uno::XInterface >& xComponent);
136 void impl_appendProductName (OUStringBuffer& sTitle);
137 void impl_appendModuleName (OUStringBuffer& sTitle);
138 void impl_appendDebugVersion (OUStringBuffer& sTitle);
139 void impl_appendSafeMode (OUStringBuffer& sTitle);
141 void impl_setSubTitle (
const css::uno::Reference< css::frame::XTitle >& xSubTitle);
143 OUString impl_convertURL2Title(std::u16string_view sURL);
150 css::uno::Reference< css::uno::XComponentContext>
m_xContext;
153 css::uno::WeakReference< css::uno::XInterface >
m_xOwner;
FILE * init(int, char **)
can be used as implementation helper of interface css.frame.XTitle
comphelper::OMultiTypeInterfaceContainerHelper2 m_aListener
contains all title change listener
::sal_Int32 m_nLeasedNumber
knows the leased number which must be used for untitled components.
css::uno::Reference< css::uno::XComponentContext > m_xContext
points to the global uno service manager.
bool m_bExternalTitle
if it's set to sal_True the member m_sTitle has not to be changed internally.
css::uno::WeakReference< css::frame::XTitle > m_xSubTitle
provides parts of our own title and we listen there for changes too.
css::uno::WeakReference< css::uno::XInterface > m_xOwner
reference to the outside UNO class using this helper.
css::uno::WeakReference< css::frame::XUntitledNumbers > m_xUntitledNumbers
used to know how an "Untitled X" string can be created right :-)
OUString m_sTitle
the actual title value
std::u16string_view getTitle(std::u16string_view aPath)
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel