diff --git a/qa_interfaces/ITestPlugin.h b/qa_interfaces/ITestPlugin.h new file mode 100644 index 00000000..d529cca3 --- /dev/null +++ b/qa_interfaces/ITestPlugin.h @@ -0,0 +1,58 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "Module.h" + +namespace Thunder { +namespace QualityAssurance { + + // @json 1.0.0 + struct EXTERNAL ITestPlugin : virtual public Core::IUnknown { + enum { ID = ID_TESTPLUGIN }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_TESTPLUGIN_NOTIFICATION }; + ~INotification() override = default; + + // @brief Signals that a greeting was generated + // @param message The greeting message + virtual void OnGreeting(const string& message) = 0; + }; + + ~ITestPlugin() override = default; + + virtual Core::hresult Register(ITestPlugin::INotification* notification) = 0; + virtual Core::hresult Unregister(ITestPlugin::INotification* notification) = 0; + + // @brief Returns the input string unchanged + // @param input The input string to echo back + // @param output The echoed output string + virtual Core::hresult Echo(const string& input, string& output /* @out */) = 0; + + // @brief Returns a greeting message + // @param name The name to greet (empty defaults to "World") + // @param message The greeting message + virtual Core::hresult Greet(const string& name, string& message /* @out */) = 0; + }; + +} // namespace QualityAssurance +} // namespace Thunder diff --git a/qa_interfaces/QAIds.h b/qa_interfaces/QAIds.h index 08173dc0..5f17cd3a 100644 --- a/qa_interfaces/QAIds.h +++ b/qa_interfaces/QAIds.h @@ -74,8 +74,10 @@ namespace QualityAssurance { ID_TESTKEEP = ID_TESTTEXTOPTIONS + 4, ID_TESTKEEP_NOTIFICATION = ID_TESTTEXTOPTIONS + 5, ID_TESTCUSTOM = ID_TESTTEXTOPTIONS + 6, - ID_TESTCUSTOM_NOTIFICATION = ID_TESTTEXTOPTIONS + 7 + ID_TESTCUSTOM_NOTIFICATION = ID_TESTTEXTOPTIONS + 7, + ID_TESTPLUGIN = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x060, + ID_TESTPLUGIN_NOTIFICATION = ID_TESTPLUGIN + 1 }; } }