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

libkdepim

  • sources
  • kde-4.14
  • kdepim
  • libkdepim
  • ldap
ldapsession.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3  Author: Volker Krause <volker.krause@kdab.com>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  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 the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef KLDAP_LDAPSESSION_H
22 #define KLDAP_LDAPSESSION_H
23 
24 #include <QThread>
25 #include <kldap/ldapconnection.h>
26 #include <QtCore/QQueue>
27 #include <QtCore/QMutex>
28 
29 class KJob;
30 
31 namespace KLDAP {
32 
33 class LdapServer;
34 class LdapQueryJob;
35 
36 
37 class LdapSession : public QThread
38 {
39  Q_OBJECT
40  public:
41  explicit LdapSession( QObject * parent = 0 );
42 
44  void connectToServer( const LdapServer &server );
46  void disconnectAndDelete();
47 
48  LdapQueryJob* get( const LdapUrl &url );
49 
50  LdapServer server() const;
51  LdapConnection& connection();
52 
53  protected:
54  void connectToServerInternal();
55  void disconnectFromServerInternal();
56  void run();
57 
58  private:
59  void authenticate();
60 
61  private slots:
62  void executeNext();
63  void jobDone( KJob* job );
64 
65  private:
66  enum State {
67  Disconnected,
68  Connected,
69  Authenticated
70  };
71  State m_state;
72  LdapConnection m_conn;
73  LdapServer m_server;
74  QMutex m_mutex;
75  QQueue<LdapQueryJob*> m_jobQueue;
76  LdapQueryJob* m_currentJob;
77 };
78 
79 }
80 
81 #endif
QMutex
QQueue
KLDAP::LdapSession::disconnectAndDelete
void disconnectAndDelete()
call this instead of the dtor
Definition: ldapsession.cpp:65
KLDAP::LdapSession::connectToServerInternal
void connectToServerInternal()
Definition: ldapsession.cpp:52
KLDAP::LdapSession::server
LdapServer server() const
Definition: ldapsession.cpp:142
KLDAP::LdapSession
Definition: ldapsession.h:37
KLDAP::LdapSession::connection
LdapConnection & connection()
Definition: ldapsession.cpp:147
QObject
KLDAP::LdapSession::disconnectFromServerInternal
void disconnectFromServerInternal()
Definition: ldapsession.cpp:73
KLDAP::LdapSession::run
void run()
Definition: ldapsession.cpp:122
KLDAP::LdapSession::connectToServer
void connectToServer(const LdapServer &server)
call this instead of start()
Definition: ldapsession.cpp:42
KLDAP::LdapQueryJob
Definition: ldapqueryjob.h:31
QThread
QObject::parent
QObject * parent() const
KJob
KLDAP::LdapSession::LdapSession
LdapSession(QObject *parent=0)
Definition: ldapsession.cpp:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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