00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _K_LDAPURL_H_
00022 #define _K_LDAPURL_H_
00023
00024 #include <tqstring.h>
00025 #include <tqstringlist.h>
00026 #include <tqmap.h>
00027
00028 #include <kurl.h>
00029
00030 namespace TDEABC {
00031
00042 class KABC_EXPORT LDAPUrl : public KURL
00043 {
00044 public:
00045
00046 struct Extension {
00047 TQString value;
00048 bool critical;
00049 };
00050
00051 enum Scope { Base, One, Sub };
00052
00054 LDAPUrl();
00056 LDAPUrl( const KURL &url );
00057
00062 const TQString& dn() const { return m_dn; }
00064 void setDn( const TQString &dn );
00065
00067 const TQStringList &attributes() { return m_attributes; }
00069 void setAttributes( const TQStringList &attributes )
00070 { m_attributes=attributes; updateQuery(); }
00071
00073 Scope scope() const { return m_scope; }
00075 void setScope(Scope scope) { m_scope = scope; updateQuery(); }
00076
00078 const TQString &filter() const { return m_filter; }
00080 void setFilter( TQString filter ) { m_filter = filter; updateQuery(); }
00081
00083 bool hasExtension( const TQString &key ) const;
00085 Extension extension( const TQString &key ) const;
00087 TQString extension( const TQString &key, bool &critical ) const;
00089 void setExtension( const TQString &key, const Extension &ext );
00091 void setExtension( const TQString &key, const TQString &value, bool critical = false );
00093 void removeExtension( const TQString &key );
00095 void updateQuery();
00096
00097 protected:
00098 void parseQuery();
00099
00100 private:
00101
00102 TQMap<TQString, Extension> m_extensions;
00103 TQString m_dn;
00104 TQStringList m_attributes;
00105 Scope m_scope;
00106 TQString m_filter;
00107 };
00108 }
00109
00110 #endif