• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
30 namespace KLDAP {
31 
42 class 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 );
71  explicit LdapModel( LdapConnection &connection, QObject *parent = 0 );
72  virtual ~LdapModel();
73 
80  void setConnection( LdapConnection &connection );
81 
82  //
83  // Implement the usual QAbstractItemModel interface
84  //
88  virtual QModelIndex index( int row, int col, const QModelIndex &parent ) const;
92  virtual QModelIndex parent( const QModelIndex &child ) const;
96  virtual QVariant data( const QModelIndex &index, int role ) const;
101  virtual bool setData( const QModelIndex &index,
102  const QVariant &value,
103  int role = Qt::EditRole );
107  virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
111  virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
115  virtual int columnCount( const QModelIndex &parent ) const;
119  virtual int rowCount( const QModelIndex &parent ) const;
123  virtual bool hasChildren( const QModelIndex &parent ) const;
127  virtual bool canFetchMore( const QModelIndex &parent ) const;
131  virtual void fetchMore( const QModelIndex &parent );
136  virtual bool insertRows( int row, int count,
137  const QModelIndex &parent = QModelIndex() );
142  virtual bool removeRows( int row, int count,
143  const QModelIndex &parent = QModelIndex() );
148  virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
149 
150  //
151  // Drag and drop support
152  //
157  virtual Qt::DropActions supportedDropActions() const;
162  virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
167  virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action,
168  int row, int column, const QModelIndex &parent );
169 
170  //
171  // Other public utility functions
172  //
182  bool hasChildrenOfType( const QModelIndex &parent, LdapDataType type ) const;
183 
184  public Q_SLOTS:
189  virtual void revert();
194  virtual bool submit();
195 
196  Q_SIGNALS:
204  void ready();
205 
206  private:
207  class LdapModelPrivate;
208  LdapModelPrivate *const m_d;
209 
210  Q_PRIVATE_SLOT( m_d, void gotSearchResult( KLDAP::LdapSearch* ) )
211  Q_PRIVATE_SLOT( m_d, void gotSearchData( KLDAP::LdapSearch*, const KLDAP::LdapObject& ) )
212 };
213 
214 }
215 #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