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.
173 lines
4.5 KiB
173 lines
4.5 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 tdeio 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.
|
||
|
|
||
|
|
||
|
class KDataToolInfo
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kdatatool.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
KDataToolInfo ();
|
||
12 years ago
|
KDataToolInfo (const KService::Ptr&, TDEInstance*);
|
||
13 years ago
|
KDataToolInfo (const KDataToolInfo&);
|
||
13 years ago
|
TQString dataType () const;
|
||
|
TQStringList mimeTypes () const;
|
||
13 years ago
|
bool isReadOnly () const;
|
||
13 years ago
|
TQPixmap icon () const;
|
||
|
TQPixmap miniIcon () const;
|
||
|
TQString iconName () const;
|
||
|
TQStringList userCommands () const;
|
||
|
TQStringList commands () const;
|
||
|
KDataTool* createTool (TQObject* /Transfer/ = 0, const char* = 0) const;
|
||
13 years ago
|
KService::Ptr service () const;
|
||
12 years ago
|
TDEInstance* instance () const;
|
||
13 years ago
|
bool isValid () const;
|
||
12 years ago
|
static TQValueList<KDataToolInfo> query (const TQString&, const TQString&, TDEInstance*);
|
||
13 years ago
|
|
||
|
}; // class KDataToolInfo
|
||
|
|
||
|
|
||
12 years ago
|
class KDataToolAction : TDEAction
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kdatatool.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
KDataToolAction (const TQString&, const KDataToolInfo&, const TQString&, TQObject* /TransferThis/ = 0, const char* = 0);
|
||
12 years ago
|
static TQPtrList<TDEAction> dataToolActionList (const TQValueList<KDataToolInfo>&, const TQObject*, const char*);
|
||
13 years ago
|
|
||
|
signals:
|
||
13 years ago
|
void toolActivated (const KDataToolInfo&, const TQString&);
|
||
13 years ago
|
|
||
|
protected:
|
||
|
virtual void slotActivated ();
|
||
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
}; // class KDataToolAction
|
||
|
|
||
|
|
||
13 years ago
|
class KDataTool : TQObject
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kdatatool.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
KDataTool (TQObject* /TransferThis/ = 0, const char* = 0);
|
||
12 years ago
|
void setInstance (TDEInstance*);
|
||
|
TDEInstance* instance () const;
|
||
13 years ago
|
virtual bool run (const TQString&, void*, const TQString&, const TQString&) = 0;
|
||
13 years ago
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
}; // class KDataTool
|
||
|
|
||
|
|
||
|
|
||
13 years ago
|
%MappedType TQValueList<KDataToolInfo>
|
||
13 years ago
|
//converts a Python list of KDataToolInfo
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kdatatool.h>
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python list of KDataToolInfo
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
PyObject *dtiList;
|
||
|
|
||
|
// Create the list
|
||
|
|
||
|
if ((dtiList = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
TQValueList<KDataToolInfo> *dlist = (TQValueList<KDataToolInfo> *)sipCpp;
|
||
13 years ago
|
PyObject *inst;
|
||
|
|
||
|
|
||
13 years ago
|
TQValueList<KDataToolInfo>::Iterator it;
|
||
13 years ago
|
for( it = dlist->begin(); it != dlist->end(); ++it )
|
||
|
{
|
||
|
if ((inst = sipConvertFromNewType(new KDataToolInfo(*it), sipType_KDataToolInfo, NULL)) == NULL
|
||
|
|| PyList_Append (dtiList, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (dtiList);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return dtiList;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python list to a KDataToolInfoVList on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQValueList<KDataToolInfo> *dList = new TQValueList<KDataToolInfo>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
|
KDataToolInfo *d;
|
||
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
d = (KDataToolInfo *)sipForceConvertToType(elem, sipType_KDataToolInfo, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete dList;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
dList->append (*d);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = dList;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|