9e4d22530e98401c634d3c52e4aa8263f2099fd4
[situare] / src / facebookservice / facebookcredentials.cpp
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Ville Tiensuu - ville.tiensuu@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #include <QtGlobal>
23 #include "facebookcredentials.h"
24
25 FacebookCredentials::FacebookCredentials()
26 {
27 }
28
29 void FacebookCredentials::clearCredentials()
30 {
31     m_expires.clear();
32     m_sessionKey.clear();
33     m_sessionSecret.clear();
34     m_sig.clear();
35     m_userID.clear();
36 }
37
38 void FacebookCredentials::setSessionKey(const QString & sessionKeyParameter)
39 {
40     m_sessionKey = sessionKeyParameter;
41 }
42
43 void FacebookCredentials::setSessionSecret(const QString & sessionSecretParameter)
44 {
45     m_sessionSecret = sessionSecretParameter;
46 }
47
48
49 void FacebookCredentials::setExpires (const QString & expiresParameter)
50 {
51     m_expires = expiresParameter;
52 }
53
54 void FacebookCredentials::setUserID (const QString & userIDParameter)
55 {
56     m_userID = userIDParameter;
57 }
58
59 void FacebookCredentials::setSig(const QString & sigParameter)
60 {
61     m_sig = sigParameter;
62 }
63
64 QString FacebookCredentials::sessionKey() const
65 {
66     return m_sessionKey;
67 }
68
69 QString FacebookCredentials::sessionSecret() const
70 {
71     return m_sessionSecret;
72 }
73
74 QString FacebookCredentials::expires() const
75 {
76     return m_expires;
77 }
78
79 QString FacebookCredentials::userID() const
80 {
81     return m_userID;
82 }
83
84 QString FacebookCredentials::sig() const
85 {
86     return m_sig;
87 }
88
89 bool FacebookCredentials::operator==(const FacebookCredentials &credentials)
90 {
91     bool expireBool = (m_expires == credentials.expires());
92     bool sessionKeyBool = (m_sessionKey == credentials.sessionKey());
93     bool sessionSecretBool = (m_sessionSecret == credentials.sessionSecret());
94     bool sigBool = (m_sig == credentials.sig());
95     bool userIdBool = (m_userID == credentials.userID());
96
97     return expireBool && sessionKeyBool && sessionSecretBool && sigBool && userIdBool;
98 }