KLdap

ldapurl.h
1 /*
2  This file is part of libkldap.
3  Copyright (c) 2004-2006 Szombathelyi Gy├Ârgy <[email protected]>
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_LDAPURL_H
22 #define KLDAP_LDAPURL_H
23 
24 #include <QStringList>
25 
26 #include <QUrl>
27 
28 #include "ldapdn.h"
29 #include "kldap_export.h"
30 
31 // clazy:excludeall=copyable-polymorphic
32 
33 namespace KLDAP {
42 class KLDAP_EXPORT LdapUrl : public QUrl
43 {
44 public:
45 
50  typedef struct {
51  QString value;
52  bool critical;
53  } Extension;
54 
58  typedef enum {
59  Base,
60  One,
61  Sub
62  } Scope;
63 
67  LdapUrl();
68 
72  explicit LdapUrl(const QUrl &url);
73 
77  LdapUrl(const LdapUrl &other);
78 
83  LdapUrl &operator=(const LdapUrl &other);
84 
88  ~LdapUrl();
89 
93  void setDn(const LdapDN &dn);
94 
99  Q_REQUIRED_RESULT LdapDN dn() const;
100 
104  void setAttributes(const QStringList &attributes);
105 
109  Q_REQUIRED_RESULT QStringList attributes() const;
110 
114  void setScope(Scope scope);
115 
119  Q_REQUIRED_RESULT Scope scope() const;
120 
124  void setFilter(const QString &filter);
125 
129  Q_REQUIRED_RESULT QString filter() const;
130 
134  Q_REQUIRED_RESULT bool hasExtension(const QString &extension) const;
135 
139  Q_REQUIRED_RESULT Extension extension(const QString &extension) const;
140 
144  Q_REQUIRED_RESULT QString extension(const QString &extension, bool &critical) const;
145 
149  void setExtension(const QString &key, const Extension &extension);
150 
154  void setExtension(const QString &key, const QString &value, bool critical = false);
155 
159  void setExtension(const QString &key, int value, bool critical = false);
160 
164  void removeExtension(const QString &extension);
165 
169  void updateQuery();
170 
175  void parseQuery();
176 
177 private:
178  class LdapUrlPrivate;
179  LdapUrlPrivate *const d;
180 };
181 }
182 
183 #endif
A special url class for LDAP.
Definition: ldapurl.h:42
A class holding the extension name and state whether the extension is critical.
Definition: ldapurl.h:50
Scope
Describes the scope of the LDAP url.
Definition: ldapurl.h:58
Definition: ber.h:30
The level of the url and the one below.
Definition: ldapurl.h:60
Only the same level as the url.
Definition: ldapurl.h:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 22:39:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.