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 .
23 #include <vcl/dllapi.h>
24 #include <vcl/toolkit/ivctrl.hxx>
25 #include <vcl/layout.hxx>
27 struct VerticalTabPageData
;
29 class VerticalTabControl final
: public VclHBox
31 VclPtr
<SvtIconChoiceCtrl
> m_xChooser
;
32 VclPtr
<VclVBox
> m_xBox
;
34 std::vector
<std::unique_ptr
<VerticalTabPageData
>> maPageList
;
35 OString m_sCurrentPageId
;
37 Link
<VerticalTabControl
*, void> m_aActivateHdl
;
38 Link
<VerticalTabControl
*, bool> m_aDeactivateHdl
;
40 DECL_LINK(ChosePageHdl_Impl
, SvtIconChoiceCtrl
*, void);
43 bool DeactivatePage();
45 VerticalTabPageData
* GetPageData(const OString
& rId
) const;
46 VerticalTabPageData
* GetPageData(const SvxIconChoiceCtrlEntry
* pEntry
) const;
49 VerticalTabControl(vcl::Window
* pParent
);
50 virtual ~VerticalTabControl() override
;
51 virtual void dispose() override
;
53 sal_uInt16
GetPageCount() const { return m_xChooser
->GetEntryCount(); }
55 OString
GetCurPageId() const { return m_sCurrentPageId
; }
56 void SetCurPageId(const OString
& rId
);
58 sal_uInt16
GetPagePos(const OString
& rPageId
) const;
59 OString
GetPageId(sal_uInt16 nIndex
) const;
60 VclPtr
<vcl::Window
> GetPage(const OString
& rPageId
);
62 void RemovePage(const OString
& rPageId
);
63 void InsertPage(const OString
& rPageId
, const OUString
& rLabel
, const Image
& rImage
,
64 const OUString
& rTooltip
, VclPtr
<vcl::Window
> xPage
, int nPos
= -1);
66 void SetActivatePageHdl(const Link
<VerticalTabControl
*, void>& rLink
)
68 m_aActivateHdl
= rLink
;
70 void SetDeactivatePageHdl(const Link
<VerticalTabControl
*, bool>& rLink
)
72 m_aDeactivateHdl
= rLink
;
75 OUString
GetPageText(const OString
& rPageId
) const;
76 void SetPageText(const OString
& rPageId
, const OUString
& rText
);
78 vcl::Window
* GetPageParent() { return m_xBox
.get(); }
80 virtual FactoryFunction
GetUITestFactory() const override
;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */