94 lines
2.7 KiB
C++
Executable File
94 lines
2.7 KiB
C++
Executable File
/**
|
|
*@RDE_HEADER@
|
|
* Gui Plugin for Building - Info
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2017-04-05
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
//Buildings
|
|
#include "bld_search.h"
|
|
#include <Buildings/logger.h>
|
|
#include <Buildings/bld_info_gui_plugin_interface.h>
|
|
#include <Plugins/InfrastructureManagement/ism_data_plugin_interface.h>
|
|
|
|
// Common
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
|
|
#include <QPointer>
|
|
|
|
// Forward:
|
|
class QShortcut;
|
|
|
|
namespace Buildings
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:bld.info")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
public:
|
|
GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return QLatin1String("BuildingInfoGui"); }
|
|
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return (partition == IDL::PartitionType::Global) || // for App 'ResourceManager'
|
|
(partition == IDL::PartitionType::Exercise) ||
|
|
(partition == IDL::PartitionType::Replay);
|
|
}
|
|
};
|
|
|
|
|
|
class InterfaceImpl final : public QObject, public Buildings::ForeignInfoGuiInterface, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
|
|
bool fetchInterfaces() override;
|
|
void clearInterfaces() override;
|
|
QString menuGroup() const override;
|
|
|
|
// anders als in GuiPlugin - hmm, Mike sagt, so lassen - hmm:
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return (partition == IDL::PartitionType::Global) ||
|
|
(partition == IDL::PartitionType::Exercise) ||
|
|
(partition == IDL::PartitionType::Replay);
|
|
}
|
|
|
|
QVector<LtsWidgets::PluginData> getActions() override;
|
|
|
|
|
|
// ForeignDataInterface
|
|
void showInfoWindow(const QVector<int> &bldEntityIds) override;
|
|
void showInfoWindow(int bldEntityId) override;
|
|
void showEffectGenerationUnitWindow(int mountingPointId) override;
|
|
void showHitLineInfoWindow(const QVector<int> &hitLineIds) override;
|
|
void showHitLineInfoWindow(int hitLineId) override;
|
|
void showBridgeInfoWindow(const QVector<int> &bldEntityIds) override;
|
|
void showBridgeInfoWindow(int buildingId) override;
|
|
|
|
private Q_SLOTS:
|
|
void showBuildingSearchDialog();
|
|
void onBuildinSearchStringEntered(const QString &searchString);
|
|
|
|
private:
|
|
QShortcut *m_scSearchBuilding{nullptr};
|
|
QPointer<BuildingSearchModal> m_buildingShowModalPtr;
|
|
QPointer<BuildingSearchWidget> m_buildingShowQWidgetPtr; // for OC
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
|
|
std::shared_ptr<InfrastructureManagement::ForeignDataInterface> m_ismDataIfc;
|
|
|
|
};
|
|
|
|
} // namespace Buildings
|