mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #899, specialized view for callsign based views
This commit is contained in:
committed by
Mathew Sutcliffe
parent
949407c1a7
commit
8e84f632b0
60
src/blackgui/views/viewcallsignobjects.h
Normal file
60
src/blackgui/views/viewcallsignobjects.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* Copyright (C) 2017
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_VIEWS_VIEWCALLSIGNOBJECTS_H
|
||||
#define BLACKGUI_VIEWS_VIEWCALLSIGNOBJECTS_H
|
||||
|
||||
#include "viewbase.h"
|
||||
#include <QSet>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
class QAction;
|
||||
class QIntValidator;
|
||||
class QLineEdit;
|
||||
class QWidget;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Menus { class CMenuActions; }
|
||||
namespace Views
|
||||
{
|
||||
//! Base class for views with DB objects
|
||||
template <class ModelClass, class ContainerType, class ObjectType> class CViewWithCallsignObjects :
|
||||
public CViewBase<ModelClass, ContainerType, ObjectType>
|
||||
{
|
||||
public:
|
||||
//! Select callsign
|
||||
void selectCallsign(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
//! Select given callsigns
|
||||
void selectCallsigns(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
|
||||
//! Get selected callsigns
|
||||
BlackMisc::Aviation::CCallsignSet selectedCallsigns() const;
|
||||
|
||||
//! Remove callsigns
|
||||
int removeCallsigns(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
|
||||
//! Update or insert data (based on callsign)
|
||||
int replaceOrAddObjectsByCallsign(const ContainerType &container);
|
||||
|
||||
//! Reselect by callsigns
|
||||
virtual void selectObjects(const ContainerType &selectedObjects) override;
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
explicit CViewWithCallsignObjects(QWidget *parent = nullptr);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user