LibreOffice Module sfx2 (master) 1
|
Read the content of the Sidebar.xcu file and provide access methods so that the sidebar can easily decide which content panels to display for a certain context. More...
#include <ResourceManager.hxx>
Classes | |
class | DeckContextDescriptor |
class | PanelContextDescriptor |
Public Types | |
typedef std::vector< DeckContextDescriptor > | DeckContextDescriptorContainer |
typedef std::vector< PanelContextDescriptor > | PanelContextDescriptorContainer |
Public Member Functions | |
ResourceManager () | |
~ResourceManager () | |
std::shared_ptr< DeckDescriptor > | GetDeckDescriptor (std::u16string_view rsDeckId) const |
std::shared_ptr< PanelDescriptor > | GetPanelDescriptor (std::u16string_view rsPanelId) const |
void | UpdateModel (const css::uno::Reference< css::frame::XModel > &xModel) |
void | InitDeckContext (const Context &rContex) |
void | SaveDecksSettings (const Context &rContext) |
void | SaveDeckSettings (const DeckDescriptor *pDeckDesc) |
void | SaveLastActiveDeck (const Context &rContext, const OUString &rActiveDeck) |
void | disposeDecks () |
const DeckContextDescriptorContainer & | GetMatchingDecks (DeckContextDescriptorContainer &rDeckDescriptors, const Context &rContext, const bool bIsDocumentReadOnly, const css::uno::Reference< css::frame::XController > &rxController) |
const PanelContextDescriptorContainer & | GetMatchingPanels (PanelContextDescriptorContainer &rPanelDescriptors, const Context &rContext, std::u16string_view rsDeckId, const css::uno::Reference< css::frame::XController > &rxController) |
const OUString & | GetLastActiveDeck (const Context &rContext) |
void | SetLastActiveDeck (const Context &rContext, const OUString &rsDeckId) |
void | StorePanelExpansionState (std::u16string_view rsPanelId, const bool bExpansionState, const Context &rContext) |
Remember the expansions state per panel and context. More... | |
Private Types | |
typedef std::vector< std::shared_ptr< DeckDescriptor > > | DeckContainer |
typedef std::vector< std::shared_ptr< PanelDescriptor > > | PanelContainer |
Private Member Functions | |
void | ReadDeckList () |
void | ReadPanelList () |
void | ReadLastActive () |
void | ReadLegacyAddons (const css::uno::Reference< css::frame::XController > &rxController) |
bool | IsDeckEnabled (std::u16string_view rsDeckId, const Context &rContext, const css::uno::Reference< css::frame::XController > &rxController) |
std::shared_ptr< DeckDescriptor > | ImplGetDeckDescriptor (std::u16string_view rsDeckId) const |
std::shared_ptr< PanelDescriptor > | ImplGetPanelDescriptor (std::u16string_view rsPanelId) const |
Static Private Member Functions | |
static void | ReadContextList (const utl::OConfigurationNode &rNode, ContextList &rContextList, const OUString &rsDefaultMenuCommand) |
static utl::OConfigurationTreeRoot | GetLegacyAddonRootNode (const OUString &rsModuleName) |
static void | GetToolPanelNodeNames (std::vector< OUString > &rMatchingNames, const utl::OConfigurationTreeRoot &aRoot) |
Private Attributes | |
DeckContainer | maDecks |
PanelContainer | maPanels |
std::set< OUString > | maProcessedApplications |
std::map< OUString, OUString > | maLastActiveDecks |
Read the content of the Sidebar.xcu file and provide access methods so that the sidebar can easily decide which content panels to display for a certain context.
Definition at line 42 of file ResourceManager.hxx.
|
private |
Definition at line 103 of file ResourceManager.hxx.
typedef std::vector<DeckContextDescriptor> sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer |
Definition at line 67 of file ResourceManager.hxx.
|
private |
Definition at line 106 of file ResourceManager.hxx.
typedef std::vector<PanelContextDescriptor> sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer |
Definition at line 77 of file ResourceManager.hxx.
sfx2::sidebar::ResourceManager::ResourceManager | ( | ) |
Definition at line 102 of file ResourceManager.cxx.
References ReadDeckList(), ReadLastActive(), and ReadPanelList().
sfx2::sidebar::ResourceManager::~ResourceManager | ( | ) |
Definition at line 109 of file ResourceManager.cxx.
void sfx2::sidebar::ResourceManager::disposeDecks | ( | ) |
Definition at line 795 of file ResourceManager.cxx.
References maDecks.
std::shared_ptr< DeckDescriptor > sfx2::sidebar::ResourceManager::GetDeckDescriptor | ( | std::u16string_view | rsDeckId | ) | const |
Definition at line 141 of file ResourceManager.cxx.
References ImplGetDeckDescriptor().
Referenced by sfx2::sidebar::IMPL_LINK_NOARG(), sfx2::sidebar::TabBar::RestoreHideFlags(), SaveDecksSettings(), sfx2::sidebar::TabBar::SetDecks(), sfx2::sidebar::TabBar::ToggleHideFlag(), sfx2::sidebar::TabBar::UpdateButtonIcons(), and sfx2::sidebar::SidebarController::UpdateTitleBarIcons().
const OUString & sfx2::sidebar::ResourceManager::GetLastActiveDeck | ( | const Context & | rContext | ) |
Definition at line 234 of file ResourceManager.cxx.
References maLastActiveDecks, and sfx2::sidebar::Context::msApplication.
|
staticprivate |
Definition at line 722 of file ResourceManager.cxx.
References DBG_UNHANDLED_EXCEPTION, Exception, comphelper::NamedValueCollection::getOrDefault(), and comphelper::getProcessComponentContext().
Referenced by ReadLegacyAddons().
const ResourceManager::DeckContextDescriptorContainer & sfx2::sidebar::ResourceManager::GetMatchingDecks | ( | DeckContextDescriptorContainer & | rDeckDescriptors, |
const Context & | rContext, | ||
const bool | bIsDocumentReadOnly, | ||
const css::uno::Reference< css::frame::XController > & | rxController | ||
) |
Definition at line 161 of file ResourceManager.cxx.
References sfx2::sidebar::ContextList::GetMatch(), IsDeckEnabled(), sfx2::sidebar::DeckDescriptor::maContextList, maDecks, sfx2::sidebar::ResourceManager::DeckContextDescriptor::mbIsEnabled, sfx2::sidebar::DeckDescriptor::mbIsEnabled, sfx2::sidebar::DeckDescriptor::mnOrderIndex, sfx2::sidebar::ResourceManager::DeckContextDescriptor::msId, sfx2::sidebar::DeckDescriptor::msId, and ReadLegacyAddons().
const ResourceManager::PanelContextDescriptorContainer & sfx2::sidebar::ResourceManager::GetMatchingPanels | ( | PanelContextDescriptorContainer & | rPanelDescriptors, |
const Context & | rContext, | ||
std::u16string_view | rsDeckId, | ||
const css::uno::Reference< css::frame::XController > & | rxController | ||
) |
Definition at line 197 of file ResourceManager.cxx.
References sfx2::sidebar::ContextList::GetMatch(), sfx2::sidebar::PanelDescriptor::maContextList, maPanels, sfx2::sidebar::PanelDescriptor::mbExperimental, sfx2::sidebar::ResourceManager::PanelContextDescriptor::mbIsInitiallyVisible, sfx2::sidebar::ContextList::Entry::mbIsInitiallyVisible, sfx2::sidebar::ResourceManager::PanelContextDescriptor::mbShowForReadOnlyDocuments, sfx2::sidebar::PanelDescriptor::mbShowForReadOnlyDocuments, sfx2::sidebar::PanelDescriptor::mnOrderIndex, sfx2::sidebar::PanelDescriptor::msDeckId, sfx2::sidebar::ResourceManager::PanelContextDescriptor::msId, sfx2::sidebar::PanelDescriptor::msId, sfx2::sidebar::ResourceManager::PanelContextDescriptor::msMenuCommand, sfx2::sidebar::ContextList::Entry::msMenuCommand, and ReadLegacyAddons().
Referenced by IsDeckEnabled().
std::shared_ptr< PanelDescriptor > sfx2::sidebar::ResourceManager::GetPanelDescriptor | ( | std::u16string_view | rsPanelId | ) | const |
Definition at line 156 of file ResourceManager.cxx.
References ImplGetPanelDescriptor().
Referenced by sfx2::sidebar::Sidebar::IsPanelVisible(), SaveDeckSettings(), sfx2::sidebar::Sidebar::ShowPanel(), sfx2::sidebar::Sidebar::TogglePanel(), and sfx2::sidebar::SidebarController::UpdateTitleBarIcons().
|
staticprivate |
Definition at line 746 of file ResourceManager.cxx.
References utl::OConfigurationNode::getNodeNames().
Referenced by ReadLegacyAddons().
|
private |
Definition at line 129 of file ResourceManager.cxx.
References maDecks.
Referenced by GetDeckDescriptor().
|
private |
Definition at line 146 of file ResourceManager.cxx.
References maPanels.
Referenced by GetPanelDescriptor().
void sfx2::sidebar::ResourceManager::InitDeckContext | ( | const Context & | rContex | ) |
Definition at line 113 of file ResourceManager.cxx.
References bIsEnabled, maDecks, and sfx2::sidebar::ContextList::Entry::mbIsInitiallyVisible.
|
private |
Definition at line 755 of file ResourceManager.cxx.
References GetMatchingPanels().
Referenced by GetMatchingDecks().
|
staticprivate |
Definition at line 490 of file ResourceManager.cxx.
References sfx2::sidebar::ContextList::AddContextDescription(), Any, vcl::EnumContext::Calc, vcl::EnumContext::Chart, vcl::EnumContext::Draw, vcl::EnumContext::Formula, vcl::EnumContext::GetApplicationEnum(), vcl::EnumContext::GetApplicationName(), vcl::EnumContext::GetContextEnum(), vcl::EnumContext::GetContextName(), utl::OConfigurationNode::getNodeValue(), o3tl::getToken(), vcl::EnumContext::Impress, vcl::EnumContext::NONE, SAL_WARN, o3tl::trim(), u, vcl::EnumContext::Unknown, vcl::EnumContext::Writer, vcl::EnumContext::WriterForm, vcl::EnumContext::WriterGlobal, vcl::EnumContext::WriterReport, vcl::EnumContext::WriterWeb, and vcl::EnumContext::WriterXML.
Referenced by ReadDeckList(), and ReadPanelList().
|
private |
Definition at line 247 of file ResourceManager.cxx.
References utl::OConfigurationNode::getNodeNames(), comphelper::getProcessComponentContext(), getString(), comphelper::LibreOfficeKit::isActive(), utl::OConfigurationNode::isValid(), sfx2::sidebar::DeckDescriptor::maContextList, maDecks, sfx2::sidebar::DeckDescriptor::mbExperimental, sfx2::sidebar::DeckDescriptor::mnOrderIndex, sfx2::sidebar::DeckDescriptor::msHelpText, sfx2::sidebar::DeckDescriptor::msHighContrastIconURL, sfx2::sidebar::DeckDescriptor::msHighContrastTitleBarIconURL, sfx2::sidebar::DeckDescriptor::msIconURL, sfx2::sidebar::DeckDescriptor::msId, sfx2::sidebar::DeckDescriptor::msNodeName, sfx2::sidebar::DeckDescriptor::msTitle, sfx2::sidebar::DeckDescriptor::msTitleBarIconURL, utl::OConfigurationNode::openNode(), and ReadContextList().
Referenced by ResourceManager().
|
private |
Definition at line 462 of file ResourceManager.cxx.
References vcl::EnumContext::Formula, vcl::EnumContext::GetApplicationEnum(), vcl::EnumContext::GetApplicationName(), maLastActiveDecks, vcl::EnumContext::NONE, and SAL_WARN.
Referenced by ResourceManager().
|
private |
Definition at line 635 of file ResourceManager.cxx.
References sfx2::sidebar::ContextList::AddContextDescription(), GetLegacyAddonRootNode(), sfx2::sidebar::Tools::GetModuleName(), getString(), GetToolPanelNodeNames(), utl::OConfigurationNode::isValid(), sfx2::sidebar::DeckDescriptor::maContextList, sfx2::sidebar::PanelDescriptor::maContextList, maDecks, maPanels, maProcessedApplications, sfx2::sidebar::DeckDescriptor::mbIsEnabled, sfx2::sidebar::PanelDescriptor::mbIsTitleBarOptional, sfx2::sidebar::PanelDescriptor::mbShowForReadOnlyDocuments, sfx2::sidebar::PanelDescriptor::mbWantsAWT, sfx2::sidebar::PanelDescriptor::mbWantsCanvas, sfx2::sidebar::DeckDescriptor::mnOrderIndex, sfx2::sidebar::PanelDescriptor::mnOrderIndex, sfx2::sidebar::PanelDescriptor::msDeckId, sfx2::sidebar::DeckDescriptor::msHelpText, sfx2::sidebar::DeckDescriptor::msHighContrastIconURL, sfx2::sidebar::DeckDescriptor::msHighContrastTitleBarIconURL, sfx2::sidebar::PanelDescriptor::msHighContrastTitleBarIconURL, sfx2::sidebar::DeckDescriptor::msIconURL, sfx2::sidebar::DeckDescriptor::msId, sfx2::sidebar::PanelDescriptor::msId, sfx2::sidebar::PanelDescriptor::msImplementationURL, sfx2::sidebar::DeckDescriptor::msTitle, sfx2::sidebar::PanelDescriptor::msTitle, sfx2::sidebar::DeckDescriptor::msTitleBarIconURL, sfx2::sidebar::PanelDescriptor::msTitleBarIconURL, nCount, and utl::OConfigurationNode::openNode().
Referenced by GetMatchingDecks(), and GetMatchingPanels().
|
private |
Definition at line 413 of file ResourceManager.cxx.
References utl::OConfigurationNode::getNodeNames(), comphelper::getProcessComponentContext(), getString(), comphelper::LibreOfficeKit::isActive(), utl::OConfigurationNode::isValid(), sfx2::sidebar::PanelDescriptor::maContextList, maPanels, sfx2::sidebar::PanelDescriptor::mbExperimental, sfx2::sidebar::PanelDescriptor::mbIsTitleBarOptional, sfx2::sidebar::PanelDescriptor::mbShowForReadOnlyDocuments, sfx2::sidebar::PanelDescriptor::mbWantsAWT, sfx2::sidebar::PanelDescriptor::mbWantsCanvas, sfx2::sidebar::PanelDescriptor::mnOrderIndex, sfx2::sidebar::PanelDescriptor::msDeckId, sfx2::sidebar::PanelDescriptor::msHighContrastTitleBarIconURL, sfx2::sidebar::PanelDescriptor::msId, sfx2::sidebar::PanelDescriptor::msImplementationURL, sfx2::sidebar::PanelDescriptor::msNodeName, sfx2::sidebar::PanelDescriptor::msTitle, sfx2::sidebar::PanelDescriptor::msTitleBarIconURL, utl::OConfigurationNode::openNode(), and ReadContextList().
Referenced by ResourceManager().
void sfx2::sidebar::ResourceManager::SaveDeckSettings | ( | const DeckDescriptor * | pDeckDesc | ) |
Definition at line 309 of file ResourceManager.cxx.
References Any, utl::OConfigurationTreeRoot::commit(), utl::OConfigurationNode::getNodeValue(), GetPanelDescriptor(), comphelper::getProcessComponentContext(), utl::OConfigurationNode::isValid(), sfx2::sidebar::DeckDescriptor::maContextList, sfx2::sidebar::DeckDescriptor::mnOrderIndex, sfx2::sidebar::DeckDescriptor::mpDeck, sfx2::sidebar::DeckDescriptor::msNodeName, sfx2::sidebar::DeckDescriptor::msTitle, utl::OConfigurationNode::openNode(), and utl::OConfigurationNode::setNodeValue().
Referenced by SaveDecksSettings().
void sfx2::sidebar::ResourceManager::SaveDecksSettings | ( | const Context & | rContext | ) |
Definition at line 294 of file ResourceManager.cxx.
References GetDeckDescriptor(), maDecks, and SaveDeckSettings().
void sfx2::sidebar::ResourceManager::SaveLastActiveDeck | ( | const Context & | rContext, |
const OUString & | rActiveDeck | ||
) |
Definition at line 398 of file ResourceManager.cxx.
References comphelper::containerToSequence(), comphelper::ConfigurationChanges::create(), maLastActiveDecks, and sfx2::sidebar::Context::msApplication.
void sfx2::sidebar::ResourceManager::SetLastActiveDeck | ( | const Context & | rContext, |
const OUString & | rsDeckId | ||
) |
Definition at line 242 of file ResourceManager.cxx.
References maLastActiveDecks, and sfx2::sidebar::Context::msApplication.
void sfx2::sidebar::ResourceManager::StorePanelExpansionState | ( | std::u16string_view | rsPanelId, |
const bool | bExpansionState, | ||
const Context & | rContext | ||
) |
Remember the expansions state per panel and context.
Definition at line 706 of file ResourceManager.cxx.
References maPanels, and sfx2::sidebar::ContextList::Entry::mbIsInitiallyVisible.
Referenced by sfx2::sidebar::Panel::SetExpanded().
void sfx2::sidebar::ResourceManager::UpdateModel | ( | const css::uno::Reference< css::frame::XModel > & | xModel | ) |
Definition at line 775 of file ResourceManager.cxx.
|
private |
Definition at line 104 of file ResourceManager.hxx.
Referenced by disposeDecks(), GetMatchingDecks(), ImplGetDeckDescriptor(), InitDeckContext(), ReadDeckList(), ReadLegacyAddons(), SaveDecksSettings(), and UpdateModel().
|
private |
Definition at line 109 of file ResourceManager.hxx.
Referenced by GetLastActiveDeck(), ReadLastActive(), SaveLastActiveDeck(), and SetLastActiveDeck().
|
private |
Definition at line 107 of file ResourceManager.hxx.
Referenced by GetMatchingPanels(), ImplGetPanelDescriptor(), ReadLegacyAddons(), ReadPanelList(), and StorePanelExpansionState().
|
mutableprivate |
Definition at line 108 of file ResourceManager.hxx.
Referenced by ReadLegacyAddons().