summaryrefslogtreecommitdiff
path: root/include/sfx2/sidebar
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2015-08-25 16:38:43 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-11-20 13:33:29 +0000
commit536c259cb9644971d0eb0cdfb7d823c5383a5481 (patch)
tree9f9fd6d655fe9ff492e0f5c317be4d75e21d9ea4 /include/sfx2/sidebar
parentce6170dafe0159e2a1d689133c070b25fa39dd12 (diff)
tdf#67770 store sidebar elements states
deck & panel states at user registry level when disposing a sidebar if a shared deck (with "any" context application) is modified, it apply to all applications (eg. Gallery between calc and writer); TODO ? clean ResourceManager Get/Set const/non-const add panels when deck is created & refactoring * macro example Sub Main controller = thisComponent.currentcontroller sidebar = thisComponent.currentcontroller.getSidebar() sidebar.setVisible(true) decks = sidebar.getdecks() deck = decks.getByName("PropertyDeck") deck.activate(true) deck.setTitle("new deck title") deck.moveLast() panels = deck.getPanels() panel = panels.getByName("TextPropertyPanel") panel.setTitle("new panel title") panel.expand(true) ' expand and collapse other panel.moveLast() End Sub Change-Id: I2552000af92a366ebb51a479962a094b72e400b6 Reviewed-on: https://gerrit.libreoffice.org/17992 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'include/sfx2/sidebar')
-rw-r--r--include/sfx2/sidebar/ContextList.hxx2
-rw-r--r--include/sfx2/sidebar/Deck.hxx1
-rw-r--r--include/sfx2/sidebar/DeckDescriptor.hxx2
-rw-r--r--include/sfx2/sidebar/PanelDescriptor.hxx2
-rw-r--r--include/sfx2/sidebar/ResourceManager.hxx35
-rw-r--r--include/sfx2/sidebar/SidebarController.hxx6
6 files changed, 25 insertions, 23 deletions
diff --git a/include/sfx2/sidebar/ContextList.hxx b/include/sfx2/sidebar/ContextList.hxx
index 7ce63eec24c2..9c56d153f7c6 100644
--- a/include/sfx2/sidebar/ContextList.hxx
+++ b/include/sfx2/sidebar/ContextList.hxx
@@ -55,6 +55,8 @@ public:
const bool bIsInitiallyVisible,
const ::rtl::OUString& rsMenuCommand);
+ const ::std::vector<Entry>& GetEntries() const {return maEntries;};
+
private:
::std::vector<Entry> maEntries;
diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 0057c721de00..aa13d4392049 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -94,6 +94,7 @@ private:
DECL_LINK_TYPED(HandleVerticalScrollBarChange, ScrollBar*, void);
bool ProcessWheelEvent(CommandEvent* pCommandEvent);
+
};
} } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/DeckDescriptor.hxx b/include/sfx2/sidebar/DeckDescriptor.hxx
index f3e7cd6c41d2..8c1b9efb764c 100644
--- a/include/sfx2/sidebar/DeckDescriptor.hxx
+++ b/include/sfx2/sidebar/DeckDescriptor.hxx
@@ -42,6 +42,8 @@ public:
sal_Int32 mnOrderIndex;
bool mbExperimental;
+ OUString msNodeName; // some impress deck nodes names are different from their Id
+
VclPtr<Deck> mpDeck;
DeckDescriptor();
diff --git a/include/sfx2/sidebar/PanelDescriptor.hxx b/include/sfx2/sidebar/PanelDescriptor.hxx
index 1578bfd245cf..2e1abb2d445e 100644
--- a/include/sfx2/sidebar/PanelDescriptor.hxx
+++ b/include/sfx2/sidebar/PanelDescriptor.hxx
@@ -41,6 +41,8 @@ public:
bool mbWantsCanvas;
bool mbExperimental;
+ OUString msNodeName; // some impress panel nodes names are different from their Id
+
PanelDescriptor();
PanelDescriptor (const PanelDescriptor& rPanelDescriptor);
~PanelDescriptor();
diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index bd69b9e62c4f..9a86bc02566d 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -43,30 +43,18 @@ public:
ResourceManager();
~ResourceManager();
- static ResourceManager& Instance();
-
const DeckDescriptor* GetDeckDescriptor(const OUString& rsDeckId) const;
- const PanelDescriptor* GetPanelDescriptor(const OUString& rsPanelId) const;
-
- /** Excluded or include a deck from being displayed in the tab
- bar.
- Note that this value is not persistent.
- The flag can not be set directly at a DeckDescriptor object
- because the ResourceManager gives access to them only
- read-only.
- */
- void SetIsDeckEnabled(const OUString& rsDeckId, const bool bIsEnabled);
-
- void SetDeckTitle(const OUString& rsDeckId, const OUString& sTitle);
-
- void SetDeckToDescriptor(const OUString& rsDeckId, VclPtr<Deck> aDeck);
+ DeckDescriptor* GetDeckDescriptor(const OUString& rsDeckId);
- void SetDeckOrderIndex(const OUString& rsDeckId, const sal_Int32 orderIndex);
-
- void SetPanelOrderIndex(const OUString& rsPanelId, const sal_Int32 orderIndex);
+ const PanelDescriptor* GetPanelDescriptor(const OUString& rsPanelId) const;
+ PanelDescriptor* GetPanelDescriptor(const OUString& rsPanelId);
void UpdateModel(css::uno::Reference<css::frame::XModel> xModel);
+ void InitDeckContext(const Context& rContex);
+ void SaveDecksSettings(const Context& rContext);
+ void SaveDeckSettings(const DeckDescriptor* pDeckDesc);
+
void disposeDecks();
class DeckContextDescriptor
@@ -100,7 +88,6 @@ public:
const css::uno::Reference<css::frame::XController>& rxController);
/** Remember the expansions state per panel and context.
- This is not persistent past application end.
*/
void StorePanelExpansionState(const OUString& rsPanelId,
const bool bExpansionState,
@@ -123,13 +110,19 @@ private:
static void ReadContextList(const utl::OConfigurationNode& rNode,
ContextList& rContextList,
const OUString& rsDefaultMenuCommand);
+
+ css::uno::Sequence<OUString> BuildContextList (ContextList rContextList, bool isDeckEnabled);
+
void ReadLegacyAddons(const css::uno::Reference<css::frame::XController>& rxController);
static utl::OConfigurationTreeRoot GetLegacyAddonRootNode(const OUString& rsModuleName);
static void GetToolPanelNodeNames(std::vector<OUString>& rMatchingNames,
const utl::OConfigurationTreeRoot& aRoot);
- static bool IsDeckEnabled(const OUString& rsDeckId,
+ bool IsDeckEnabled(const OUString& rsDeckId,
const Context& rContext,
const css::uno::Reference<css::frame::XController>& rxController);
+
+ const DeckDescriptor* ImplGetDeckDescriptor(const OUString& rsDeckId) const;
+ const PanelDescriptor* ImplGetPanelDescriptor(const OUString& rsPanelId) const;
};
} } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index f7cc1192c2b2..c077eeb3b87e 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -151,7 +151,8 @@ public:
void SwitchToDeck ( const ::rtl::OUString& rsDeckId);
void SwitchToDefaultDeck();
- void CreateDeck(const ::rtl::OUString& rDeckId);
+ void CreateDeck(const ::rtl::OUString& rDeckId, bool bForceCreate = false);
+ void CreatePanels(const ::rtl::OUString& rDeckId);
ResourceManager::DeckContextDescriptorContainer GetMatchingDecks();
ResourceManager::PanelContextDescriptorContainer GetMatchingPanels( const ::rtl::OUString& rDeckId);
@@ -223,7 +224,8 @@ private:
const ::rtl::OUString& rsPanelId,
vcl::Window* pParentWindow,
const bool bIsInitiallyExpanded,
- const Context& rContext);
+ const Context& rContext,
+ VclPtr<Deck> pDeck);
void SwitchToDeck (
const DeckDescriptor& rDeckDescriptor,