swift
Loading...
Searching...
No Matches
cockpitinfoareacomponent.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_GUI_COCKPITINFOAREACOMPONENT_H
7#define SWIFT_GUI_COCKPITINFOAREACOMPONENT_H
8
9#include <QObject>
10#include <QScopedPointer>
11#include <QSize>
12
13#include "gui/infoarea.h"
14#include "gui/swiftguiexport.h"
15
16class QPixmap;
17class QWidget;
18
19namespace Ui
20{
21 class CCockpitInfoAreaComponent;
22}
24{
28 {
30
31 public:
33 explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr);
34
37
40 {
41 // index must match tab index!
42 InfoAreaNotifications = 0,
43 InfoAreaAudio = 1,
44 InfoAreaAdvanced = 2,
45 InfoAreaNone = -1
46 };
47
48 public slots:
50 void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
51
53 void selectArea(InfoArea infoArea) { CInfoArea::selectArea(static_cast<int>(infoArea)); }
54
55 protected:
57 QSize getPreferredSizeWhenFloating(int areaIndex) const override;
58
60 const QPixmap &indexToPixmap(int areaIndex) const override;
61
62 private:
64 };
65
66} // namespace swift::gui::components
67#endif // SWIFT_GUI_COCKPITINFOAREACOMPONENT_H
Info area, hosting dockable widgets.
Definition infoarea.h:41
void toggleFloatingByIndex(int areaIndex)
Toggle floating of index.
Definition infoarea.cpp:430
void selectArea(int areaIndex)
Select area.
Definition infoarea.cpp:460
CCockpitInfoAreaComponent(QWidget *parent=nullptr)
Destructor.
void toggleFloating(InfoArea infoArea)
Toggle floating of given area.
High level reusable GUI components.
Q_OBJECTQ_OBJECT
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
#define SWIFT_GUI_EXPORT
Export a class or function from the library.