|
1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "{License}" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "{LicenseUrl}". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Siddhartha Chandra, Satish Kanteti Sasken Communication Technologies Ltd |
|
14 * Description: |
|
15 * Login Dialog class of Authentication Application |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FB_LOGIN_DIALOG_H_ |
|
20 #define FB_LOGIN_DIALOG_H_ |
|
21 |
|
22 #include "baseDialog.h" |
|
23 #include "requestSP.h" |
|
24 #include <QNetworkReply> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class FBRequest; |
|
28 |
|
29 class FBLoginDialog : public FBDialog |
|
30 { |
|
31 Q_OBJECT |
|
32 |
|
33 private: |
|
34 FBRequest* iGetSessionRequest; |
|
35 |
|
36 private slots: |
|
37 /* slots for handling signals from FBRequest iGetSessionRequest */ |
|
38 void requestDidLoad (const QVariant& aResult); |
|
39 void LoadLoginPage(); |
|
40 |
|
41 void requestFailedWithFacebookError ( const FBError& aError ); |
|
42 void requestFailedWithNetworkError( QNetworkReply::NetworkError code ); |
|
43 |
|
44 public: |
|
45 FBLoginDialog(FBSession* aSession); |
|
46 FBLoginDialog(); |
|
47 |
|
48 void load(); |
|
49 |
|
50 protected: |
|
51 virtual void dialogWillDisappear(); |
|
52 void GetSessionKey(const QUrl& aUrl); |
|
53 void FetchKeyFromUrl(const QUrl& aUrl); |
|
54 void GetAccessToken(); |
|
55 private: |
|
56 void connectToGetSession(const QString& aToken); |
|
57 void loadLoginPage(); |
|
58 QString generateNONCE(const qint64 Length); |
|
59 //int generateTimeStamp(); |
|
60 QByteArray generateTimeStamp(); |
|
61 public: |
|
62 void connectToGetToken(); |
|
63 void LaunchBrowserL(const TDesC& aUrl); |
|
64 }; |
|
65 #endif |