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.
241 lines
8.6 KiB
241 lines
8.6 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
|
||
13 years ago
|
// module tdecore 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.
|
||
|
|
||
|
|
||
12 years ago
|
class TDEAccel : TQAccel
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kaccel.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
TDEAccel (TQWidget* /TransferThis/, const char* = 0);
|
||
|
TDEAccel (TQWidget*, TQObject* /TransferThis/, const char* = 0);
|
||
|
TDEAccelActions& actions ();
|
||
13 years ago
|
bool isEnabled ();
|
||
13 years ago
|
void setEnabled (bool);
|
||
|
bool setAutoUpdate (bool);
|
||
|
|
||
|
%If ( KDE_3_1_4 - )
|
||
12 years ago
|
TDEAccelAction* insert (const TQString&, const TQString&, const TQString&, const TDEShortcut&, SIP_RXOBJ_CON, SIP_SLOT_CON (), bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (const TQString&, const TQString&, const TQString&, const TDEShortcut&, const TDEShortcut&, SIP_RXOBJ_CON, SIP_SLOT_CON (), bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (const char*, const TDEShortcut&, SIP_RXOBJ_CON, SIP_SLOT_CON (), bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (TDEStdAccel::StdAccel, SIP_RXOBJ_CON, SIP_SLOT_CON (), bool = 1, bool = 1);
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
bool remove (const TQString&);
|
||
13 years ago
|
bool updateConnections ();
|
||
12 years ago
|
const TDEShortcut& shortcut (const TQString&) const;
|
||
|
bool setShortcut (const TQString&, const TDEShortcut&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_4 - )
|
||
13 years ago
|
bool setSlot (const TQString&, SIP_RXOBJ_CON, SIP_SLOT_CON ());
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
bool setEnabled (const TQString&, bool);
|
||
|
const TQString& configGroup () const;
|
||
|
void setConfigGroup (const TQString&);
|
||
12 years ago
|
bool readSettings (TDEConfigBase* = 0);
|
||
|
bool writeSettings (TDEConfigBase* = 0) const;
|
||
13 years ago
|
void emitKeycodeChanged ();
|
||
|
|
||
|
signals:
|
||
|
void keycodeChanged ();
|
||
|
|
||
|
public:
|
||
13 years ago
|
bool insertItem (const TQString&, const TQString&, const char*, int = 0, TQPopupMenu* = 0, bool = 1);
|
||
|
bool insertItem (const TQString&, const TQString&, int, int, TQPopupMenu*, bool = 1);
|
||
12 years ago
|
bool insertStdItem (TDEStdAccel::StdAccel, const TQString& = TQString ::null );
|
||
13 years ago
|
|
||
|
%If ( KDE_3_1_4 - )
|
||
13 years ago
|
bool connectItem (const TQString&, SIP_RXOBJ_CON, SIP_SLOT_CON (), bool = 1);
|
||
12 years ago
|
bool connectItem (TDEStdAccel::StdAccel, SIP_RXOBJ_CON, SIP_SLOT_CON ());
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
bool removeItem (const TQString&);
|
||
|
bool setItemEnabled (const TQString&, bool);
|
||
|
void changeMenuAccel (TQPopupMenu*, int, const TQString&);
|
||
12 years ago
|
void changeMenuAccel (TQPopupMenu*, int, TDEStdAccel::StdAccel);
|
||
13 years ago
|
static int stringToKey (const TQString&);
|
||
|
int currentKey (const TQString&) const;
|
||
|
TQString findKey (int) const;
|
||
13 years ago
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
public:
|
||
|
|
||
|
%If ( - KDE_3_2_0 )
|
||
|
//ig bool getAutoUpdate ();
|
||
12 years ago
|
//ig TDEAccelAction* insert (const TQString&, const TQString&);
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
%If ( - KDE_3_1_4 )
|
||
12 years ago
|
TDEAccelAction* insert (const TQString&, const TQString&, const TQString&, const TDEShortcut&, const TQObject*, const char*, bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (const TQString&, const TQString&, const TQString&, const TDEShortcut&, const TDEShortcut&, const TQObject*, const char*, bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (const char*, const TDEShortcut&, const TQObject*, const char*, bool = 1, bool = 1);
|
||
|
TDEAccelAction* insert (TDEStdAccel::StdAccel, const TQObject*, const char*, bool = 1, bool = 1);
|
||
13 years ago
|
bool setSlot (const TQString&, const TQObject*, const char*);
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
%If ( - KDE_3_1_4 )
|
||
13 years ago
|
bool connectItem (const TQString&, const TQObject*, const char*, bool = 1);
|
||
12 years ago
|
bool connectItem (TDEStdAccel::StdAccel, const TQObject*, const char*);
|
||
13 years ago
|
|
||
|
//force
|
||
|
%ConvertToSubClassCode
|
||
|
// The table of Python class objects indexed by their names. The table
|
||
|
// must be sorted by name.
|
||
|
|
||
|
static sipStringTypeClassMap map[] = {
|
||
12 years ago
|
{sipName_TDEAccel, &sipClass_TDEAccel},
|
||
12 years ago
|
{sipName_TDEApplication, &sipClass_TDEApplication},
|
||
13 years ago
|
{sipName_KAsyncIO, &sipClass_KAsyncIO},
|
||
|
{sipName_KAudioPlayer, &sipClass_KAudioPlayer},
|
||
12 years ago
|
{sipName_TDEBufferedIO, &sipClass_TDEBufferedIO},
|
||
13 years ago
|
#if TDE_VERSION >= 0x030100
|
||
12 years ago
|
{sipName_TDEClipboardSynchronizer, &sipClass_TDEClipboardSynchronizer},
|
||
13 years ago
|
#endif
|
||
|
{sipName_KCompletion, &sipClass_KCompletion},
|
||
12 years ago
|
{sipName_TDEConfig, &sipClass_TDEConfig},
|
||
|
{sipName_TDEConfigBase, &sipClass_TDEConfigBase},
|
||
|
{sipName_TDEConfigGroup, &sipClass_TDEConfigGroup},
|
||
13 years ago
|
{sipName_KDesktopFile, &sipClass_KDesktopFile},
|
||
12 years ago
|
{sipName_TDEGlobalAccel, &sipClass_TDEGlobalAccel},
|
||
13 years ago
|
{sipName_KLibFactory, &sipClass_KLibFactory},
|
||
|
{sipName_KLibLoader, &sipClass_KLibLoader},
|
||
|
{sipName_KLibrary, &sipClass_KLibrary},
|
||
|
{sipName_KMultipleDrag, &sipClass_KMultipleDrag},
|
||
|
{sipName_KProcIO, &sipClass_KProcIO},
|
||
12 years ago
|
{sipName_TDEProcess, &sipClass_TDEProcess},
|
||
|
{sipName_TDEProcessController, &sipClass_TDEProcessController},
|
||
12 years ago
|
{sipName_TDEServerSocket, &sipClass_TDEServerSocket},
|
||
13 years ago
|
{sipName_KShellProcess, &sipClass_KShellProcess},
|
||
|
{sipName_KSimpleConfig, &sipClass_KSimpleConfig},
|
||
12 years ago
|
{sipName_TDESocket, &sipClass_TDESocket},
|
||
12 years ago
|
{sipName_TDEStartupInfo, &sipClass_TDEStartupInfo},
|
||
13 years ago
|
{sipName_KUniqueApplication, &sipClass_KUniqueApplication},
|
||
|
{sipName_KWinModule, &sipClass_KWinModule},
|
||
|
};
|
||
|
|
||
|
sipClass = sipMapStringToClass(sipCpp -> className(),map,sizeof (map)/sizeof (map[0]));
|
||
|
%End
|
||
|
//end
|
||
|
%End
|
||
|
|
||
|
|
||
12 years ago
|
}; // class TDEAccel
|
||
13 years ago
|
|
||
|
|
||
|
|
||
13 years ago
|
%MappedType TQMap<int,TQString>
|
||
|
//converts a Python dict of int:TQString
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <kaccel.h>
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return PyDict_New();
|
||
|
|
||
|
PyObject *dict;
|
||
|
|
||
|
// Create the dictionary.
|
||
|
|
||
|
if ((dict = PyDict_New()) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
const TQMap<int,TQString> map = *sipCpp;
|
||
|
TQMap<int,TQString>::ConstIterator it;
|
||
13 years ago
|
|
||
|
for (it = map.begin (); it != map.end (); ++it)
|
||
|
{
|
||
|
PyObject *iKey = PyInt_FromLong (((long) it.key ()));
|
||
13 years ago
|
PyObject *sData = PyString_FromString ((char *)((TQString *)&it.data ()));
|
||
13 years ago
|
|
||
|
if ((iKey == NULL) || (sData == NULL) || (PyDict_SetItem (dict, iKey, sData) < 0))
|
||
|
{
|
||
|
Py_XDECREF (iKey);
|
||
|
Py_XDECREF (sData);
|
||
|
Py_DECREF (dict);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return dict;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python dictionary to a KKeyMapOrder on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyDict_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQMap<int,TQString> *map = new TQMap<int,TQString>;
|
||
13 years ago
|
|
||
|
PyObject *key, *value;
|
||
|
SIP_SSIZE_T pos = 0;
|
||
|
int iKey;
|
||
13 years ago
|
TQString *sData;
|
||
13 years ago
|
|
||
|
while (PyDict_Next(sipPy, &pos, &key, &value))
|
||
|
{
|
||
|
int iserr = 0, sData_state;
|
||
|
|
||
|
iKey = PyInt_AS_LONG (key);
|
||
13 years ago
|
sData = (TQString *)sipForceConvertToType(value, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &sData_state, &iserr);
|
||
13 years ago
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete map;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
map->insert (iKey, *sData);
|
||
|
|
||
13 years ago
|
sipReleaseType(sData, sipType_TQString, sData_state);
|
||
13 years ago
|
}
|
||
|
|
||
|
*sipCppPtr = map;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|