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 SVT_PANELTABBAR_HXX
21 #define SVT_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>
34 //........................................................................
37 //........................................................................
39 class PanelTabBar_Impl
;
42 //====================================================================
44 //====================================================================
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( Window
& i_rParentWindow
, IToolPanelDeck
& i_rPanelDeck
, const TabAlignment i_eAlignment
, const TabItemContent i_eItemContent
);
57 TabItemContent
GetTabItemContent() const;
58 void SetTabItemContent( const TabItemContent
& i_eItemContent
);
60 ::boost::optional
< size_t > GetFocusedPanelItem() const;
61 void FocusPanelItem( const size_t i_nItemPos
);
62 Rectangle
GetItemScreenRect( const size_t i_nItemPos
) const;
63 bool IsVertical() const;
64 IToolPanelDeck
& GetPanelDeck() const;
65 PushButton
& GetScrollButton( const bool i_bForward
);
67 // Window overridables
68 virtual Size
GetOptimalSize() const;
71 // Window overridables
72 virtual void Paint( const Rectangle
& i_rRect
);
73 virtual void Resize();
74 virtual void MouseMove( const MouseEvent
& i_rMouseEvent
);
75 virtual void MouseButtonDown( const MouseEvent
& i_rMouseEvent
);
76 virtual void MouseButtonUp( const MouseEvent
& i_rMouseEvent
);
77 virtual void RequestHelp( const HelpEvent
& i_rHelpEvent
);
78 virtual void GetFocus();
79 virtual void LoseFocus();
80 virtual void KeyInput( const KeyEvent
& i_rKeyEvent
);
81 virtual void DataChanged( const DataChangedEvent
& i_rDataChanedEvent
);
83 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>
84 GetComponentInterface( sal_Bool i_bCreate
);
87 ::std::auto_ptr
< PanelTabBar_Impl
> m_pImpl
;
90 //........................................................................
92 //........................................................................
94 #endif // SVT_PANELTABBAR_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */