swift
coreinfoareacomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 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_COMPONENTS_COREINFOAREACOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_COREINFOAREACOMPONENT_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 CCoreInfoAreaComponent;
22 }
23 
24 namespace swift::gui::components
25 {
26  class CCoreStatusComponent;
27  class CLogComponent;
28 
31  {
32  Q_OBJECT
33 
34  public:
36  explicit CCoreInfoAreaComponent(QWidget *parent = nullptr);
37 
39  virtual ~CCoreInfoAreaComponent() override;
40 
42  enum InfoArea
43  {
44  // index must match tab index!
45  InfoAreaLog = 0,
46  InfoAreaStatus = 1,
47  InfoAreaNone = -1
48  };
49 
51  CLogComponent *getLogComponent();
52 
54  CCoreStatusComponent *getStatusComponent();
55 
56  public slots:
58  void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
59 
61  void selectArea(InfoArea infoArea) { CInfoArea::selectArea(static_cast<int>(infoArea)); }
62 
63  protected:
65  virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
66 
68  virtual const QPixmap &indexToPixmap(int areaIndex) const override;
69 
70  private:
71  QScopedPointer<Ui::CCoreInfoAreaComponent> ui;
72  };
73 } // namespace swift::gui::components
74 
75 #endif // SWIFT_GUI_COMPONENTS_COREINFOAREACOMPONENT_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
void selectArea(InfoArea infoArea)
Select area.
void toggleFloating(InfoArea infoArea)
Toggle floating of given area.
Display status information about the core.
GUI displaying log and status messages.
Definition: logcomponent.h:45
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.