#include #include "defaultplugin.h" /** * Default constructor of the DefaultPlugin class. * * This constructor should be called just one time, by Qt mechanisms * (not manually). * */ DefaultPlugin::DefaultPlugin(): QObject() { } /** * DefaultPlugin destructor. * * This destructor, just like the constructor, is not called manually. * */ DefaultPlugin::~DefaultPlugin() { } /** * Gets the name of the Interface (ie. the public name of the plugin). * * @return The name of the Interface (ie. the public name of the plugin). * */ QString DefaultPlugin::name() const { return QString (tr("Default Plugin")); } /** * Gets the list of the projectors implemented by the DefaultPlugin. * * @return The list of the projectors implemented by the DefaultPlugin. * */ QStringList DefaultPlugin::projectors() const { return QStringList(DefaultPluginData::g_projector_name); } /** * Gets a new ProjectorWidget for a projector. * * @remark The responsability is transfered to the user, especially the * responsability to delete the widget at the end of use. * * @param projector The name of a projector, from the projectors()-list. * * @return A pointer on the ProjectorWidget. * */ ProjectorWidget* DefaultPlugin::newProjectorWidget(const QString& projector) { if (projector!=DefaultPluginData::g_projector_name) return NULL; return new DefaultProjectorWidget(this); } /** * Gets a new ProjectorData for a projector. * * @remark The responsability is transfered to the user, especially the * responsability to delete the data at the end of use. * * @param projector The name of a projector, from the projectors()-list. * * @return A pointer on the ProjectorData. * */ ProjectorData *DefaultPlugin::newProjectorData(const QString& projector) { if (projector!=DefaultPluginData::g_projector_name) { return NULL; } return new DefaultPluginData(this); } /** * Gets the list of the scenes implemented by the DefaultPlugin. * * @return The list of the scenes implemented by the DefaultPlugin. * */ QStringList DefaultPlugin::scenes() const { return QStringList() << DefaultEmptySceneContent::g_scene_name << DefaultTeapotSceneContent::g_scene_name << DefaultCubemapSceneContent::g_scene_name << DefaultModelSceneContent::g_scene_name; } /** * Gets a new SceneWidget for a scene. * * @remark The responsability is transfered to the user, especially the * responsability to delete the widget at the end of use. * * @param scene_name The name of a scene, from the scenes()-list. * * @return A pointer on the SceneWidget. * */ SceneContent* DefaultPlugin::newSceneContent(const QString& scene_name) { if (scene_name==DefaultEmptySceneContent::g_scene_name) return new DefaultEmptySceneContent(this); else if (scene_name==DefaultTeapotSceneContent::g_scene_name) return new DefaultTeapotSceneContent(this); else if (scene_name==DefaultCubemapSceneContent::g_scene_name) return new DefaultCubemapSceneContent(this); else if (scene_name==DefaultModelSceneContent::g_scene_name) return new DefaultModelSceneContent(this); else return NULL; } /** * Gets a new SceneContent for a scene. * * @remark The responsability is transfered to the user, especially the * responsability to delete the content at the end of use. * * @param scene The name of a scene, from the scenes()-list. * * @return A pointer on the SceneContent. * */ SceneWidget* DefaultPlugin::newSceneWidget(const QString& scene_name) { if (scene_name==DefaultEmptySceneContent::g_scene_name) return new DefaultEmptySceneWidget(this); else if (scene_name==DefaultTeapotSceneContent::g_scene_name) return new DefaultTeapotSceneWidget(this); else if (scene_name==DefaultCubemapSceneContent::g_scene_name) return new DefaultCubemapSceneWidget(this); else if (scene_name==DefaultModelSceneContent::g_scene_name) return new DefaultModelSceneWidget(this); else return NULL; } Q_EXPORT_PLUGIN2(projdesigner_default, DefaultPlugin)