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

KLDAP Library

  • KLDAP
  • LdapModel
Classes | Public Types | Public Slots | Signals | Public Member Functions | List of all members
KLDAP::LdapModel Class Reference

#include <ldapmodel.h>

Inherits QAbstractItemModel.

Classes

class  LdapModelPrivate
 

Public Types

enum  LdapDataType { DistinguishedName = 0, Attribute }
 
enum  Roles { NodeTypeRole = Qt::UserRole + 1 }
 

Public Slots

virtual void revert ()
 
virtual bool submit ()
 

Signals

void ready ()
 

Public Member Functions

 LdapModel (QObject *parent=0)
 
 LdapModel (LdapConnection &connection, QObject *parent=0)
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
virtual int columnCount (const QModelIndex &parent) const
 
virtual QVariant data (const QModelIndex &index, int role) const
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
virtual void fetchMore (const QModelIndex &parent)
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual bool hasChildren (const QModelIndex &parent) const
 
bool hasChildrenOfType (const QModelIndex &parent, LdapDataType type) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
virtual QModelIndex index (int row, int col, const QModelIndex &parent) const
 
virtual bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
 
virtual QModelIndex parent (const QModelIndex &child) const
 
virtual bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
virtual int rowCount (const QModelIndex &parent) const
 
void setConnection (LdapConnection &connection)
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
virtual void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
 
virtual Qt::DropActions supportedDropActions () const
 

Detailed Description

A ModelView interface to an LDAP tree.

At present the model is read only. Editing is planned for a future release.

This class is best used in conjunction with an LdapStructureProxyModel object for displaying the structure of an LDAP tree, and with LdapAttributeProxyModel for displaying the attributes of particular objects within the tree.

Author
Sean Harmer sh@th.nosp@m.ehar.nosp@m.mers..nosp@m.co.u.nosp@m.k

Definition at line 42 of file ldapmodel.h.

Constructor & Destructor Documentation

LdapModel::LdapModel ( QObject *  parent = 0)
explicit

Constructs an LdapModel.

You should set a connection for the model to use with setConnection(). Clients of this class should connect a slot to the ready() signal before setting this model onto a view.

Parameters
parentthe parent QObject
See also
setConnection()
ready()

Definition at line 34 of file ldapmodel.cpp.

LdapModel::LdapModel ( LdapConnection &  connection,
QObject *  parent = 0 
)
explicit

Constructs an LdapModel.

Clients of this class should connect a slot to the ready() signal before setting this model onto a view.

Parameters
connectionthe Ldap connection to use in model construction
parentthe parent QObject
See also
setConnection()
ready()

Definition at line 41 of file ldapmodel.cpp.

Member Function Documentation

bool LdapModel::canFetchMore ( const QModelIndex &  parent) const
virtual

Reimplemented from QAbstractItemModel::canFetchMore().

Definition at line 206 of file ldapmodel.cpp.

int LdapModel::columnCount ( const QModelIndex &  parent) const
virtual

Reimplemented from QAbstractItemModel::columnCount().

Definition at line 170 of file ldapmodel.cpp.

QVariant LdapModel::data ( const QModelIndex &  index,
int  role 
) const
virtual

Reimplemented from QAbstractItemModel::data().

Todo:
Include support for nice decorative icons dependent upon the objectClass + other role data.
Todo:
Include support for other roles as needed

Definition at line 101 of file ldapmodel.cpp.

bool LdapModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
virtual

Reimplemented from QAbstractItemModel::dropMimedata().

This is a placeholder for when LdapModel beomes writeable and always returns false.

Todo:
Implement drag and drop for LdapModel

Definition at line 262 of file ldapmodel.cpp.

void LdapModel::fetchMore ( const QModelIndex &  parent)
virtual

Reimplemented from QAbstractItemModel::fetchMore().

Definition at line 213 of file ldapmodel.cpp.

Qt::ItemFlags LdapModel::flags ( const QModelIndex &  index) const
virtual

