You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
211 lines
5.3 KiB
211 lines
5.3 KiB
13 years ago
|
//
|
||
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
||
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
||
|
// may also apply
|
||
|
|
||
|
|
||
|
// Generated by preSip
|
||
12 years ago
|
// module tdeparts version KDE 3.5.3
|
||
13 years ago
|
|
||
|
|
||
|
// This software is free software; you can redistribute it and/or
|
||
|
// modify it under the terms of the GNU General Public License as
|
||
|
// published by the Free Software Foundation; either version 2 of
|
||
|
// the License, or (at your option) any later version.
|
||
|
//
|
||
|
// This software is distributed in the hope that it will be useful,
|
||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
// GNU General Public License for more details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public
|
||
|
// License along with this library; see the file COPYING.
|
||
|
// If not, write to the Free Software Foundation, Inc.,
|
||
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
||
|
namespace KParts
|
||
|
{
|
||
|
|
||
13 years ago
|
class Plugin : TQObject, KXMLGUIClient
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <plugin.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
class PluginInfo
|
||
|
{
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQString m_relXMLFileName;
|
||
|
TQString m_absXMLFileName;
|
||
|
TQDomDocument m_document;
|
||
13 years ago
|
|
||
|
}; // class PluginInfo
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
Plugin (TQObject* /TransferThis/ = 0, const char* = 0);
|
||
|
virtual TQString xmlFile () const;
|
||
|
virtual TQString localXMLFile () const;
|
||
12 years ago
|
static void loadPlugins (TQObject* /Transfer/, const TDEInstance*);
|
||
13 years ago
|
static void loadPlugins (TQObject* /Transfer/, const TQValueList<KParts::Plugin::PluginInfo>&);
|
||
12 years ago
|
static void loadPlugins (TQObject* /Transfer/, const TQValueList<KParts::Plugin::PluginInfo>&, const TDEInstance*);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
12 years ago
|
static void loadPlugins (TQObject* /Transfer/, KXMLGUIClient*, TDEInstance*, bool = 1);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
static TQPtrList<KParts::Plugin> pluginObjects (TQObject* /Transfer/);
|
||
13 years ago
|
|
||
|
protected:
|
||
12 years ago
|
static TQValueList<KParts::Plugin::PluginInfo> pluginInfos (const TDEInstance*);
|
||
13 years ago
|
static KParts::Plugin* loadPlugin (TQObject* /Transfer/, const char*);
|
||
12 years ago
|
virtual void setInstance (TDEInstance*);
|
||
13 years ago
|
|
||
|
}; // class Plugin
|
||
|
|
||
|
}; // namespace KParts
|
||
|
|
||
|
|
||
|
|
||
13 years ago
|
%MappedType TQValueList<KParts::Plugin::PluginInfo>
|
||
13 years ago
|
//converts a Python list of KParts.Plugin.PluginInfo
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqvaluelist.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
// Create the list
|
||
|
PyObject *pylist;
|
||
|
if ((pylist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
13 years ago
|
TQValueList<KParts::Plugin::PluginInfo> *cpplist = (TQValueList<KParts::Plugin::PluginInfo> *)sipCpp;
|
||
13 years ago
|
PyObject *inst;
|
||
|
|
||
|
// Get it.
|
||
13 years ago
|
TQValueList<KParts::Plugin::PluginInfo>::Iterator it;
|
||
13 years ago
|
for( it = cpplist->begin(); it != cpplist->end(); ++it )
|
||
|
{
|
||
|
if (((inst = sipConvertFromNewType(new KParts::Plugin::PluginInfo(*it), sipType_KParts_Plugin_PluginInfo, NULL)) == NULL)
|
||
|
|| PyList_Append (pylist, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (pylist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return pylist;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQValueList<KParts::Plugin::PluginInfo> *cpplist = new TQValueList<KParts::Plugin::PluginInfo>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
|
KParts::Plugin::PluginInfo *cpp;
|
||
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
cpp = (KParts::Plugin::PluginInfo *)sipForceConvertToType(elem, sipType_KParts_Plugin_PluginInfo, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (*cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
%MappedType TQPtrList<KParts::Plugin>
|
||
13 years ago
|
//converts a Python list of KParts.Plugin
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqptrlist.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
if (!sipCpp)
|
||
|
return PyList_New (0);
|
||
|
|
||
|
PyObject *pylist;
|
||
|
|
||
|
// Create the list
|
||
|
|
||
|
if ((pylist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
TQPtrList<KParts::Plugin> *cpplist = (TQPtrList<KParts::Plugin> *)sipCpp;
|
||
13 years ago
|
KParts::Plugin *cpp;
|
||
|
PyObject *inst;
|
||
|
|
||
|
// the loop depends on the type of iterator the tmeplate makes available
|
||
|
for(cpp = cpplist->first (); cpp != 0; cpp = cpplist->next () )
|
||
|
{
|
||
|
if (((inst = sipConvertFromInstance (cpp, sipClass_KParts_Plugin, sipTransferObj)) == NULL)
|
||
|
|| PyList_Append (pylist, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (pylist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return pylist;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQPtrList<KParts::Plugin> *cpplist = new TQPtrList<KParts::Plugin>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
|
KParts::Plugin *cpp;
|
||
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
cpp = (KParts::Plugin *)sipForceConvertToType(elem, sipType_KParts_Plugin, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|