KLDAP Library
#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.
Definition at line 42 of file ldapmodel.h.
Constructor & Destructor Documentation
|
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
-
parent the parent QObject
- See also
- setConnection()
- ready()
Definition at line 34 of file ldapmodel.cpp.
|
explicit |
Constructs an LdapModel.
Clients of this class should connect a slot to the ready() signal before setting this model onto a view.
- Parameters
-
connection the Ldap connection to use in model construction parent the parent QObject
- See also
- setConnection()
- ready()
Definition at line 41 of file ldapmodel.cpp.
Member Function Documentation
|
virtual |
Reimplemented from QAbstractItemModel::canFetchMore().
Definition at line 206 of file ldapmodel.cpp.
|
virtual |
Reimplemented from QAbstractItemModel::columnCount().
Definition at line 170 of file ldapmodel.cpp.
|
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.
|
virtual |
Reimplemented from QAbstractItemModel::dropMimedata().
This is a placeholder for when LdapModel beomes writeable and always returns false.
Definition at line 262 of file ldapmodel.cpp.
|
virtual |
Reimplemented from QAbstractItemModel::fetchMore().
Definition at line 213 of file ldapmodel.cpp.
|
virtual |
Reimplemented from QAbstractItemModel::flags().
Read-only for now, make read-write upon request
Definition at line 160 of file ldapmodel.cpp.
|
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
-
parent Index to the item to query. type The type of child item to search for.
Definition at line 274 of file ldapmodel.cpp.
|
virtual |
Reimplemented from QAbstractItemModel::headerData().
Definition at line 147 of file ldapmodel.cpp.
|
virtual |
Reimplemented from QAbstractItemModel::index().
Definition at line 83 of file ldapmodel.cpp.
|
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.
|
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.
|
virtual |
Reimplemented from QAbstractItemModel::parent().
Definition at line 67 of file ldapmodel.cpp.
|
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.
|
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.
|
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.
|
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
-
connection the model connection to set
- See also
- LdapConnection
- LdapUrl
Definition at line 56 of file ldapmodel.cpp.
|
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.
|
virtual |
Reimplemented from QAbstractItemModel::removeRows().
The default implementation does nothing.
Definition at line 245 of file ldapmodel.cpp.
|
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.
|
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:
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.