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.
244 lines
5.6 KiB
244 lines
5.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
|
||
12 years ago
|
// module tdeabc 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.
|
||
|
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
12 years ago
|
namespace TDEABC
|
||
13 years ago
|
{
|
||
13 years ago
|
//ig typedef TQValueList<TQByteArray> LdapAttrValue;
|
||
12 years ago
|
//ig typedef TQMap<TQString,TDEABC::LdapAttrValue> LdapAttrMap;
|
||
13 years ago
|
|
||
|
class LdapObject
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ldapclient.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
LdapObject ();
|
||
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
LdapObject (const TQString&, TDEABC::LdapClient*);
|
||
13 years ago
|
%End
|
||
|
|
||
12 years ago
|
LdapObject (const TDEABC::LdapObject&);
|
||
13 years ago
|
TQString toString () const;
|
||
13 years ago
|
void clear ();
|
||
13 years ago
|
TQString dn;
|
||
13 years ago
|
//ig LdapAttrMap attrs;
|
||
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
TDEABC::LdapClient* client;
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
protected:
|
||
12 years ago
|
void assign (const TDEABC::LdapObject&);
|
||
13 years ago
|
|
||
|
public:
|
||
|
|
||
|
%If ( - KDE_3_3_0 )
|
||
13 years ago
|
LdapObject (TQString);
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
}; // class LdapObject
|
||
|
|
||
|
|
||
13 years ago
|
class LdapClient : TQObject
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ldapclient.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
LdapClient (TQObject* = 0, const char* = 0);
|
||
13 years ago
|
bool isActive () const;
|
||
|
|
||
|
signals:
|
||
|
void done ();
|
||
13 years ago
|
void error (const TQString&);
|
||
12 years ago
|
void result (const TDEABC::LdapObject&);
|
||
13 years ago
|
|
||
|
public slots:
|
||
13 years ago
|
void setHost (const TQString&);
|
||
|
TQString host () const;
|
||
|
void setPort (const TQString&);
|
||
|
TQString port () const;
|
||
|
void setBase (const TQString&);
|
||
|
TQString base () const;
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
13 years ago
|
void setBindDN (const TQString&);
|
||
|
TQString bindDN () const;
|
||
|
void setPwdBindDN (const TQString&);
|
||
|
TQString pwdBindDN () const;
|
||
13 years ago
|
%End
|
||
|
|
||
13 years ago
|
void setAttrs (const TQStringList&);
|
||
|
TQStringList attrs () const;
|
||
|
void setScope (const TQString);
|
||
|
void startQuery (const TQString&);
|
||
13 years ago
|
void cancelQuery ();
|
||
|
|
||
|
protected slots:
|
||
12 years ago
|
void slotData (TDEIO::Job*, const TQByteArray&);
|
||
|
void slotInfoMessage (TDEIO::Job*, const TQString&);
|
||
13 years ago
|
void slotDone ();
|
||
|
|
||
|
protected:
|
||
|
void startParseLDIF ();
|
||
13 years ago
|
void parseLDIF (const TQByteArray&);
|
||
13 years ago
|
void endParseLDIF ();
|
||
|
|
||
|
}; // class LdapClient
|
||
|
|
||
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
|
|
||
|
class LdapResult
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ldapclient.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQString name;
|
||
|
TQString email;
|
||
13 years ago
|
int clientNumber;
|
||
|
|
||
|
}; // class LdapResult
|
||
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
typedef TQValueList<TDEABC::LdapResult> LdapResultList;
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
13 years ago
|
class LdapSearch : TQObject
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ldapclient.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
LdapSearch ();
|
||
13 years ago
|
void startSearch (const TQString&);
|
||
13 years ago
|
void cancelSearch ();
|
||
|
bool isAvailable () const;
|
||
|
|
||
|
signals:
|
||
13 years ago
|
void searchData (const TQStringList&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_3_0 - )
|
||
12 years ago
|
void searchData (const TDEABC::LdapResultList&);
|
||
13 years ago
|
%End
|
||
|
|
||
|
void searchDone ();
|
||
|
|
||
|
}; // class LdapSearch
|
||
|
|
||
12 years ago
|
}; // namespace TDEABC
|
||
13 years ago
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
|
||
|
%If (KDE_3_3_0 - )
|
||
12 years ago
|
%MappedType TDEABC::LdapResultList
|
||
|
//converts a Python list of TDEABC::LdapREsult
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <ldapclient.h>
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
// Create the list
|
||
|
PyObject *pylist;
|
||
|
if ((pylist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
12 years ago
|
TQValueList<TDEABC::LdapResult> *cpplist = (TQValueList<TDEABC::LdapResult> *)sipCpp;
|
||
13 years ago
|
PyObject *inst;
|
||
|
|
||
|
// Get it.
|
||
12 years ago
|
TQValueList<TDEABC::LdapResult>::Iterator it;
|
||
13 years ago
|
for( it = cpplist->begin(); it != cpplist->end(); ++it )
|
||
|
{
|
||
12 years ago
|
if (((inst = sipConvertFromNewType(new TDEABC::LdapResult(*it), sipType_TDEABC_LdapResult, NULL)) == NULL)
|
||
13 years ago
|
|| PyList_Append (pylist, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (pylist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return pylist;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
12 years ago
|
TQValueList<TDEABC::LdapResult> *cpplist = new TQValueList<TDEABC::LdapResult>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
12 years ago
|
TDEABC::LdapResult *cpp;
|
||
13 years ago
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
12 years ago
|
cpp = (TDEABC::LdapResult *)sipForceConvertToType(elem, sipType_TDEABC_LdapResult, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
|
||
13 years ago
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (*cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
%End
|
||
|
|
||
|
|