swift
viewcallsignobjects.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2017 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_VIEWS_VIEWCALLSIGNOBJECTS_H
7 #define SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H
8 
9 #include "gui/views/viewbase.h"
11 
12 class QAction;
13 class QIntValidator;
14 class QLineEdit;
15 class QWidget;
16 
17 namespace swift::gui
18 {
19  namespace menus
20  {
21  class CMenuActions;
22  }
23  namespace views
24  {
26  template <class T>
28  {
29  public:
31  using ModelClass = T;
32 
34  using ContainerType = typename T::ContainerType;
35 
37  using ObjectType = typename T::ObjectType;
38 
41 
44 
47 
50 
53 
56 
58  int replaceOrAddObjectByCallsign(const ObjectType &object);
59 
61  void selectObjects(const ContainerType &selectedObjects) override;
62 
63  protected:
65  explicit CViewWithCallsignObjects(QWidget *parent = nullptr);
66  };
67  } // namespace views
68 } // namespace swift::gui
69 #endif // SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H
Base class for views.
Definition: viewbase.h:648
ContainerType selectedObjects() const
Selected objects.
Definition: viewbase.cpp:240
typename T::ObjectType ObjectType
Model container element type.
Definition: viewbase.h:660
const ContainerType & container() const
Access to container.
Definition: viewbase.cpp:200
typename T::ContainerType ContainerType
Model container type.
Definition: viewbase.h:657
Base class for views with DB objects.
void selectCallsigns(const swift::misc::aviation::CCallsignSet &callsigns)
Select given callsigns.
int removeCallsign(const swift::misc::aviation::CCallsign &callsign)
Remove callsign.
int replaceOrAddObjectByCallsign(const ObjectType &object)
Update or insert data (based on callsign)
int removeCallsigns(const swift::misc::aviation::CCallsignSet &callsigns)
Remove callsigns.
CViewWithCallsignObjects(QWidget *parent=nullptr)
Constructor.
int replaceOrAddObjectsByCallsign(const ContainerType &container)
Update or insert data (based on callsign)
swift::misc::aviation::CCallsignSet selectedCallsigns() const
Get selected callsigns.
void selectObjects(const ContainerType &selectedObjects)
Reselect by callsigns.
void selectCallsign(const swift::misc::aviation::CCallsign &callsign)
Select callsign.
Value object encapsulating information of a callsign.
Definition: callsign.h:30
Value object for a set of callsigns.
Definition: callsignset.h:26
GUI related classes.
QObject * parent() const const