LibreOffice Module sd (master) 1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
sd::ViewTabBar Class Referencefinal

Tab control for switching between views in the center pane. More...

#include <ViewTabBar.hxx>

Inheritance diagram for sd::ViewTabBar:
[legend]
Collaboration diagram for sd::ViewTabBar:
[legend]

Public Member Functions

 ViewTabBar (const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewTabBarId, const rtl::Reference< ::sd::DrawController > &rxController)
 
virtual ~ViewTabBar () override
 
virtual void disposing (std::unique_lock< std::mutex > &) override
 
const VclPtr< TabBarControl > & GetTabControl () const
 
bool ActivatePage (size_t nIndex)
 
virtual void SAL_CALL notifyConfigurationChange (const css::drawing::framework::ConfigurationChangeEvent &rEvent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &rEvent) override
 
virtual void SAL_CALL addTabBarButtonAfter (const css::drawing::framework::TabBarButton &rButton, const css::drawing::framework::TabBarButton &rAnchor) override
 
virtual void SAL_CALL appendTabBarButton (const css::drawing::framework::TabBarButton &rButton) override
 
virtual void SAL_CALL removeTabBarButton (const css::drawing::framework::TabBarButton &rButton) override
 
virtual sal_Bool SAL_CALL hasTabBarButton (const css::drawing::framework::TabBarButton &rButton) override
 
virtual css::uno::Sequence< css::drawing::framework::TabBarButton > SAL_CALL getTabBarButtons () override
 
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getResourceId () override
 
virtual sal_Bool SAL_CALL isAnchorOnly () override
 
int GetHeight () const
 The returned value is calculated as the difference between the total height of the control and the height of its first tab page. More...
 
void UpdateActiveButton ()
 
void AddTabBarButton (const css::drawing::framework::TabBarButton &rButton, const css::drawing::framework::TabBarButton &rAnchor)
 
void AddTabBarButton (const css::drawing::framework::TabBarButton &rButton)
 
void RemoveTabBarButton (const css::drawing::framework::TabBarButton &rButton)
 
bool HasTabBarButton (const css::drawing::framework::TabBarButton &rButton)
 
css::uno::Sequence< css::drawing::framework::TabBarButton > GetTabBarButtons ()
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< typename... Ifc >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Private Types

typedef ::std::vector< css::drawing::framework::TabBarButton > TabBarButtonList
 

Private Member Functions

void AddTabBarButton (const css::drawing::framework::TabBarButton &rButton, sal_Int32 nPosition)
 
void UpdateTabBarButtons ()
 

Static Private Member Functions

static vcl::WindowGetAnchorWindow (const css::uno::Reference< css::drawing::framework::XResourceId > &rxViewTabBarId, const rtl::Reference<::sd::DrawController > &rxController)
 This method is called from the constructor to get the window for an anchor ResourceId and pass it to our base class. More...
 

Private Attributes

VclPtr< TabBarControlmpTabControl
 
rtl::Reference<::sd::DrawControllermxController
 
css::uno::Reference< css::drawing::framework::XConfigurationController > mxConfigurationController
 
TabBarButtonList maTabBarButtons
 
css::uno::Reference< css::drawing::framework::XResourceId > mxViewTabBarId
 
ViewShellBasempViewShellBase
 
int mnNoteBookWidthPadding
 

Additional Inherited Members

- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

Tab control for switching between views in the center pane.

Definition at line 70 of file ViewTabBar.hxx.

Member Typedef Documentation

◆ TabBarButtonList

typedef ::std::vector<css::drawing::framework::TabBarButton> sd::ViewTabBar::TabBarButtonList
private

Definition at line 154 of file ViewTabBar.hxx.

Constructor & Destructor Documentation

◆ ViewTabBar()

sd::ViewTabBar::ViewTabBar ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxViewTabBarId,
const rtl::Reference< ::sd::DrawController > &  rxController 
)

◆ ~ViewTabBar()

sd::ViewTabBar::~ViewTabBar ( )
overridevirtual

Definition at line 102 of file ViewTabBar.cxx.

Member Function Documentation

◆ ActivatePage()

bool sd::ViewTabBar::ActivatePage ( size_t  nIndex)

◆ AddTabBarButton() [1/3]

void sd::ViewTabBar::AddTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)

Definition at line 366 of file ViewTabBar.cxx.

References AddTabBarButton(), and maTabBarButtons.

◆ AddTabBarButton() [2/3]

void sd::ViewTabBar::AddTabBarButton ( const css::drawing::framework::TabBarButton &  rButton,
const css::drawing::framework::TabBarButton &  rAnchor 
)

Definition at line 339 of file ViewTabBar.cxx.

References AddTabBarButton(), maTabBarButtons, and nIndex.

Referenced by AddTabBarButton(), addTabBarButtonAfter(), and appendTabBarButton().

◆ AddTabBarButton() [3/3]

void sd::ViewTabBar::AddTabBarButton ( const css::drawing::framework::TabBarButton &  rButton,
sal_Int32  nPosition 
)
private

Definition at line 372 of file ViewTabBar.cxx.

References maTabBarButtons, UpdateActiveButton(), and UpdateTabBarButtons().

◆ addTabBarButtonAfter()

void SAL_CALL sd::ViewTabBar::addTabBarButtonAfter ( const css::drawing::framework::TabBarButton &  rButton,
const css::drawing::framework::TabBarButton &  rAnchor 
)
overridevirtual

Definition at line 215 of file ViewTabBar.cxx.

References AddTabBarButton().

◆ appendTabBarButton()

void SAL_CALL sd::ViewTabBar::appendTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)
overridevirtual

