Use o3tl::convert in Math
[LibreOffice.git] / sfx2 / inc / sidebar / TitleBar.hxx
blob8264acc24e6586119e4abf17f44a300bece86eaa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #pragma once
21 #include <sidebar/SidebarToolBox.hxx>
22 #include <sfx2/sidebar/Theme.hxx>
23 #include <sfx2/weldutils.hxx>
25 namespace sfx2::sidebar {
27 class TitleBar
29 public:
30 TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem);
31 virtual ~TitleBar();
33 virtual void SetTitle (const OUString& rsTitle) = 0;
34 virtual OUString GetTitle() const = 0;
36 virtual void DataChanged();
38 void Show(bool bShow);
39 bool GetVisible() const;
41 Size get_preferred_size() const;
43 void SetIcon(const css::uno::Reference<css::graphic::XGraphic>& rIcon);
45 weld::Toolbar& GetToolBox()
47 return *mxToolBox;
49 const weld::Toolbar& GetToolBox() const
51 return *mxToolBox;
54 protected:
55 weld::Builder& mrBuilder;
56 std::unique_ptr<weld::Box> mxTitlebar;
57 std::unique_ptr<weld::Image> mxAddonImage;
58 std::unique_ptr<weld::Toolbar> mxToolBox;
59 Theme::ThemeItem meThemeItem;
61 virtual void HandleToolBoxItemClick() = 0;
63 DECL_LINK(SelectionHandler, const OString&, void);
65 private:
66 void SetBackground();
69 } // end of namespace sfx2::sidebar
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */