LibreOffice Module sd (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
sd::sidebar::RecentlyUsedMasterPages Class Reference

This singleton holds a list of the most recently used master pages. More...

#include <RecentlyUsedMasterPages.hxx>

Inheritance diagram for sd::sidebar::RecentlyUsedMasterPages:
[legend]
Collaboration diagram for sd::sidebar::RecentlyUsedMasterPages:
[legend]

Classes

class  Descriptor
 

Public Member Functions

void AddEventListener (const Link< LinkParamNone *, void > &rEventListener)
 
void RemoveEventListener (const Link< LinkParamNone *, void > &rEventListener)
 
int GetMasterPageCount () const
 
MasterPageContainer::Token GetTokenForIndex (sal_uInt32 nIndex) const
 
- Public Member Functions inherited from sd::SdGlobalResource
virtual ~SdGlobalResource () COVERITY_NOEXCEPT_FALSE
 

Static Public Member Functions

static RecentlyUsedMasterPagesInstance ()
 Return the single instance of this class. More...
 

Private Types

typedef ::std::vector< DescriptorMasterPageList
 

Private Member Functions

 RecentlyUsedMasterPages ()
 
virtual ~RecentlyUsedMasterPages () override
 
void LateInit ()
 Call this method after a new object has been created. More...
 
 RecentlyUsedMasterPages (const RecentlyUsedMasterPages &)=delete
 
RecentlyUsedMasterPagesoperator= (const RecentlyUsedMasterPages &)=delete
 
void SendEvent ()
 
 DECL_LINK (MasterPageChangeListener, MasterPageObserverEvent &, void)
 
 DECL_LINK (MasterPageContainerChangeListener, MasterPageContainerChangeEvent &, void)
 
void AddMasterPage (MasterPageContainer::Token aToken)
 Add a descriptor for the specified master page to the end of the list of most recently used master pages. More...
 
void LoadPersistentValues ()
 Load the list of recently used master pages from the registry where it was saved to make it persistent. More...
 
void SavePersistentValues ()
 Save the list of recently used master pages to the registry to make it persistent. More...
 
void ResolveList ()
 

Private Attributes

::std::vector< Link< LinkParamNone *, void > > maListeners
 
MasterPageList mvMasterPages
 
std::shared_ptr< MasterPageContainermpContainer
 

Static Private Attributes

static RecentlyUsedMasterPagesmpInstance = nullptr
 The single instance of this class. More...
 

Detailed Description

This singleton holds a list of the most recently used master pages.

Definition at line 37 of file RecentlyUsedMasterPages.hxx.

Member Typedef Documentation

◆ MasterPageList

Definition at line 85 of file RecentlyUsedMasterPages.hxx.

Constructor & Destructor Documentation

◆ RecentlyUsedMasterPages() [1/2]

sd::sidebar::RecentlyUsedMasterPages::RecentlyUsedMasterPages ( )
private

Definition at line 81 of file RecentlyUsedMasterPages.cxx.

References make_shared().

Referenced by Instance().

◆ ~RecentlyUsedMasterPages()

sd::sidebar::RecentlyUsedMasterPages::~RecentlyUsedMasterPages ( )
overrideprivatevirtual

◆ RecentlyUsedMasterPages() [2/2]

sd::sidebar::RecentlyUsedMasterPages::RecentlyUsedMasterPages ( const RecentlyUsedMasterPages )
privatedelete

Member Function Documentation

◆ AddEventListener()

void sd::sidebar::RecentlyUsedMasterPages::AddEventListener ( const Link< LinkParamNone *, void > &  rEventListener)

◆ AddMasterPage()

void sd::sidebar::RecentlyUsedMasterPages::AddMasterPage ( MasterPageContainer::Token  aToken)
private

Add a descriptor for the specified master page to the end of the list of most recently used master pages.

When the page is already a member of that list the associated descriptor is moved to the end of the list to make it the most recently used entry.

Definition at line 300 of file RecentlyUsedMasterPages.cxx.

References sd::sidebar::gnMaxListSize(), mpContainer, mvMasterPages, sd::sidebar::MasterPageContainer::NIL_TOKEN, SavePersistentValues(), and SendEvent().

◆ DECL_LINK() [1/2]

sd::sidebar::RecentlyUsedMasterPages::DECL_LINK ( MasterPageChangeListener  ,
MasterPageObserverEvent ,
void   
)
private

◆ DECL_LINK() [2/2]

sd::sidebar::RecentlyUsedMasterPages::DECL_LINK ( MasterPageContainerChangeListener  ,
MasterPageContainerChangeEvent ,
void   
)
private

◆ GetMasterPageCount()

int sd::sidebar::RecentlyUsedMasterPages::GetMasterPageCount ( ) const

Definition at line 242 of file RecentlyUsedMasterPages.cxx.

References mvMasterPages.

Referenced by sd::sidebar::RecentMasterPagesSelector::Fill().

◆ GetTokenForIndex()

MasterPageContainer::Token sd::sidebar::RecentlyUsedMasterPages::GetTokenForIndex ( sal_uInt32  nIndex) const

◆ Instance()

RecentlyUsedMasterPages & sd::sidebar::RecentlyUsedMasterPages::Instance ( )
static

◆ LateInit()

void sd::sidebar::RecentlyUsedMasterPages::LateInit ( )
private

Call this method after a new object has been created.

Definition at line 95 of file RecentlyUsedMasterPages.cxx.

References sd::MasterPageObserver::AddEventListener(), sd::MasterPageObserver::Instance(), LINK, LoadPersistentValues(), and mpContainer.

Referenced by Instance().

◆ LoadPersistentValues()

void sd::sidebar::RecentlyUsedMasterPages::LoadPersistentValues ( )
private

◆ operator=()

RecentlyUsedMasterPages & sd::sidebar::RecentlyUsedMasterPages::operator= ( const RecentlyUsedMasterPages )
privatedelete

◆ RemoveEventListener()

void sd::sidebar::RecentlyUsedMasterPages::RemoveEventListener ( const Link< LinkParamNone *, void > &  rEventListener)

◆ ResolveList()

void sd::sidebar::RecentlyUsedMasterPages::ResolveList ( )
private

◆ SavePersistentValues()

void sd::sidebar::RecentlyUsedMasterPages::SavePersistentValues ( )
private

Save the list of recently used master pages to the registry to make it persistent.

Definition at line 167 of file RecentlyUsedMasterPages.cxx.

References Any, sd::tools::ConfigurationAccess::CommitChanges(), Exception, sd::tools::ConfigurationAccess::GetConfigurationNode(), mvMasterPages, nIndex, sd::tools::ConfigurationAccess::READ_WRITE, and u.

Referenced by AddMasterPage().

◆ SendEvent()

void sd::sidebar::RecentlyUsedMasterPages::SendEvent ( )
private

Definition at line 255 of file RecentlyUsedMasterPages.cxx.

References maListeners.

Referenced by AddMasterPage(), and ResolveList().

Member Data Documentation

◆ maListeners

::std::vector<Link<LinkParamNone*,void> > sd::sidebar::RecentlyUsedMasterPages::maListeners
private

Definition at line 83 of file RecentlyUsedMasterPages.hxx.

Referenced by AddEventListener(), RemoveEventListener(), and SendEvent().

◆ mpContainer

std::shared_ptr<MasterPageContainer> sd::sidebar::RecentlyUsedMasterPages::mpContainer
private

◆ mpInstance

RecentlyUsedMasterPages * sd::sidebar::RecentlyUsedMasterPages::mpInstance = nullptr
staticprivate

The single instance of this class.

It is created on demand when Instance() is called for the first time.

Definition at line 81 of file RecentlyUsedMasterPages.hxx.

Referenced by Instance().

◆ mvMasterPages

MasterPageList sd::sidebar::RecentlyUsedMasterPages::mvMasterPages
private

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