Reimplemented from QAbstractItemModel::flags().

Read-only for now, make read-write upon request

Definition at line 160 of file ldapmodel.cpp.

bool LdapModel::hasChildren ( const QModelIndex &  parent) const
virtual

Reimplemented from QAbstractItemModel::hasChildren().

Definition at line 188 of file ldapmodel.cpp.

bool LdapModel::hasChildrenOfType ( const QModelIndex &  parent,
LdapDataType  type 
) const

Checks to see if the item referenced by parent has any children of the type type.

If the item has not been populated by fetchMore() yet, then this function returns true.

See also
fetchMore()
Parameters
parentIndex to the item to query.
typeThe type of child item to search for.

Definition at line 274 of file ldapmodel.cpp.

QVariant LdapModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
virtual

Reimplemented from QAbstractItemModel::headerData().

Definition at line 147 of file ldapmodel.cpp.

QModelIndex LdapModel::index ( int  row,
int  col,
const QModelIndex &  parent 
) const
virtual

Reimplemented from QAbstractItemModel::index().

Definition at line 83 of file ldapmodel.cpp.

bool LdapModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual

Reimplemented from QAbstractItemModel::insertRows().

This is a placeholder for when LdapModel beomes writeable and always returns false.

Definition at line 227 of file ldapmodel.cpp.

QMimeData * LdapModel::mimeData ( const QModelIndexList &  indexes) const
virtual

Reimplemented from QAbstractItemModel::mimedata().

This is a placeholder for when LdapModel beomes writeable and always returns 0.

Definition at line 256 of file ldapmodel.cpp.

QModelIndex LdapModel::parent ( const QModelIndex &  child) const
virtual

Reimplemented from QAbstractItemModel::parent().

Definition at line 67 of file ldapmodel.cpp.

void KLDAP::LdapModel::ready ( )
signal

The ready() signal is emitted when the model is ready for use by other components.

When the model is first created and a connection is set, the model queries the LDAP server for its base DN and automatically creates items down to that level. This requires the event loop to be running. This signal indicates that this process has completed and the model can now be set onto views or queried directly from code.

bool LdapModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
virtual

Reimplemented from QAbstractItemModel::removeRows().

This is a placeholder for when LdapModel beomes writeable and always returns false.

Definition at line 236 of file ldapmodel.cpp.

void LdapModel::revert ( )
virtualslot

Reimplemented from QAbstractItemModel::revert().

This is a placeholder for when LdapModel beomes writeable. This implementation does nothing.

Definition at line 312 of file ldapmodel.cpp.

int LdapModel::rowCount ( const QModelIndex &  parent) const
virtual

Reimplemented from QAbstractItemModel::rowCount().

Definition at line 177 of file ldapmodel.cpp.

void LdapModel::setConnection ( LdapConnection &  connection)

Set the connection that the model should use.

Parameters
connectionthe model connection to set
See also
LdapConnection
LdapUrl

Definition at line 56 of file ldapmodel.cpp.

bool LdapModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Reimplemented from QAbstractItemModel::setData().

This is a placeholder for when LdapModel beomes writeable and always returns false.

Definition at line 137 of file ldapmodel.cpp.

void LdapModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
virtual

Reimplemented from QAbstractItemModel::removeRows().

The default implementation does nothing.

Definition at line 245 of file ldapmodel.cpp.

bool LdapModel::submit ( )
virtualslot

Reimplemented from QAbstractItemModel::revert().

This is a placeholder for when LdapModel beomes writeable. This implementation does nothing and returns false.

Definition at line 317 of file ldapmodel.cpp.

Qt::DropActions LdapModel::supportedDropActions ( ) const
virtual

Reimplemented from QAbstractItemModel::supportedDropActions().

The default implementation returns Qt::MoveAction.

Definition at line 251 of file ldapmodel.cpp.


The documentation for this class was generated from the following files:
  • ldapmodel.h
  • ldapmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:21 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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