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

KLDAP Library

  • kldap
ldapmodel.h
1/*
2 This file is part of libkldap.
3 Copyright (c) 2006 Sean Harmer <sh@theharmers.co.uk>
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_LDAPMODEL_H
22#define KLDAP_LDAPMODEL_H
23
24#include <QtCore/QAbstractItemModel>
25
26#include "ldapconnection.h"
27#include "ldapobject.h"
28#include "kldap_export.h"
29
30namespace KLDAP {
31
42class KLDAP_EXPORT LdapModel : public QAbstractItemModel
43{
44 Q_OBJECT
45 public:
46 enum Roles {
47 NodeTypeRole = Qt::UserRole + 1
48 };
49
50 enum LdapDataType {
51 DistinguishedName = 0,
52 Attribute
53 };
54
63 explicit LdapModel( QObject *parent = 0 );
72 explicit LdapModel( LdapConnection &connection, QObject *parent = 0 );
73 virtual ~LdapModel();
74
81 void setConnection( LdapConnection &connection );
82
83 //
84 // Implement the usual QAbstractItemModel interface
85 //
89 virtual QModelIndex index( int row, int col, const QModelIndex &parent ) const;
93 virtual QModelIndex parent( const QModelIndex &child ) const;
97 virtual QVariant data( const QModelIndex &index, int role ) const;
102 virtual bool setData( const QModelIndex &index,
103 const QVariant &value,
104 int role = Qt::EditRole );
108 virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
112 virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
116 virtual int columnCount( const QModelIndex &parent ) const;
120 virtual int rowCount( const QModelIndex &parent ) const;
124 virtual bool hasChildren( const QModelIndex &parent ) const;
128 virtual bool canFetchMore( const QModelIndex &parent ) const;
132 virtual void fetchMore( const QModelIndex &parent );
137 virtual bool insertRows( int row, int count,
138 const QModelIndex &parent = QModelIndex() );
143 virtual bool removeRows( int row, int count,
144 const QModelIndex &parent = QModelIndex() );
149 virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
150
151 //
152 // Drag and drop support
153 //
158 virtual Qt::DropActions supportedDropActions() const;
163 virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
168 virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action,
169 int row, int column, const QModelIndex &parent );
170
171 //
172 // Other public utility functions
173 //
183 bool hasChildrenOfType( const QModelIndex &parent, LdapDataType type ) const;
184
185 public Q_SLOTS:
190 virtual void revert();
195 virtual bool submit();
196
197 Q_SIGNALS:
205 void ready();
206
207 private:
208 class LdapModelPrivate;
209 LdapModelPrivate *const m_d;
210
211 Q_PRIVATE_SLOT( m_d, void gotSearchResult( KLDAP::LdapSearch* ) )
212 Q_PRIVATE_SLOT( m_d, void gotSearchData( KLDAP::LdapSearch*, const KLDAP::LdapObject& ) )
213};
214
215}
216#endif
KLDAP::LdapConnection
This class represents a connection to an LDAP server.
Definition: ldapconnection.h:37
KLDAP::LdapModel::LdapModelPrivate
Definition: ldapmodel_p.h:38
KLDAP::LdapModel
A ModelView interface to an LDAP tree.
Definition: ldapmodel.h:43
KLDAP::LdapModel::ready
void ready()
The ready() signal is emitted when the model is ready for use by other components.
KLDAP::LdapObject
This class represents an LDAP Object.
Definition: ldapobject.h:42
KLDAP::LdapSearch
This class starts a search operation on a LDAP server and returns the search values via a Qt signal.
Definition: ldapsearch.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 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