LibreOffice Module sd (master) 1
|
The purpose of the <type>WindowUpdater</type> is to update output devices to take care of modified global values. More...
#include <WindowUpdater.hxx>
Public Member Functions | |
WindowUpdater () | |
virtual | ~WindowUpdater () noexcept override |
void | RegisterWindow (vcl::Window *pWindow) |
Add the given device to the list of devices which will be updated when one of the monitored values changes. More... | |
void | UnregisterWindow (vcl::Window *pWindow) |
Remove the given device from the list of devices which will be updated when one of the monitored values changes. More... | |
void | SetDocument (SdDrawDocument *pDocument) |
Set the document so that it is reformatted when one of the monitored values changes. More... | |
virtual void | ConfigurationChanged (utl::ConfigurationBroadcaster *, ConfigurationHints nHint) override |
Callback that waits for notifications of a <type>SvtCTLOptions</type> object. More... | |
Public Member Functions inherited from utl::ConfigurationListener | |
virtual | ~ConfigurationListener () |
virtual void | ConfigurationChanged (ConfigurationBroadcaster *p, ConfigurationHints nHint)=0 |
Static Public Member Functions | |
static void | Update (OutputDevice *pDevice) |
Update the given output device and update all text objects of the view shell if not told otherwise. More... | |
Private Types | |
typedef ::std::vector< VclPtr< vcl::Window > > | tWindowList |
Type and data member for a list of devices that have to be kept up-to-date. More... | |
Private Member Functions | |
WindowUpdater (const WindowUpdater &rUpdater)=delete | |
WindowUpdater | operator= (const WindowUpdater &rUpdater)=delete |
Static Private Member Functions | |
static void | UpdateWindow (OutputDevice *pDevice) |
The central method of this class. More... | |
Private Attributes | |
SvtCTLOptions | maCTLOptions |
Options to monitor for changes. More... | |
SdDrawDocument * | mpDocument |
The document rendered in the output devices. More... | |
tWindowList | maWindowList |
The purpose of the <type>WindowUpdater</type> is to update output devices to take care of modified global values.
These values are monitored for changes. At the moment this is the digit language that defines the glyphs to use to render digits. Other values may be added in the future.
The methods of this class have not been included into the <type>ViewShell</type> class in order to not clutter its interface any further. This class accesses some of <type>ViewShell</type> data members directly and thus is declared as its friend.
Windows that are to be kept up-to-date have to be registered via the <member>RegisterWindow()</member> method. When a document is given then this document is reformatted when the monitored option changes.
Definition at line 51 of file WindowUpdater.hxx.
|
private |
Type and data member for a list of devices that have to be kept up-to-date.
Definition at line 109 of file WindowUpdater.hxx.
|
explicit |
Definition at line 31 of file WindowUpdater.cxx.
References maCTLOptions.
|
overridevirtualnoexcept |
Definition at line 37 of file WindowUpdater.cxx.
References maCTLOptions.
|
privatedelete |
|
overridevirtual |
Callback that waits for notifications of a <type>SvtCTLOptions</type> object.
Implements utl::ConfigurationListener.
Definition at line 113 of file WindowUpdater.cxx.
References maWindowList, mpDocument, SdrModel::ReformatAllTextObjects(), and Update().
|
privatedelete |
void sd::WindowUpdater::RegisterWindow | ( | vcl::Window * | pWindow | ) |
Add the given device to the list of devices which will be updated when one of the monitored values changes.
pWindow | This device is added to the device list if it is not <null> and when it is not already a member of that list. |
Definition at line 42 of file WindowUpdater.cxx.
References vcl::Window::GetOutDev(), maWindowList, and Update().
Referenced by sd::Window::SetViewShell().
void sd::WindowUpdater::SetDocument | ( | SdDrawDocument * | pDocument | ) |
Set the document so that it is reformatted when one of the monitored values changes.
pDocument | When <null> is given document reformatting will not take place in the future. |
Definition at line 69 of file WindowUpdater.cxx.
References mpDocument.
void sd::WindowUpdater::UnregisterWindow | ( | vcl::Window * | pWindow | ) |
Remove the given device from the list of devices which will be updated when one of the monitored values changes.
pWindow | This device is removed from the device list when it is a member of that list. |
Definition at line 58 of file WindowUpdater.cxx.
References maWindowList.
Referenced by sd::Window::dispose(), and sd::Window::SetViewShell().
|
static |
Update the given output device and update all text objects of the view shell if not told otherwise.
pWindow | The device to update. When the given pointer is NULL then nothing is done. |
Definition at line 74 of file WindowUpdater.cxx.
References UpdateWindow().
Referenced by ConfigurationChanged(), and RegisterWindow().
|
staticprivate |
The central method of this class.
Update the given output device. It is the task of the caller to initiate a reformatting of the document that is rendered on this device to reflect the changes.
pWindow | The output device to update. When it is <null> then the call is ignored. |
Definition at line 82 of file WindowUpdater.cxx.
References SvtCTLOptions::GetCTLTextNumerals(), LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_ENGLISH, LANGUAGE_SYSTEM, SvtCTLOptions::NUMERALS_ARABIC, SvtCTLOptions::NUMERALS_HINDI, SvtCTLOptions::NUMERALS_SYSTEM, and OutputDevice::SetDigitLanguage().
Referenced by Update().
|
private |
Options to monitor for changes.
Definition at line 97 of file WindowUpdater.hxx.
Referenced by WindowUpdater(), and ~WindowUpdater().
|
private |
Definition at line 110 of file WindowUpdater.hxx.
Referenced by ConfigurationChanged(), RegisterWindow(), and UnregisterWindow().
|
private |
The document rendered in the output devices.
Definition at line 100 of file WindowUpdater.hxx.
Referenced by ConfigurationChanged(), and SetDocument().