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
4.9 KiB
211 lines
4.9 KiB
14 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
|
||
14 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
|
namespace TDEIO
|
||
14 years ago
|
{
|
||
|
|
||
|
class AuthInfo
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <authinfo.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
AuthInfo ();
|
||
12 years ago
|
AuthInfo (const TDEIO::AuthInfo&);
|
||
14 years ago
|
bool isModified () const;
|
||
|
void setModified (bool);
|
||
|
KURL url;
|
||
13 years ago
|
TQString username;
|
||
|
TQString password;
|
||
|
TQString prompt;
|
||
|
TQString caption;
|
||
|
TQString comment;
|
||
|
TQString commentLabel;
|
||
|
TQString realmValue;
|
||
|
TQString digestInfo;
|
||
14 years ago
|
bool verifyPath;
|
||
|
bool readOnly;
|
||
|
bool keepPassword;
|
||
|
|
||
|
protected:
|
||
|
|
||
|
}; // class AuthInfo
|
||
|
|
||
|
|
||
|
%If ( KDE_3_1_4 - )
|
||
12 years ago
|
//igx TQDataStream& operator << (TQDataStream&, const TDEIO::AuthInfo&);
|
||
|
//igx TQDataStream& operator >> (TQDataStream&, TDEIO::AuthInfo&);
|
||
14 years ago
|
%End
|
||
|
|
||
|
|
||
|
class NetRC
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <authinfo.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
enum LookUpMode
|
||
|
{
|
||
|
exactOnly,
|
||
|
defaultOnly,
|
||
|
presetOnly
|
||
|
};
|
||
|
|
||
|
|
||
|
class AutoLogin
|
||
|
{
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQString type;
|
||
|
TQString machine;
|
||
|
TQString login;
|
||
|
TQString password;
|
||
14 years ago
|
KStringListMap macdef;
|
||
|
|
||
|
}; // class AutoLogin
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
static TDEIO::NetRC* self ();
|
||
|
bool lookup (const KURL&, TDEIO::NetRC::AutoLogin&, bool = 0, TQString = TQString ::null , int = 6);
|
||
14 years ago
|
void reload ();
|
||
|
|
||
|
protected:
|
||
13 years ago
|
//ig TQString extract (const char*, const char*, int&);
|
||
|
int openf (const TQString&);
|
||
14 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
|
bool parse (int);
|
||
|
%End
|
||
|
|
||
|
|
||
|
private:
|
||
|
NetRC ();
|
||
|
~NetRC ();
|
||
|
|
||
|
protected:
|
||
|
|
||
|
%If ( - KDE_3_2_0 )
|
||
|
void parse (int);
|
||
|
%End
|
||
|
|
||
|
|
||
|
}; // class NetRC
|
||
|
|
||
12 years ago
|
}; // namespace TDEIO
|
||
14 years ago
|
|
||
|
|
||
|
|
||
|
%MappedType KStringListMap
|
||
|
{
|
||
13 years ago
|
//converts a Python dict of TQString:TQStringList
|
||
14 years ago
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqmap.h>
|
||
13 years ago
|
typedef TQMap<TQString, TQStringList> KStringListMap;
|
||
14 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python dict.
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return PyDict_New();
|
||
|
|
||
|
PyObject *dict;
|
||
|
|
||
|
// Create the dictionary.
|
||
|
|
||
|
if ((dict = PyDict_New()) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
const TQMap<TQString, TQStringList> map = *sipCpp;
|
||
|
TQMap<TQString, TQStringList>::ConstIterator it;
|
||
14 years ago
|
|
||
|
for (it = map.begin (); it != map.end (); ++it)
|
||
|
{
|
||
13 years ago
|
PyObject *sKey = PyString_FromString ((const char *)((TQString)it.key ()));
|
||
13 years ago
|
PyObject *sData = sipConvertFromInstance ((void *)&it.data (), sipClass_TQStringList, sipTransferObj);
|
||
14 years ago
|
|
||
|
if ((sKey == NULL) || (sData == NULL) || (PyDict_SetItem (dict, sKey, sData) < 0))
|
||
|
{
|
||
|
Py_XDECREF (sKey);
|
||
|
Py_XDECREF (sData);
|
||
|
Py_DECREF (dict);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return dict;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyDict_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQMap<TQString, TQStringList> *map = new TQMap<TQString, TQStringList>;
|
||
14 years ago
|
|
||
|
PyObject *key, *value;
|
||
|
SIP_SSIZE_T pos = 0;
|
||
13 years ago
|
TQString *sKey;
|
||
|
TQStringList *sData;
|
||
14 years ago
|
|
||
|
while (PyDict_Next(sipPy, &pos, &key, &value))
|
||
|
{
|
||
|
int iserr = 0, sKey_state, sData_state;
|
||
|
|
||
13 years ago
|
sKey = (TQString *)sipForceConvertToType(key, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &sKey_state, &iserr);
|
||
|
sData = (TQStringList *)sipForceConvertToType(value, sipType_TQStringList, sipTransferObj, SIP_NOT_NONE, &sData_state, &iserr);
|
||
14 years ago
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
if (sKey)
|
||
13 years ago
|
sipReleaseType(sKey, sipType_TQString, sKey_state);
|
||
14 years ago
|
|
||
|
*sipIsErr = 1;
|
||
|
delete map;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
map->insert (*sKey, *sData);
|
||
|
|
||
13 years ago
|
sipReleaseType(sKey, sipType_TQString, sKey_state);
|
||
|
sipReleaseType(sData, sipType_TQStringList, sData_state);
|
||
14 years ago
|
}
|
||
|
|
||
|
*sipCppPtr = map;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|