You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Code/Editor/QtViewPane.h

110 lines
2.3 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#ifndef CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H
#define CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H
#pragma once
#include "IEditor.h"
#include "Include/IEditorClassFactory.h"
#include "Include/ObjectEvent.h"
#include "Objects/ClassDesc.h"
#include <QRect>
#include <QWidget>
namespace Serialization {
class IArchive;
}
using Serialization::IArchive;
// ---------------------------------------------------------------------------
template<class TObject>
class CTemplateObjectClassDesc
: public CObjectClassDesc
{
public:
const char* m_className;
const char* m_category;
const char* m_textureIcon;
ObjectType m_objectType;
int m_order;
const char* m_fileSpec;
const char* m_toolClassName;
CTemplateObjectClassDesc(const char* className, const char* category, const char* textureIcon, ObjectType objectType, int order = 100, const char* fileSpec = "", const char* toolClassName = nullptr)
: m_className(className)
, m_category(category)
, m_textureIcon(textureIcon)
, m_objectType(objectType)
, m_order(order)
, m_fileSpec(fileSpec)
, m_toolClassName(toolClassName)
{
}
REFGUID ClassID() override
{
return TObject::GetClassID();
}
QString GetFileSpec() override
{
return m_fileSpec;
}
ESystemClassID SystemClassID() override
{
return ESYSTEM_CLASS_OBJECT;
};
ObjectType GetObjectType() override
{
return m_objectType;
}
QString ClassName() override
{
return m_className;
}
QString Category() override
{
return m_category;
}
QString GetTextureIcon() override
{
return m_textureIcon;
}
QObject* CreateQObject() const override
{
return new TObject;
}
int GameCreationOrder() override
{
return m_order;
};
bool IsEnabled() const override
{
return TObject::IsEnabled();
}
QString GetToolClassName() override
{
return m_toolClassName ? m_toolClassName : CObjectClassDesc::GetToolClassName();
}
};
#endif // CRYINCLUDE_EDITORCOMMON_QTVIEWPANE_H