00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Tim Sutton * 00003 * tim@linfiniti.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #include <omglistwidget.h> 00021 #include "omgdesignerplugin.h" 00022 00023 #include <QtDesigner/QExtensionManager> 00024 #include <QtDesigner/QDesignerFormEditorInterface> 00025 00026 #include <QIcon> 00027 #include <QtPlugin> 00028 00029 OmgDesignerPlugin::OmgDesignerPlugin(QObject *parent) 00030 :QObject(parent) 00031 { 00032 initialized = false; 00033 } 00034 00035 QString OmgDesignerPlugin::name() const 00036 { 00037 return QString("OmgListWidget"); 00038 } 00039 00040 QString OmgDesignerPlugin::group() const 00041 { 00042 return QString("openModeller GUI [omgui]"); 00043 } 00044 00045 QString OmgDesignerPlugin::toolTip() const 00046 { 00047 return ""; 00048 } 00049 00050 QString OmgDesignerPlugin::whatsThis() const 00051 { 00052 return ""; 00053 } 00054 00055 QString OmgDesignerPlugin::includeFile() const 00056 { 00057 return QString("omglistwidget.h"); 00058 } 00059 00060 QIcon OmgDesignerPlugin::icon() const 00061 { 00062 return QIcon(); 00063 } 00064 00065 bool OmgDesignerPlugin::isContainer() const 00066 { 00067 return false; 00068 } 00069 00070 QWidget *OmgDesignerPlugin::createWidget(QWidget *parent) 00071 { 00072 OmgListWidget * mypListWidget = new OmgListWidget(parent); 00073 return mypListWidget; 00074 } 00075 00076 bool OmgDesignerPlugin::isInitialized() const 00077 { 00078 return initialized; 00079 } 00080 00081 void OmgDesignerPlugin::initialize(QDesignerFormEditorInterface *formEditor) 00082 { 00083 if (initialized) 00084 return; 00085 /* 00086 QExtensionManager *manager = formEditor->extensionManager(); 00087 Q_ASSERT(manager != 0); 00088 00089 manager->registerExtensions(new OmgDesignerTaskMenuFactory(manager), 00090 Q_TYPEID(QDesignerTaskMenuExtension)); 00091 */ 00092 initialized = true; 00093 } 00094 00095 Q_EXPORT_PLUGIN2(omgdesignerplugin, OmgDesignerPlugin)