LibreOffice Module sfx2 (master) 1
TitleBar.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
22#include <vcl/weld.hxx>
23
24namespace sfx2::sidebar {
25
27{
28public:
29 TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem);
30 virtual ~TitleBar();
31
32 virtual void SetTitle (const OUString& rsTitle) = 0;
33 virtual OUString GetTitle() const = 0;
34
35 virtual void DataChanged();
36
37 void Show(bool bShow);
38 bool GetVisible() const;
39
41
42 void SetIcon(const css::uno::Reference<css::graphic::XGraphic>& rIcon);
43
45 {
46 return *mxToolBox;
47 }
49 {
50 return *mxToolBox;
51 }
52
53protected:
55 std::unique_ptr<weld::Box> mxTitlebar;
56 std::unique_ptr<weld::Image> mxAddonImage;
57 std::unique_ptr<weld::Toolbar> mxToolBox;
59
60 virtual void HandleToolBoxItemClick() = 0;
61
62 DECL_LINK(SelectionHandler, const OUString&, void);
63
64private:
65 void SetBackground();
66};
67
68} // end of namespace sfx2::sidebar
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetVisible() const
Definition: TitleBar.cxx:62
weld::Toolbar & GetToolBox()
Definition: TitleBar.hxx:44
Theme::ThemeItem meThemeItem
Definition: TitleBar.hxx:58
virtual void HandleToolBoxItemClick()=0
void SetIcon(const css::uno::Reference< css::graphic::XGraphic > &rIcon)
Definition: TitleBar.cxx:67
virtual void DataChanged()
Definition: TitleBar.cxx:43
weld::Builder & mrBuilder
Definition: TitleBar.hxx:54
TitleBar(weld::Builder &rBuilder, Theme::ThemeItem eThemeItem)
Definition: TitleBar.cxx:24
void Show(bool bShow)
Definition: TitleBar.cxx:57
virtual OUString GetTitle() const =0
std::unique_ptr< weld::Box > mxTitlebar
Definition: TitleBar.hxx:55
std::unique_ptr< weld::Image > mxAddonImage
Definition: TitleBar.hxx:56
const weld::Toolbar & GetToolBox() const
Definition: TitleBar.hxx:48
std::unique_ptr< weld::Toolbar > mxToolBox
Definition: TitleBar.hxx:57
DECL_LINK(SelectionHandler, const OUString &, void)
Size get_preferred_size() const
Definition: TitleBar.cxx:52
virtual void SetTitle(const OUString &rsTitle)=0