swift
liveryfilterbar.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_FILTERS_LIVERYFILTERBAR_H
7 #define SWIFT_GUI_FILTERS_LIVERYFILTERBAR_H
8 
9 #include <memory>
10 
11 #include <QObject>
12 #include <QScopedPointer>
13 
15 #include "gui/models/modelfilter.h"
16 #include "gui/swiftguiexport.h"
17 #include "misc/rgbcolor.h"
18 
19 namespace Ui
20 {
21  class CLiveryFilterBar;
22 }
23 namespace swift::misc::aviation
24 {
25  class CLivery;
26  class CLiveryList;
27 } // namespace swift::misc::aviation
28 namespace swift::gui::filters
29 {
34  public CFilterWidget,
35  public models::IModelFilterProvider<swift::misc::aviation::CLiveryList>
36  {
37  Q_OBJECT
38 
39  public:
41  explicit CLiveryFilterBar(QWidget *parent = nullptr);
42 
44  virtual ~CLiveryFilterBar() override;
45 
47  virtual std::unique_ptr<swift::gui::models::IModelFilter<swift::misc::aviation::CLiveryList>>
48  createModelFilter() const override;
49 
51  void filter(const swift::misc::aviation::CLivery &livery);
52 
54  void filter(const swift::misc::aviation::CAirlineIcaoCode &airlineIcao);
55 
56  public slots:
58  virtual void onRowCountChanged(int count, bool withFilter) override;
59 
60  protected:
62  virtual void clearForm() override;
63 
64  private:
66  void onColorChanged(const swift::misc::CRgbColor &color);
67 
69  void onColorDistanceChanged(int distance);
70 
71  QScopedPointer<Ui::CLiveryFilterBar> ui;
72  };
73 } // namespace swift::gui::filters
74 
75 #endif // SWIFT_GUI_FILTERS_LIVERYFILTERBAR_H
Base for filter dialog.
Definition: filterwidget.h:21
Model filter interface for those who can generate such a filter (e.g. a widget or dialog)
Definition: modelfilter.h:61
Value object for ICAO classification.
Value object encapsulating information about an airpot.
Definition: livery.h:29
Filter to search data sets.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.