swift
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 
16 class QPixmap;
17 class QWidget;
18 
19 namespace Ui
20 {
21  class CCockpitInfoAreaComponent;
22 }
23 namespace swift::gui::components
24 {
28  {
29  Q_OBJECT
30 
31  public:
33  explicit CCockpitInfoAreaComponent(QWidget *parent = nullptr);
34 
36  virtual ~CCockpitInfoAreaComponent() override;
37 
39  enum InfoArea
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  virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
58 
60  virtual const QPixmap &indexToPixmap(int areaIndex) const override;
61 
62  private:
63  QScopedPointer<Ui::CCockpitInfoAreaComponent> ui;
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:378
void selectArea(int areaIndex)
Select area.
Definition: infoarea.cpp:396
The cockpit itself is part of the main info area, but itself also an info area. hence windows can be ...
void toggleFloating(InfoArea infoArea)
Toggle floating of given area.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.