• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KLDAP Library

  • kldap
ldapoperation.h
1 /*
2  This file is part of libkldap.
3  Copyright (c) 2004-2006 Szombathelyi György <gyurco@freemail.hu>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KLDAP_LDAPOPERATION_H
22 #define KLDAP_LDAPOPERATION_H
23 
24 #include "kldap_export.h"
25 #include "ldapconnection.h"
26 #include "ldapcontrol.h"
27 #include "ldapobject.h"
28 #include "ldapdn.h"
29 #include "ldapserver.h"
30 #include "ldapurl.h"
31 
32 #include <QtCore/QByteArray>
33 #include <QtCore/QList>
34 #include <QtCore/QString>
35 
36 namespace KLDAP {
37 
43 class KLDAP_EXPORT LdapOperation
44 {
45  public:
46  typedef enum {
47  Mod_None, Mod_Add, Mod_Replace, Mod_Del
48  } ModType;
49 
50  typedef enum {
51  RES_BIND = 0x61,
52  RES_SEARCH_ENTRY = 0x64,
53  RES_SEARCH_REFERENCE = 0x73,
54  RES_SEARCH_RESULT = 0x65,
55  RES_MODIFY = 0x67,
56  RES_ADD = 0x69,
57  RES_DELETE = 0x69,
58  RES_MODDN = 0x6d,
59  RES_COMPARE = 0x6f,
60  RES_EXTENDED = 0x78,
61  RES_EXTENDED_PARTIAL = 0x79
62  } ResultType;
63 
64  typedef struct {
65  ModType type;
66  QString attr;
67  QList<QByteArray> values;
68  } ModOp ;
69 
70  typedef QList<ModOp> ModOps;
71 
72  enum SASL_Fields {
73  SASL_Authname = 0x1,
74  SASL_Authzid = 0x2,
75  SASL_Realm = 0x4,
76  SASL_Password = 0x8
77  };
78 
79  struct SASL_Credentials {
80  int fields;
81  QString authname;
82  QString authzid;
83  QString realm;
84  QString password;
85  };
86 
87  typedef int (SASL_Callback_Proc) ( SASL_Credentials &cred, void *data );
88 
89  struct SASL_Data {
90  SASL_Callback_Proc *proc;
91  void *data;
92  SASL_Credentials creds;
93  };
94 
95  LdapOperation();
96  LdapOperation( LdapConnection &conn );
97  virtual ~LdapOperation();
98 
103  void setConnection( LdapConnection &conn );
107  LdapConnection &connection();
111  void setClientControls( const LdapControls &ctrls );
115  void setServerControls( const LdapControls &ctrls );
119  LdapControls clientControls() const;
123  LdapControls serverControls() const;
124 
129  int bind( const QByteArray &creds = QByteArray(),
130  SASL_Callback_Proc *saslproc = NULL, void *data = NULL );
131 
137  int bind_s( SASL_Callback_Proc *saslproc = NULL, void *data = NULL );
138 
143  int search( const LdapDN &base, LdapUrl::Scope scope,
144  const QString &filter, const QStringList &attrs );
149  int add( const LdapObject &object );
154  int add_s( const LdapObject &object );
159  int add( const LdapDN &dn, const ModOps &ops );
165  int add_s( const LdapDN &dn, const ModOps &ops );
172  int rename( const LdapDN &dn, const QString &newRdn,
173  const QString &newSuperior, bool deleteold = true );
180  int rename_s( const LdapDN &dn, const QString &newRdn,
181  const QString &newSuperior, bool deleteold = true );
186  int del( const LdapDN &dn );
191  int del_s( const LdapDN &dn );
196  int modify( const LdapDN &dn, const ModOps &ops );
202  int modify_s( const LdapDN &dn, const ModOps &ops );
208  int compare( const LdapDN &dn, const QString &attr, const QByteArray &value );
216  int compare_s( const LdapDN &dn, const QString &attr, const QByteArray &value );
221  int exop( const QString &oid, const QByteArray &data );
227  int exop_s( const QString &oid, const QByteArray &data );
231  int abandon( int id );
244  int waitForResult( int id, int msecs = -1 );
248  LdapObject object() const;
253  LdapControls controls() const;
258  QByteArray extendedOid() const;
263  QByteArray extendedData() const;
269  QString matchedDn() const;
274  QList<QByteArray> referrals() const;
279  QByteArray serverCred() const;
280 
281  private:
282  class LdapOperationPrivate;
283  LdapOperationPrivate *const d;
284 
285  Q_DISABLE_COPY( LdapOperation )
286 };
287 
288 }
289 
290 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:14 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KLDAP Library

Skip menu "KLDAP Library"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal