ImagingTools Core SDK
CCommandsControllerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ImtCore includes
6#include <imtserverapp/IGuiElementContainer.h>
7#include <GeneratedFiles/imtbasesdl/SDL/1.0/CPP/Commands.h>
8
9
10namespace imtservergql
11{
12
13
14class CCommandsControllerComp: public sdl::imtbase::Commands::CGraphQlHandlerCompBase
15{
16public:
17 typedef sdl::imtbase::Commands::CGraphQlHandlerCompBase BaseClass;
18
19 I_BEGIN_COMPONENT(CCommandsControllerComp);
20 I_ASSIGN(m_guiElementContainerCompPtr, "GuiElementContainer", "GUI element container", true, "GuiElementContainer");
21 I_ASSIGN(m_typeIdAttrPtr, "TypeId", "Type-ID", true, "");
22 I_END_COMPONENT;
23
24protected:
25 // reimplemented (sdl::imtbase::Commands::CGraphQlHandlerCompBase)
26 virtual bool IsRequestSupported(const imtgql::CGqlRequest& gqlRequest) const override;
27 virtual sdl::imtbase::Commands::CGuiElementContainer OnGetCommands(
28 const sdl::imtbase::Commands::CGetCommandsGqlRequest& getCommandsRequest,
29 const ::imtgql::CGqlRequest& gqlRequest,
30 QString& errorMessage) const override;
31 virtual bool CheckPermissions(const imtgql::CGqlRequest& gqlRequest, QString& errorMessage) const override;
32
33private:
34 bool GetRepresentationFromGuiElementContainer(
35 const imtserverapp::IGuiElementContainer& guiElementContainer,
36 sdl::imtbase::Commands::CGuiElementContainer::V1_0& representation,
37 const QByteArray& languageId,
38 const imtauth::IUserInfo* userInfoPtr) const;
39 bool GetRepresentationFromGuiElement(
40 const imtserverapp::IGuiElementModel& guiElementModel,
41 sdl::imtbase::Commands::CGuiElementModel::V1_0& representation,
42 const QByteArray& languageId) const;
43 QString TranslateName(const QString& name, const QString& context, const QByteArray& languageId) const;
44
45protected:
46 I_REF(imtserverapp::IGuiElementContainer, m_guiElementContainerCompPtr);
47 I_ATTR(QByteArray, m_typeIdAttrPtr);
48};
49
50
51} // namespace imtservergql
52
53