Kaydet (Commit) 9a2fc944 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

cleanup ResourceManager

Change-Id: Ic07e0a9eb72fc78c23d65c82420daa57dbeb44f7
üst 502a7008
...@@ -42,10 +42,8 @@ class ResourceManager ...@@ -42,10 +42,8 @@ class ResourceManager
public: public:
static ResourceManager& Instance(); static ResourceManager& Instance();
const DeckDescriptor* GetDeckDescriptor ( const DeckDescriptor* GetDeckDescriptor(const OUString& rsDeckId) const;
const ::rtl::OUString& rsDeckId) const; const PanelDescriptor* GetPanelDescriptor(const OUString& rsPanelId) const;
const PanelDescriptor* GetPanelDescriptor (
const ::rtl::OUString& rsPanelId) const;
/** Excluded or include a deck from being displayed in the tab /** Excluded or include a deck from being displayed in the tab
bar. bar.
...@@ -54,77 +52,70 @@ public: ...@@ -54,77 +52,70 @@ public:
because the ResourceManager gives access to them only because the ResourceManager gives access to them only
read-only. read-only.
*/ */
void SetIsDeckEnabled ( void SetIsDeckEnabled(const OUString& rsDeckId, const bool bIsEnabled);
const ::rtl::OUString& rsDeckId,
const bool bIsEnabled);
class DeckContextDescriptor class DeckContextDescriptor
{ {
public: public:
::rtl::OUString msId; OUString msId;
bool mbIsEnabled; bool mbIsEnabled;
}; };
typedef ::std::vector<DeckContextDescriptor> DeckContextDescriptorContainer; typedef std::vector<DeckContextDescriptor> DeckContextDescriptorContainer;
class PanelContextDescriptor class PanelContextDescriptor
{ {
public: public:
::rtl::OUString msId; OUString msId;
::rtl::OUString msMenuCommand; OUString msMenuCommand;
bool mbIsInitiallyVisible; bool mbIsInitiallyVisible;
bool mbShowForReadOnlyDocuments; bool mbShowForReadOnlyDocuments;
}; };
typedef ::std::vector<PanelContextDescriptor> PanelContextDescriptorContainer; typedef std::vector<PanelContextDescriptor> PanelContextDescriptorContainer;
const DeckContextDescriptorContainer& GetMatchingDecks ( const DeckContextDescriptorContainer& GetMatchingDecks(
DeckContextDescriptorContainer& rDeckDescriptors, DeckContextDescriptorContainer& rDeckDescriptors,
const Context& rContext, const Context& rContext,
const bool bIsDocumentReadOnly, const bool bIsDocumentReadOnly,
const css::uno::Reference<css::frame::XFrame>& rxFrame); const css::uno::Reference<css::frame::XFrame>& rxFrame);
const PanelContextDescriptorContainer& GetMatchingPanels ( const PanelContextDescriptorContainer& GetMatchingPanels(
PanelContextDescriptorContainer& rPanelDescriptors, PanelContextDescriptorContainer& rPanelDescriptors,
const Context& rContext, const Context& rContext,
const ::rtl::OUString& rsDeckId, const OUString& rsDeckId,
const css::uno::Reference<css::frame::XFrame>& rxFrame); const css::uno::Reference<css::frame::XFrame>& rxFrame);
/** Remember the expansions state per panel and context. /** Remember the expansions state per panel and context.
This is not persistent past application end. This is not persistent past application end.
*/ */
void StorePanelExpansionState ( void StorePanelExpansionState(const OUString& rsPanelId,
const ::rtl::OUString& rsPanelId, const bool bExpansionState,
const bool bExpansionState, const Context& rContext);
const Context& rContext);
private: private:
ResourceManager(); ResourceManager();
~ResourceManager(); ~ResourceManager();
typedef ::std::vector<DeckDescriptor> DeckContainer; typedef std::vector<DeckDescriptor> DeckContainer;
DeckContainer maDecks; DeckContainer maDecks;
typedef ::std::vector<PanelDescriptor> PanelContainer;
typedef std::vector<PanelDescriptor> PanelContainer;
PanelContainer maPanels; PanelContainer maPanels;
mutable ::std::set<rtl::OUString> maProcessedApplications; mutable std::set<rtl::OUString> maProcessedApplications;
SvtMiscOptions maMiscOptions; SvtMiscOptions maMiscOptions;
void ReadDeckList(); void ReadDeckList();
void ReadPanelList(); void ReadPanelList();
void ReadContextList ( void ReadContextList(const utl::OConfigurationNode& rNode,
const ::utl::OConfigurationNode& rNode, ContextList& rContextList,
ContextList& rContextList, const OUString& rsDefaultMenuCommand) const;
const ::rtl::OUString& rsDefaultMenuCommand) const; void ReadLegacyAddons(const css::uno::Reference<css::frame::XFrame>& rxFrame);
void ReadLegacyAddons ( utl::OConfigurationTreeRoot GetLegacyAddonRootNode(const OUString& rsModuleName) const;
const css::uno::Reference<css::frame::XFrame>& rxFrame); void GetToolPanelNodeNames(std::vector<OUString>& rMatchingNames,
::utl::OConfigurationTreeRoot GetLegacyAddonRootNode ( const utl::OConfigurationTreeRoot& aRoot) const;
const ::rtl::OUString& rsModuleName) const; bool IsDeckEnabled(const OUString& rsDeckId,
void GetToolPanelNodeNames ( const Context& rContext,
::std::vector<rtl::OUString>& rMatchingNames, const css::uno::Reference<css::frame::XFrame>& rxFrame) const;
const ::utl::OConfigurationTreeRoot& aRoot) const;
bool IsDeckEnabled (
const ::rtl::OUString& rsDeckId,
const Context& rContext,
const css::uno::Reference<css::frame::XFrame>& rxFrame) const;
}; };
} } // end of namespace sfx2::sidebar } } // end of namespace sfx2::sidebar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment