LibreOffice Module sd (master) 1
|
This singleton holds a list of the most recently used master pages. More...
#include <RecentlyUsedMasterPages.hxx>
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 |
![]() | |
virtual | ~SdGlobalResource () COVERITY_NOEXCEPT_FALSE |
Static Public Member Functions | |
static RecentlyUsedMasterPages & | Instance () |
Return the single instance of this class. More... | |
Private Types | |
typedef ::std::vector< Descriptor > | MasterPageList |
Private Member Functions | |
RecentlyUsedMasterPages () | |
virtual | ~RecentlyUsedMasterPages () override |
void | LateInit () |
Call this method after a new object has been created. More... | |
RecentlyUsedMasterPages (const RecentlyUsedMasterPages &)=delete | |
RecentlyUsedMasterPages & | operator= (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< MasterPageContainer > | mpContainer |
Static Private Attributes | |
static RecentlyUsedMasterPages * | mpInstance = nullptr |
The single instance of this class. More... | |
This singleton holds a list of the most recently used master pages.
Definition at line 37 of file RecentlyUsedMasterPages.hxx.
|
private |
Definition at line 85 of file RecentlyUsedMasterPages.hxx.
|
private |
Definition at line 81 of file RecentlyUsedMasterPages.cxx.
References make_shared().
Referenced by Instance().
|
overrideprivatevirtual |
Definition at line 86 of file RecentlyUsedMasterPages.cxx.
References sd::MasterPageObserver::Instance(), LINK, mpContainer, and sd::MasterPageObserver::RemoveEventListener().
|
privatedelete |
void sd::sidebar::RecentlyUsedMasterPages::AddEventListener | ( | const Link< LinkParamNone *, void > & | rEventListener | ) |
Definition at line 222 of file RecentlyUsedMasterPages.cxx.
References maListeners.
Referenced by sd::sidebar::RecentMasterPagesSelector::LateInit().
|
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().
|
private |
|
private |
int sd::sidebar::RecentlyUsedMasterPages::GetMasterPageCount | ( | ) | const |
Definition at line 242 of file RecentlyUsedMasterPages.cxx.
References mvMasterPages.
Referenced by sd::sidebar::RecentMasterPagesSelector::Fill().
MasterPageContainer::Token sd::sidebar::RecentlyUsedMasterPages::GetTokenForIndex | ( | sal_uInt32 | nIndex | ) | const |
Definition at line 247 of file RecentlyUsedMasterPages.cxx.
References mvMasterPages, sd::sidebar::MasterPageContainer::NIL_TOKEN, and nIndex.
Referenced by sd::sidebar::RecentMasterPagesSelector::Fill().
|
static |
Return the single instance of this class.
Definition at line 56 of file RecentlyUsedMasterPages.cxx.
References sd::SdGlobalResourceContainer::AddResource(), sd::SdGlobalResourceContainer::Instance(), LateInit(), mpInstance, and RecentlyUsedMasterPages().
Referenced by sd::sidebar::RecentMasterPagesSelector::Fill(), sd::sidebar::RecentMasterPagesSelector::LateInit(), and sd::sidebar::RecentMasterPagesSelector::~RecentMasterPagesSelector().
|
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().
|
private |
Load the list of recently used master pages from the registry where it was saved to make it persistent.
Definition at line 105 of file RecentlyUsedMasterPages.cxx.
References aName, Any, aURL, Exception, sd::tools::ConfigurationAccess::GetConfigurationNode(), mpContainer, mvMasterPages, sd::tools::ConfigurationAccess::READ_ONLY, ResolveList(), sName, sd::sidebar::MasterPageContainer::TEMPLATE, u, and sd::sidebar::MasterPageDescriptor::URLCLASS_USER.
Referenced by LateInit().
|
privatedelete |
void sd::sidebar::RecentlyUsedMasterPages::RemoveEventListener | ( | const Link< LinkParamNone *, void > & | rEventListener | ) |
Definition at line 233 of file RecentlyUsedMasterPages.cxx.
References maListeners.
Referenced by sd::sidebar::RecentMasterPagesSelector::~RecentMasterPagesSelector().
|
private |
Definition at line 336 of file RecentlyUsedMasterPages.cxx.
References mpContainer, mvMasterPages, sd::sidebar::MasterPageContainer::NIL_TOKEN, and SendEvent().
Referenced by LoadPersistentValues().
|
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().
|
private |
Definition at line 255 of file RecentlyUsedMasterPages.cxx.
References maListeners.
Referenced by AddMasterPage(), and ResolveList().
|
private |
Definition at line 83 of file RecentlyUsedMasterPages.hxx.
Referenced by AddEventListener(), RemoveEventListener(), and SendEvent().
|
private |
Definition at line 87 of file RecentlyUsedMasterPages.hxx.
Referenced by AddMasterPage(), LateInit(), LoadPersistentValues(), ResolveList(), and ~RecentlyUsedMasterPages().
|
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().
|
private |
Definition at line 86 of file RecentlyUsedMasterPages.hxx.
Referenced by AddMasterPage(), GetMasterPageCount(), GetTokenForIndex(), LoadPersistentValues(), ResolveList(), and SavePersistentValues().