1 /*
2     Kopete Groupwise Protocol
3     logintask.h - Send our credentials to the server and process the contact list and privacy details that it returns.
4 
5     Copyright (c) 2004      SUSE Linux AG	     http://www.suse.com
6 
7     Based on Iris, Copyright (C) 2003  Justin Karneges <justin@affinix.com>
8 
9     Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
10 
11     *************************************************************************
12     *                                                                       *
13     * This library is free software; you can redistribute it and/or         *
14     * modify it under the terms of the GNU Lesser General Public            *
15     * License as published by the Free Software Foundation; either          *
16     * version 2 of the License, or (at your option) any later version.      *
17     *                                                                       *
18     *************************************************************************
19 */
20 
21 #ifndef LOGINTASK_H
22 #define LOGINTASK_H
23 
24 #include "requesttask.h"
25 #include <QByteArray>
26 
27 using namespace GroupWise;
28 
29 /**
30 @author Kopete Developers
31 */
32 class LoginTask : public RequestTask
33 {
34     Q_OBJECT
35 public:
36     LoginTask(Task *parent);
37     ~LoginTask();
38     /**
39      * Get the login fields ready to go
40      */
41     void initialise();
42     /**
43      * Only accepts the contact list that comes back from the server,
44      * processes it and notifies the client of the contact list
45      */
46     bool take(Transfer *transfer) Q_DECL_OVERRIDE;
47 protected:
48     void extractFolder(Field::MultiField *folderContainer);
49     void extractContact(Field::MultiField *contactContainer);
50     ContactDetails extractUserDetails(Field::FieldList &fields);
51     void extractPrivacy(Field::FieldList &fields);
52     QStringList readPrivacyItems(const QByteArray &tag, Field::FieldList &fields);
53     void extractCustomStatuses(Field::FieldList &fields);
54     void extractKeepalivePeriod(Field::FieldList &fields);
55 Q_SIGNALS:
56     void gotMyself(const GroupWise::ContactDetails &);
57     void gotFolder(const FolderItem &);
58     void gotContact(const ContactItem &);
59     void gotContactUserDetails(const GroupWise::ContactDetails &);
60     void gotPrivacySettings(bool locked, bool defaultDeny, const QStringList &allowList, const QStringList &denyList);
61     void gotCustomStatus(const GroupWise::CustomStatus &);
62     void gotKeepalivePeriod(int);
63 };
64 
65 #endif
66