1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_TOOLPANEL_PANELTABBAR_HXX
21 #define INCLUDED_SVTOOLS_TOOLPANEL_PANELTABBAR_HXX
23 #include <svtools/svtdllapi.h>
24 #include <svtools/toolpanel/tabalignment.hxx>
25 #include <svtools/toolpanel/tabitemcontent.hxx>
27 #include <vcl/ctrl.hxx>
30 #include <boost/optional.hpp>
39 class PanelTabBar_Impl
;
45 /** a tab bar for selecting panels
47 At the moment, this control aligns the tabs vertically, this might be extended to also support a horizontal
50 class SVT_DLLPUBLIC PanelTabBar
: public Control
53 PanelTabBar( vcl::Window
& i_rParentWindow
, IToolPanelDeck
& i_rPanelDeck
, const TabAlignment i_eAlignment
, const TabItemContent i_eItemContent
);
54 virtual ~PanelTabBar();
55 virtual void dispose() SAL_OVERRIDE
;
58 TabItemContent
GetTabItemContent() const;
59 void SetTabItemContent( const TabItemContent
& i_eItemContent
);
61 ::boost::optional
< size_t > GetFocusedPanelItem() const;
62 void FocusPanelItem( const size_t i_nItemPos
);
63 Rectangle
GetItemScreenRect( const size_t i_nItemPos
) const;
64 bool IsVertical() const;
65 IToolPanelDeck
& GetPanelDeck() const;
66 PushButton
& GetScrollButton( const bool i_bForward
);
68 // Window overridables
69 virtual Size
GetOptimalSize() const SAL_OVERRIDE
;
72 // Window overridables
73 virtual void Paint( vcl::RenderContext
& rRenderContext
, const Rectangle
& i_rRect
) SAL_OVERRIDE
;
74 virtual void Resize() SAL_OVERRIDE
;
75 virtual void MouseMove( const MouseEvent
& i_rMouseEvent
) SAL_OVERRIDE
;
76 virtual void MouseButtonDown( const MouseEvent
& i_rMouseEvent
) SAL_OVERRIDE
;
77 virtual void MouseButtonUp( const MouseEvent
& i_rMouseEvent
) SAL_OVERRIDE
;
78 virtual void RequestHelp( const HelpEvent
& i_rHelpEvent
) SAL_OVERRIDE
;
79 virtual void GetFocus() SAL_OVERRIDE
;
80 virtual void LoseFocus() SAL_OVERRIDE
;
81 virtual void KeyInput( const KeyEvent
& i_rKeyEvent
) SAL_OVERRIDE
;
82 virtual void DataChanged( const DataChangedEvent
& i_rDataChanedEvent
) SAL_OVERRIDE
;
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>
85 GetComponentInterface( bool i_bCreate
) SAL_OVERRIDE
;
88 ::std::unique_ptr
< PanelTabBar_Impl
> m_pImpl
;
95 #endif // INCLUDED_SVTOOLS_TOOLPANEL_PANELTABBAR_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */