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

KLDAP Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kldap
ldapmodelnode_p.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_LDAPMODELNODE_P_H
22 #define KLDAP_LDAPMODELNODE_P_H
23 
24 #include <QByteArray>
25 #include <QString>
26 #include <QtCore/QList>
27 #include <QtCore/QVariant>
28 
29 #include "ldapdn.h"
30 #include "ldapobject.h"
31 #include "kldap_export.h"
32 
33 namespace KLDAP {
34 
35 class LdapModelDNNode;
36 
40 class LdapModelNode
41 {
42  public:
43  explicit LdapModelNode( LdapModelDNNode *parent = 0 );
44  virtual ~LdapModelNode();
45 
46  enum NodeType {
47  DN,
48  Attr
49  };
50 
51  virtual NodeType nodeType() const = 0;
52 
53  LdapModelDNNode *parent();
54  int columnCount() const { return 2; }
55  int row() const;
56 
57  void setPopulated( bool b ) { m_isPopulated = b; }
58  bool isPopulated() const { return m_isPopulated; }
59 
60  private:
61  LdapModelDNNode *m_parent;
62  bool m_isPopulated;
63 };
64 
68 class LdapModelDNNode : public LdapModelNode
69 {
70  public:
71  explicit LdapModelDNNode( LdapModelDNNode *parent = 0,
72  const LdapDN &dn = LdapDN() );
73  ~LdapModelDNNode();
74 
75  LdapModelNode::NodeType nodeType() const
76  { return LdapModelNode::DN; }
77 
78  void appendChild( LdapModelNode *pItem );
79  LdapModelNode *child( int row );
80  int childCount() const { return m_childItems.size(); }
81  const QList<LdapModelNode*>& children() const
82  { return m_childItems; }
83 
84  const LdapDN &dn() const { return m_dn; }
85 
92  void setLdapObject( const LdapObject &object );
93 
94  private:
95  QList<LdapModelNode*> m_childItems;
96  LdapDN m_dn;
97 };
98 
102 class LdapModelAttrNode : public LdapModelNode
103 {
104  public:
105  explicit LdapModelAttrNode( LdapModelDNNode *parent = 0,
106  const QString &attrName = QString(),
107  const QByteArray &attrData = QByteArray() );
108  ~LdapModelAttrNode();
109 
110  LdapModelNode::NodeType nodeType() const
111  { return LdapModelNode::Attr; }
112 
113  const QString &attributeName() { return m_attrName; }
114  const QByteArray &attributeData() { return m_attrData; }
115 
116  private:
117  QString m_attrName;
118  QByteArray m_attrData;
119 };
120 
121 }
122 
123 #endif
KLDAP::LdapModelDNNode
Definition: ldapmodelnode_p.h:68
KLDAP::LdapObject
This class represents an LDAP Object.
Definition: ldapobject.h:41
KLDAP::LdapModelNode
Definition: ldapmodelnode_p.h:40
KLDAP::LdapModelAttrNode
Definition: ldapmodelnode_p.h:102
KLDAP::LdapModelDNNode::setLdapObject
void setLdapObject(const LdapObject &object)
Creates child LdapModelAttrNode object to store object's attributes and adds them as children of this...
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