Definition at line 223 of file ViewTabBar.cxx.

References AddTabBarButton().

◆ disposing() [1/2]

virtual void SAL_CALL sd::ViewTabBar::disposing ( const css::lang::EventObject &  rEvent)
overridevirtual

◆ disposing() [2/2]

void sd::ViewTabBar::disposing ( std::unique_lock< std::mutex > &  )
overridevirtual

◆ GetAnchorWindow()

vcl::Window * sd::ViewTabBar::GetAnchorWindow ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxViewTabBarId,
const rtl::Reference<::sd::DrawController > &  rxController 
)
staticprivate

This method is called from the constructor to get the window for an anchor ResourceId and pass it to our base class.

It has to be static because it must not access any of the, not yet initialized members.

Definition at line 138 of file ViewTabBar.cxx.

References vcl::Window::GetParent(), SfxViewShell::GetViewFrame(), SfxViewFrame::GetWindow(), and vcl::Window::GetWindow().

◆ GetHeight()

int sd::ViewTabBar::GetHeight ( ) const

The returned value is calculated as the difference between the total height of the control and the height of its first tab page.

This can be considered a hack. This procedure works only when the control is visible. Calling this method when the control is not visible results in returning a default value. To be on the safe side wait for this control to become visible and the call this method again.

Definition at line 303 of file ViewTabBar.cxx.

References weld::Notebook::get_n_pages(), weld::Notebook::get_page(), maTabBarButtons, mnNoteBookWidthPadding, mpTabControl, nIndex, and weld::Widget::set_size_request().

◆ getResourceId()

Reference< XResourceId > SAL_CALL sd::ViewTabBar::getResourceId ( )
overridevirtual

Definition at line 249 of file ViewTabBar.cxx.

References mxViewTabBarId.

◆ GetTabBarButtons()

css::uno::Sequence< css::drawing::framework::TabBarButton > sd::ViewTabBar::GetTabBarButtons ( )

Definition at line 419 of file ViewTabBar.cxx.

References comphelper::containerToSequence(), and maTabBarButtons.

Referenced by getTabBarButtons().

◆ getTabBarButtons()

Sequence< TabBarButton > SAL_CALL sd::ViewTabBar::getTabBarButtons ( )
overridevirtual

Definition at line 241 of file ViewTabBar.cxx.

References GetTabBarButtons().

◆ GetTabControl()

const VclPtr< TabBarControl > & sd::ViewTabBar::GetTabControl ( ) const
inline

Definition at line 81 of file ViewTabBar.hxx.

References mpTabControl.

◆ HasTabBarButton()

bool sd::ViewTabBar::HasTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)

Definition at line 401 of file ViewTabBar.cxx.

References maTabBarButtons.

Referenced by hasTabBarButton().

◆ hasTabBarButton()

sal_Bool SAL_CALL sd::ViewTabBar::hasTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)
overridevirtual

Definition at line 235 of file ViewTabBar.cxx.

References HasTabBarButton().

◆ isAnchorOnly()

sal_Bool SAL_CALL sd::ViewTabBar::isAnchorOnly ( )
overridevirtual

Definition at line 254 of file ViewTabBar.cxx.

◆ notifyConfigurationChange()

void SAL_CALL sd::ViewTabBar::notifyConfigurationChange ( const css::drawing::framework::ConfigurationChangeEvent &  rEvent)
overridevirtual

Definition at line 190 of file ViewTabBar.cxx.

References mxViewTabBarId, and UpdateActiveButton().

◆ RemoveTabBarButton()

void sd::ViewTabBar::RemoveTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)

Definition at line 386 of file ViewTabBar.cxx.

References maTabBarButtons, nIndex, UpdateActiveButton(), and UpdateTabBarButtons().

Referenced by removeTabBarButton().

◆ removeTabBarButton()

void SAL_CALL sd::ViewTabBar::removeTabBarButton ( const css::drawing::framework::TabBarButton &  rButton)
overridevirtual

Definition at line 229 of file ViewTabBar.cxx.

References RemoveTabBarButton().

◆ UpdateActiveButton()

void sd::ViewTabBar::UpdateActiveButton ( )

◆ UpdateTabBarButtons()

void sd::ViewTabBar::UpdateTabBarButtons ( )
private

Member Data Documentation

◆ maTabBarButtons

TabBarButtonList sd::ViewTabBar::maTabBarButtons
private

◆ mnNoteBookWidthPadding

int sd::ViewTabBar::mnNoteBookWidthPadding
private

Definition at line 158 of file ViewTabBar.hxx.

Referenced by GetHeight(), and UpdateTabBarButtons().

◆ mpTabControl

VclPtr<TabBarControl> sd::ViewTabBar::mpTabControl
private

◆ mpViewShellBase

ViewShellBase* sd::ViewTabBar::mpViewShellBase
private

Definition at line 157 of file ViewTabBar.hxx.

Referenced by ActivatePage(), disposing(), UpdateActiveButton(), and ViewTabBar().

◆ mxConfigurationController

css::uno::Reference<css::drawing::framework::XConfigurationController> sd::ViewTabBar::mxConfigurationController
private

Definition at line 153 of file ViewTabBar.hxx.

Referenced by disposing(), and ViewTabBar().

◆ mxController

rtl::Reference<::sd::DrawController> sd::ViewTabBar::mxController
private

Definition at line 152 of file ViewTabBar.hxx.

Referenced by ActivatePage(), disposing(), and ViewTabBar().

◆ mxViewTabBarId

css::uno::Reference<css::drawing::framework::XResourceId> sd::ViewTabBar::mxViewTabBarId
private

The documentation for this class was generated from the following files: