1 | /* Copyright 2010 Thomas McGuire <mcguire@kde.org> |
2 | |
3 | This library is free software; you can redistribute it and/or modify |
4 | it under the terms of the GNU Library General Public License as published |
5 | by the Free Software Foundation; either version 2 of the License or |
6 | ( at your option ) version 3 or, at the discretion of KDE e.V. |
7 | ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef KFBAPI_USERINFOJOB_H |
21 | #define KFBAPI_USERINFOJOB_H |
22 | |
23 | #include "userinfo.h" |
24 | #include "facebookjobs.h" |
25 | |
26 | namespace KFbAPI { |
27 | |
28 | class UserInfoJobPrivate; |
29 | |
30 | /** |
31 | * Get information about the currently authenticated user |
32 | */ |
33 | class LIBKFBAPI_EXPORT UserInfoJob : public FacebookGetJob |
34 | { |
35 | Q_OBJECT |
36 | public: |
37 | /** |
38 | * @brief Construct a job to retrieve the data of the currently authenticaed user. |
39 | * @param accessToken The access token to access data on facebook. |
40 | */ |
41 | explicit UserInfoJob(const QString &accessToken, QObject *parent = 0); |
42 | |
43 | UserInfoJob(const QString &userId, const QString &accessToken, QObject *parent = 0); |
44 | /** |
45 | * @return A pointer to a userInfo object about the currently authenticated user. |
46 | */ |
47 | UserInfo userInfo() const; |
48 | |
49 | protected: |
50 | /** |
51 | * @brief Handles the data returned by the FacebookGetJob |
52 | * @param data A JSON string containing the data of the currently authenticated user. |
53 | */ |
54 | virtual void handleData(const QVariant &data); |
55 | |
56 | private: |
57 | Q_DECLARE_PRIVATE(UserInfoJob) |
58 | }; |
59 | |
60 | } |
61 | |
62 | #endif |
63 | |