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

The purpose of the <type>WindowUpdater</type> is to update output devices to take care of modified global values. More...

#include <WindowUpdater.hxx>

Inheritance diagram for sd::WindowUpdater:
[legend]
Collaboration diagram for sd::WindowUpdater:
[legend]

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...
 
SdDrawDocumentmpDocument
 The document rendered in the output devices. More...
 
tWindowList maWindowList
 

Detailed Description

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.

Member Typedef Documentation

◆ tWindowList

typedef ::std::vector<VclPtr<vcl::Window> > sd::WindowUpdater::tWindowList
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.

Constructor & Destructor Documentation

◆ WindowUpdater() [1/2]

sd::WindowUpdater::WindowUpdater ( )
explicit

Definition at line 31 of file WindowUpdater.cxx.

References maCTLOptions.

◆ ~WindowUpdater()

sd::WindowUpdater::~WindowUpdater ( )
overridevirtualnoexcept

Definition at line 37 of file WindowUpdater.cxx.

References maCTLOptions.

◆ WindowUpdater() [2/2]

sd::WindowUpdater::WindowUpdater ( const WindowUpdater rUpdater)
privatedelete

Member Function Documentation

◆ ConfigurationChanged()

void sd::WindowUpdater::ConfigurationChanged ( utl::ConfigurationBroadcaster ,
ConfigurationHints  nHint 
)
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().

◆ operator=()

WindowUpdater sd::WindowUpdater::operator= ( const WindowUpdater rUpdater)
privatedelete

◆ RegisterWindow()

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.

Parameters
pWindowThis 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().

◆ SetDocument()

void sd::WindowUpdater::SetDocument ( SdDrawDocument pDocument)

Set the document so that it is reformatted when one of the monitored values changes.

Parameters
pDocumentWhen <null> is given document reformatting will not take place in the future.

Definition at line 69 of file WindowUpdater.cxx.

References mpDocument.

◆ UnregisterWindow()

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.

Parameters
pWindowThis 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().

◆ Update()

void sd::WindowUpdater::Update ( OutputDevice pDevice)
static

Update the given output device and update all text objects of the view shell if not told otherwise.

Parameters
pWindowThe 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().

◆ UpdateWindow()

void sd::WindowUpdater::UpdateWindow ( OutputDevice pDevice)
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.

Parameters
pWindowThe 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().

Member Data Documentation

◆ maCTLOptions

SvtCTLOptions sd::WindowUpdater::maCTLOptions
private

Options to monitor for changes.

Definition at line 97 of file WindowUpdater.hxx.

Referenced by WindowUpdater(), and ~WindowUpdater().

◆ maWindowList

tWindowList sd::WindowUpdater::maWindowList
private

Definition at line 110 of file WindowUpdater.hxx.

Referenced by ConfigurationChanged(), RegisterWindow(), and UnregisterWindow().

◆ mpDocument

SdDrawDocument* sd::WindowUpdater::mpDocument
private

The document rendered in the output devices.

Definition at line 100 of file WindowUpdater.hxx.

Referenced by ConfigurationChanged(), and SetDocument().


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