/* Copyright (C) 2015 * 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_VIEWDBOBJECTS_H #define BLACKGUI_VIEWDBOBJECTS_H #include "blackgui/blackguiexport.h" #include "viewbase.h" #include namespace BlackGui { namespace Views { //! Base class for views with DB objects template class CViewWithDbObjects : public CViewBase { public: //! Get latest object ObjectType latestObject() const; //! Get oldets object ObjectType oldestObject() const; //! Select given DB keys void selectDbKeys(const QList &keys); //! Remove keys int removeDbKeys(const QList &keys); //! Update or insert data (based on DB key) int replaceOrAddObjectsByKey(const ContainerType &container); protected: //! Constructor explicit CViewWithDbObjects(QWidget *parent = nullptr); //! \copydoc BlackGui::Views::CViewBaseNonTemplate::customMenu virtual void customMenu(QMenu &menu) const override; protected slots: //! \copydoc BlackGui::Views::CViewBase::ps_toggleHighlightDbData virtual void ps_toggleHighlightDbData() override; }; } // namespace } // namespace #endif // guard