refs #195, base class for runtime aware GUI widgets

This commit is contained in:
Klaus Basan
2014-04-26 16:04:07 +02:00
parent 51e4cefa94
commit 1644890938
2 changed files with 148 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
#include "runtimebasedcomponent.h"
namespace BlackGui
{
const BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() const
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextApplication();
}
BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication()
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextApplication();
}
BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio()
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextAudio();
}
const BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() const
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextAudio();
}
void CRuntimeBasedComponent::createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent)
{
this->m_runtime = new BlackCore::CRuntime(config, parent);
this->m_runtimeOwner = true;
}
BlackCore::IContextNetwork *CRuntimeBasedComponent::getIContextNetwork()
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextNetwork();
}
const BlackCore::IContextNetwork *CRuntimeBasedComponent::getIContextNetwork() const
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextNetwork();
}
BlackCore::IContextSettings *CRuntimeBasedComponent::getIContextSettings()
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextSettings();
}
const BlackCore::IContextSettings *CRuntimeBasedComponent::getIContextSettings() const
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextSettings();
}
const BlackCore::IContextSimulator *CRuntimeBasedComponent::getIContextSimulator() const
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextSimulator();
}
BlackCore::IContextSimulator *CRuntimeBasedComponent::getIContextSimulator()
{
if (!this->m_runtime) return nullptr;
return this->m_runtime->getIContextSimulator();
}
}