30mPanelId(
std::move(panelId)),
31mDeckId(
std::move(deckId))
35 pSidebarController->CreateDeck(
mDeckId);
36 mpDeck = pSidebarController->GetResourceManager()->GetDeckDescriptor(
mDeckId)->mpDeck;
42 return SidebarController::GetSidebarControllerForFrame(
xFrame);
57 PanelTitleBar* pTitleBar = xPanel ? xPanel->GetTitleBar() :
nullptr;
59 return pTitleBar->GetTitle();
69 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
73 xPanelDescriptor->msTitle = newTitle;
75 PanelTitleBar* pTitleBar = xPanel ? xPanel->GetTitleBar() :
nullptr;
77 pTitleBar->SetTitle(newTitle);
86 return xPanel && xPanel->IsExpanded();
97 xPanel->SetExpanded(
true);
102 for (
auto const& panel : aPanels)
104 if (! panel->HasIdPredicate(
mPanelId))
105 panel->SetExpanded(
false);
110 pSidebarController->NotifyResize();
120 xPanel->SetExpanded(
false);
122 pSidebarController->NotifyResize();
130 return xPanel ? xPanel->GetElementWindow() :
nullptr;
138 sal_Int32
index = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId)->mnOrderIndex;
147 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
149 if (xPanelDescriptor)
151 xPanelDescriptor->mnOrderIndex = newOrderIndex;
153 pSidebarController->NotifyResize();
162 ResourceManager::PanelContextDescriptorContainer aPanels = pSidebarController->GetMatchingPanels(
mDeckId);
167 if (curOrderIndex != minIndex)
170 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
171 if (xPanelDescriptor)
173 xPanelDescriptor->mnOrderIndex = minIndex;
175 pSidebarController->NotifyResize();
185 ResourceManager::PanelContextDescriptorContainer aPanels = pSidebarController->GetMatchingPanels(
mDeckId);
190 if (curOrderIndex != maxIndex)
193 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
194 if (xPanelDescriptor)
196 xPanelDescriptor->mnOrderIndex = maxIndex;
198 pSidebarController->NotifyResize();
209 ResourceManager::PanelContextDescriptorContainer aPanels = pSidebarController->GetMatchingPanels(
mDeckId);
214 for (
auto const& panel : aPanels)
216 sal_Int32
index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
217 if( index < curOrderIndex && index > previousIndex)
218 previousIndex =
index;
221 if (curOrderIndex != previousIndex)
224 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
225 if (xPanelDescriptor)
227 xPanelDescriptor->mnOrderIndex = previousIndex;
229 pSidebarController->NotifyResize();
239 ResourceManager::PanelContextDescriptorContainer aPanels = pSidebarController->GetMatchingPanels(
mDeckId);
245 for (
auto const& panel : aPanels)
247 sal_Int32
index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
248 if(
index > curOrderIndex &&
index < nextIndex)
252 if (curOrderIndex != nextIndex)
255 std::shared_ptr<PanelDescriptor> xPanelDescriptor = pSidebarController->GetResourceManager()->GetPanelDescriptor(
mPanelId);
256 if (xPanelDescriptor)
258 xPanelDescriptor->mnOrderIndex = nextIndex;
260 pSidebarController->NotifyResize();
269 sal_Int32 minIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(rPanels.begin()->msId)->mnOrderIndex;
271 for (
auto const& panel : rPanels)
273 sal_Int32
index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
284 sal_Int32 maxIndex = pSidebarController->GetResourceManager()->GetPanelDescriptor(rPanels.begin()->msId)->mnOrderIndex;
286 for (
auto const& panel : rPanels)
288 sal_Int32
index = pSidebarController->GetResourceManager()->GetPanelDescriptor(panel.msId)->mnOrderIndex;
VclPtr< sfx2::sidebar::Deck > mpDeck
virtual void SAL_CALL collapse() override
virtual sal_Int32 SAL_CALL getOrderIndex() override
virtual sal_Bool SAL_CALL isExpanded() override
virtual void SAL_CALL expand(const sal_Bool bCollapseOther) override
sfx2::sidebar::SidebarController * getSidebarController()
virtual void SAL_CALL moveDown() override
virtual void SAL_CALL setOrderIndex(const sal_Int32 newOrderIndex) override
virtual OUString SAL_CALL getId() override
SfxUnoPanel(css::uno::Reference< css::frame::XFrame >, OUString, OUString)
std::weak_ptr< sfx2::sidebar::Panel > mxPanel
virtual void SAL_CALL moveUp() override
virtual void SAL_CALL moveFirst() override
const css::uno::Reference< css::frame::XFrame > xFrame
virtual OUString SAL_CALL getTitle() override
sal_Int32 GetMaxOrderIndex(const sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer &rPanels)
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getDialog() override
virtual void SAL_CALL moveLast() override
virtual void SAL_CALL setTitle(const OUString &newTitle) override
sal_Int32 GetMinOrderIndex(const sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer &rPanels)
Reference< XFrame > xFrame