uisessiondata.h
00001 /*
00002  * This file is part of signon
00003  *
00004  * Copyright (C) 2009-2010 Nokia Corporation.
00005  * Copyright (C) 2012-2016 Canonical Ltd.
00006  *
00007  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public License
00011  * version 2.1 as published by the Free Software Foundation.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  */
00028 #ifndef UISESSIONDATA_H
00029 #define UISESSIONDATA_H
00030 
00031 #include <SignOn/SessionData>
00036 namespace SignOn {
00037 
00038 enum QueryError {
00039     QUERY_ERROR_NONE = 0,        
00040     QUERY_ERROR_GENERAL,         
00041     QUERY_ERROR_NO_SIGNONUI,     
00042     QUERY_ERROR_BAD_PARAMETERS,  
00044     QUERY_ERROR_CANCELED,        
00046     QUERY_ERROR_NOT_AVAILABLE,   
00048     QUERY_ERROR_BAD_URL,         
00049     QUERY_ERROR_BAD_CAPTCHA,     
00050     QUERY_ERROR_BAD_CAPTCHA_URL, 
00052     QUERY_ERROR_REFRESH_FAILED,  
00053     QUERY_ERROR_FORBIDDEN,       
00054     QUERY_ERROR_FORGOT_PASSWORD, 
00055     QUERY_ERROR_NETWORK,         
00056     QUERY_ERROR_SSL,             
00057 };
00058 
00062 enum QueryMessageId {
00063     QUERY_MESSAGE_EMPTY = 0,          
00064     QUERY_MESSAGE_LOGIN,     
00065     QUERY_MESSAGE_NOT_AUTHORIZED          
00066     //TODO add more messages
00067 };
00068 
00076 class UiSessionData : public SessionData
00077 {
00078 public:
00085     UiSessionData(const QVariantMap &data = QVariantMap()) { m_data = data; }
00086 
00093     SIGNON_SESSION_DECLARE_PROPERTY(int, QueryErrorCode)
00094 
00095     
00102     SIGNON_SESSION_DECLARE_PROPERTY(QString, Caption)
00103 
00109     SIGNON_SESSION_DECLARE_PROPERTY(QString, Title)
00110 
00117     SIGNON_SESSION_DECLARE_PROPERTY(int, QueryMessageId)
00118 
00126     SIGNON_SESSION_DECLARE_PROPERTY(QString, QueryMessage)
00127 
00132     SIGNON_SESSION_DECLARE_PROPERTY(bool, QueryUserName)
00133 
00138     SIGNON_SESSION_DECLARE_PROPERTY(bool, QueryPassword)
00139 
00144     SIGNON_SESSION_DECLARE_PROPERTY(bool, RememberPassword)
00145 
00150     SIGNON_SESSION_DECLARE_PROPERTY(bool, ShowRealm)
00151 
00157     SIGNON_SESSION_DECLARE_PROPERTY(QString, OpenUrl)
00158 
00164     SIGNON_SESSION_DECLARE_PROPERTY(QString, FinalUrl)
00165 
00172     SIGNON_SESSION_DECLARE_PROPERTY(QString, UrlResponse)
00173 
00182     SIGNON_SESSION_DECLARE_PROPERTY(QString, CaptchaUrl)
00183 
00192     SIGNON_SESSION_DECLARE_PROPERTY(QByteArray, CaptchaImage)
00193 
00202     SIGNON_SESSION_DECLARE_PROPERTY(QString, CaptchaResponse)
00203 
00209     SIGNON_SESSION_DECLARE_PROPERTY(QString, ForgotPassword)
00210 
00216     SIGNON_SESSION_DECLARE_PROPERTY(QString, ForgotPasswordUrl)
00217 
00223     SIGNON_SESSION_DECLARE_PROPERTY(bool, Confirm)
00224 
00230     SIGNON_SESSION_DECLARE_PROPERTY(QString, Icon)
00231 
00232 };
00233 
00234 } //namespace SignOn
00235 
00236 Q_DECLARE_METATYPE(SignOn::UiSessionData)
00237 #endif // UISESSIONDATA_H