1 /*
2  * Copyright (C) by Michael Schuster <michael@schuster.ms>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12  * for more details.
13  */
14 
15 /****************************************************************************
16 **
17 ** Based on Qt sourcecode:
18 **   qt5/qtbase/src/widgets/dialogs/qwizard.cpp
19 **
20 ** https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/dialogs/qwizard.cpp?h=v5.13.0
21 **
22 ** Original license:
23 **
24 ** Copyright (C) 2016 The Qt Company Ltd.
25 ** Contact: https://www.qt.io/licensing/
26 **
27 ** This file is part of the QtWidgets module of the Qt Toolkit.
28 **
29 ** $QT_BEGIN_LICENSE:LGPL$
30 ** Commercial License Usage
31 ** Licensees holding valid commercial Qt licenses may use this file in
32 ** accordance with the commercial license agreement provided with the
33 ** Software or, alternatively, in accordance with the terms contained in
34 ** a written agreement between you and The Qt Company. For licensing terms
35 ** and conditions see https://www.qt.io/terms-conditions. For further
36 ** information use the contact form at https://www.qt.io/contact-us.
37 **
38 ** GNU Lesser General Public License Usage
39 ** Alternatively, this file may be used under the terms of the GNU Lesser
40 ** General Public License version 3 as published by the Free Software
41 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
42 ** packaging of this file. Please review the following information to
43 ** ensure the GNU Lesser General Public License version 3 requirements
44 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
45 **
46 ** GNU General Public License Usage
47 ** Alternatively, this file may be used under the terms of the GNU
48 ** General Public License version 2.0 or (at your option) the GNU General
49 ** Public license version 3 or any later version approved by the KDE Free
50 ** Qt Foundation. The licenses are as published by the Free Software
51 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
52 ** included in the packaging of this file. Please review the following
53 ** information to ensure the GNU General Public License requirements will
54 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
55 ** https://www.gnu.org/licenses/gpl-3.0.html.
56 **
57 ** $QT_END_LICENSE$
58 **
59 ****************************************************************************/
60 
61 #ifndef HEADERBANNER_H
62 #define HEADERBANNER_H
63 
64 #include <QWidget>
65 
66 class QLabel;
67 class QGridLayout;
68 class QPixmap;
69 
70 namespace OCC {
71 
72 class HeaderBanner : public QWidget
73 {
74     Q_OBJECT
75 public:
76     HeaderBanner(QWidget *parent = nullptr);
77 
78     void setup(const QString &title, const QPixmap &logo, const QPixmap &banner,
79                const Qt::TextFormat titleFormat, const QString &styleSheet);
80 
81 protected:
82     void paintEvent(QPaintEvent *event) override;
83 
84 private:
85     QLabel *titleLabel;
86     QLabel *logoLabel;
87     QGridLayout *layout;
88     QPixmap bannerPixmap;
89 };
90 
91 } // namespace OCC
92 
93 #endif // HEADERBANNER_H
94