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.
288 lines
7.5 KiB
288 lines
7.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 KService : KSycocaEntry
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kservice.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
//ig typedef TDESharedPtr<KService> Ptr;
|
||
13 years ago
|
//ig typedef TQValueList<KService::Ptr> List;
|
||
13 years ago
|
|
||
|
public:
|
||
13 years ago
|
KService (const TQString&, const TQString&, const TQString&);
|
||
|
KService (const TQString&);
|
||
13 years ago
|
KService (KDesktopFile*);
|
||
13 years ago
|
KService (TQDataStream&, int);
|
||
|
virtual TQString type () /PyName=type_/;
|
||
|
virtual TQString name () const;
|
||
|
TQString exec () /PyName=exec_/;
|
||
|
TQString library () const;
|
||
|
TQString init () const;
|
||
|
TQString icon () const;
|
||
12 years ago
|
TQPixmap pixmap (TDEIcon::Group, int = 0, int = 0, TQString* = 0) const;
|
||
13 years ago
|
bool terminal () const;
|
||
13 years ago
|
TQString terminalOptions () const;
|
||
13 years ago
|
bool substituteUid () const;
|
||
13 years ago
|
TQString username () const;
|
||
|
TQString desktopEntryPath () const;
|
||
|
TQString desktopEntryName () const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
TQString menuId () const;
|
||
|
TQString storageId () const;
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
enum DCOPServiceType_t
|
||
|
{
|
||
|
DCOP_None,
|
||
|
DCOP_Unique,
|
||
|
DCOP_Multi,
|
||
|
DCOP_Wait
|
||
|
};
|
||
|
|
||
|
DCOPServiceType_t DCOPServiceType () const;
|
||
13 years ago
|
TQString path () const;
|
||
|
TQString comment () const;
|
||
|
TQString genericName () const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
TQString untranslatedGenericName () const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
TQStringList keywords () const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
13 years ago
|
TQStringList categories () const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
TQStringList serviceTypes () const;
|
||
|
bool hasServiceType (const TQString&) const;
|
||
13 years ago
|
bool allowAsDefault () const;
|
||
|
bool allowMultipleFiles () const;
|
||
|
int initialPreference () const;
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
int initialPreferenceForMimeType (const TQString&) const;
|
||
13 years ago
|
%End
|
||
|
|
||
|
void setInitialPreference (int);
|
||
|
bool noDisplay () const;
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
13 years ago
|
TQString parentApp () const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
virtual TQVariant property (const TQString&) const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
TQVariant property (const TQString&, TQVariant::Type) const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
virtual TQStringList propertyNames () const;
|
||
13 years ago
|
bool isValid () const;
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
TQString locateLocal ();
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
virtual void load (TQDataStream&);
|
||
|
virtual void save (TQDataStream&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void setMenuId (const TQString&);
|
||
13 years ago
|
void setTerminal (bool);
|
||
13 years ago
|
void setTerminalOptions (const TQString&);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
static KService::Ptr serviceByName (const TQString&);
|
||
|
static KService::Ptr serviceByDesktopPath (const TQString&);
|
||
|
static KService::Ptr serviceByDesktopName (const TQString&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
static KService::Ptr serviceByMenuId (const TQString&);
|
||
|
static KService::Ptr serviceByStorageId (const TQString&);
|
||
13 years ago
|
%End
|
||
|
|
||
|
static KService::List allServices ();
|
||
|
static KService::List allInitServices ();
|
||
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
static TQString newServicePath (bool, const TQString&, TQString* = 0, const TQStringList* = 0);
|
||
|
static void rebuildKSycoca (TQWidget* /Transfer/);
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
protected:
|
||
|
void init (KDesktopFile*);
|
||
13 years ago
|
TQStringList& accessServiceTypes ();
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_1 - )
|
||
|
|
||
|
private:
|
||
|
KService (const KService&);
|
||
|
%End
|
||
|
|
||
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
}; // class KService
|
||
|
|
||
|
|
||
|
|
||
|
%MappedType KService::Ptr
|
||
|
//converts KService
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ksharedptr.h>
|
||
|
#include <kservice.h>
|
||
12 years ago
|
//typedef TDESharedPtr<KService> SvcPtr;
|
||
13 years ago
|
//typedef KService::Ptr SvcPtr;
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python instance
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return NULL;
|
||
|
|
||
12 years ago
|
TDESharedPtr<KService> *cPtr = new TDESharedPtr<KService> (*(TDESharedPtr<KService> *)sipCpp);
|
||
13 years ago
|
KService *cpp = cPtr->data ();
|
||
|
PyObject *obj = sipConvertFromInstance (cpp, sipClass_KService, sipTransferObj);
|
||
|
|
||
|
return obj;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python instance to a Ptr on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return sipCanConvertToType(sipPy, sipType_KService, SIP_NO_CONVERTORS);
|
||
|
|
||
|
int iserr = 0;
|
||
|
KService *cpp = (KService *)sipConvertToType(sipPy, sipType_KService, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
12 years ago
|
*sipCppPtr = new TDESharedPtr<KService> (cpp);
|
||
13 years ago
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|
||
|
%MappedType KService::List
|
||
|
//converts a Python list of KService
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqvaluelist.h>
|
||
13 years ago
|
#include <kservice.h>
|
||
12 years ago
|
//typedef TDESharedPtr<KService> Ptr;
|
||
13 years ago
|
//typedef TQValueList<Ptr> SvcList;
|
||
13 years ago
|
//typedef KService::List SvcList;
|
||
13 years ago
|
typedef TQValueList<KService::Ptr> List;
|
||
13 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python list of Ptr (KService).
|
||
13 years ago
|
#define QUOTE ""
|
||
13 years ago
|
if (!sipCpp)
|
||
|
return PyList_New (0);
|
||
|
|
||
|
PyObject *plist;
|
||
|
|
||
|
// Create the list
|
||
|
if ((plist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
KService::List *cList = (KService::List *)sipCpp;
|
||
|
PyObject *inst;
|
||
12 years ago
|
TDESharedPtr<KService> *svc;
|
||
13 years ago
|
|
||
|
KService::List::Iterator it;
|
||
|
for( it = cList->begin(); it != cList->end(); ++it )
|
||
|
{
|
||
12 years ago
|
TDESharedPtr <KService> svcptr = static_cast<KService::Ptr>(*it);
|
||
13 years ago
|
svc = &svcptr;
|
||
13 years ago
|
inst = sipConvertFromType(svc, sipType_KService_Ptr, sipTransferObj);
|
||
|
|
||
|
if ((inst == NULL) || (PyList_Append (plist, inst) < 0))
|
||
|
{
|
||
|
Py_XDECREF (inst);
|
||
|
Py_DECREF (plist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return plist;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python list to List on the heap.
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
|
KService::List *cList = new KService::List;
|
||
|
|
||
|
PyObject *elem;
|
||
|
KService *service;
|
||
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
service = (KService *)sipForceConvertToType(elem, sipType_KService, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cList;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
KService::Ptr ptr(service);
|
||
|
|
||
|
cList->append (ptr);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cList;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|