OSDN Git Service

reformat
[kita/kita.git] / kita / src / libkita / account.h
1 /***************************************************************************
2 *   Copyright (C) 2004 by Kita Developers                                 *
3 *   ikemo@users.sourceforge.jp                                            *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 ***************************************************************************/
10 #ifndef KITAACCOUNT_H
11 #define KITAACCOUNT_H
12
13 #include <qobject.h>
14
15 namespace KIO
16 {
17     class Job;
18 }
19
20 namespace Kita
21 {
22
23     /**
24     @author Hideki Ikemoto
25     */
26     class Account : public QObject
27     {
28         Q_OBJECT
29         static Account* instance;
30
31         KIO::Job* m_job;
32         QCString m_data;
33         QString m_sessionID;
34         bool m_isLogged;
35
36         Account();
37         ~Account();
38         void enter_loop();
39         bool loginInternal( const QString& userID, const QString& password );
40         static Account* getInstance();
41     private slots:
42         void slotReceiveData( KIO::Job* job, const QByteArray& data );
43         void slotResult( KIO::Job* job );
44     public:
45         static const QString& getSessionID() { return getInstance() ->m_sessionID; }
46         static bool isLogged() { return getInstance() ->m_isLogged; }
47         static bool login( const QString& userID, const QString& password );
48     };
49
50 }
51
52 #endif