Files
pilotclient/src/blackgui/components/dbmappingcomponentaware.h
Lars Toenning bcc4bdd31e Add SPDX identifiers for REUSE compliance
Co-authored-by: Mat Sutcliffe <oktal3700@gmail.com>
2023-10-03 09:29:49 +02:00

54 lines
1.7 KiB
C++

// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
//! \file
#ifndef BLACKGUI_COMPONENTS_DBMAPPINGCOMPONENTAWARE_H
#define BLACKGUI_COMPONENTS_DBMAPPINGCOMPONENTAWARE_H
#include "blackmisc/statusmessage.h"
#include "blackgui/blackguiexport.h"
#include <QObject>
namespace BlackGui::Components
{
class CDbMappingComponent;
//! Allows subcomponents to gain access to model component
class BLACKGUI_EXPORT CDbMappingComponentAware
{
public:
//! Set the corresponding component
virtual void setMappingComponent(CDbMappingComponent *component);
//! Get the mapping component
CDbMappingComponent *getMappingComponent() const { return m_mappingComponent; }
protected:
//! Constructor
CDbMappingComponentAware(QObject *parent);
//! Destructor
virtual ~CDbMappingComponentAware() {}
//! Copy constructor
CDbMappingComponentAware(const CDbMappingComponentAware &) = default;
//! Copy assignment operator
CDbMappingComponentAware &operator=(const CDbMappingComponentAware &) = default;
//! @{
//! Overlay messages
bool showMappingComponentOverlayMessage(const BlackMisc::CStatusMessage &message, int timeoutMs = -1);
bool showMappingComponentOverlayHtmlMessage(const BlackMisc::CStatusMessage &message, int timeoutMs = -1);
//! @}
private:
CDbMappingComponent *m_mappingComponent = nullptr; //!< reference to component
};
} // ns
Q_DECLARE_INTERFACE(BlackGui::Components::CDbMappingComponentAware, "org.swift-project.blackgui.components.dbmappingcomponentaware")
#endif // guard