mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
70 lines
2.1 KiB
C++
70 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
|
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
|
|
|
//! \file
|
|
|
|
#ifndef SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H
|
|
#define SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H
|
|
|
|
#include "gui/views/viewbase.h"
|
|
#include "misc/aviation/callsignset.h"
|
|
|
|
class QAction;
|
|
class QIntValidator;
|
|
class QLineEdit;
|
|
class QWidget;
|
|
|
|
namespace swift::gui
|
|
{
|
|
namespace menus
|
|
{
|
|
class CMenuActions;
|
|
}
|
|
namespace views
|
|
{
|
|
//! Base class for views with DB objects
|
|
template <class T>
|
|
class CViewWithCallsignObjects : public CViewBase<T>
|
|
{
|
|
public:
|
|
//! Model type
|
|
using ModelClass = T;
|
|
|
|
//! Model container type
|
|
using ContainerType = typename T::ContainerType;
|
|
|
|
//! Model container element type
|
|
using ObjectType = typename T::ObjectType;
|
|
|
|
//! Select callsign
|
|
void selectCallsign(const swift::misc::aviation::CCallsign &callsign);
|
|
|
|
//! Select given callsigns
|
|
void selectCallsigns(const swift::misc::aviation::CCallsignSet &callsigns);
|
|
|
|
//! Get selected callsigns
|
|
swift::misc::aviation::CCallsignSet selectedCallsigns() const;
|
|
|
|
//! Remove callsigns
|
|
int removeCallsigns(const swift::misc::aviation::CCallsignSet &callsigns);
|
|
|
|
//! Remove callsign
|
|
int removeCallsign(const swift::misc::aviation::CCallsign &callsign);
|
|
|
|
//! Update or insert data (based on callsign)
|
|
int replaceOrAddObjectsByCallsign(const ContainerType &container);
|
|
|
|
//! Update or insert data (based on callsign)
|
|
int replaceOrAddObjectByCallsign(const ObjectType &object);
|
|
|
|
//! Reselect by callsigns
|
|
void selectObjects(const ContainerType &selectedObjects) override;
|
|
|
|
protected:
|
|
//! Constructor
|
|
explicit CViewWithCallsignObjects(QWidget *parent = nullptr);
|
|
};
|
|
} // namespace views
|
|
} // namespace swift::gui
|
|
#endif // SWIFT_GUI_VIEWS_VIEWCALLSIGNOBJECTS_H
|