digiKam
rajcesession.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-04-12
7  * Description : A tool to export items to Rajce web service
8  *
9  * Copyright (C) 2011 by Lukas Krejci <krejci.l at centrum dot cz>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_RAJCE_SESSION_H
25 #define DIGIKAM_RAJCE_SESSION_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QVector>
31 
32 // Local includes
33 
34 #include "rajcealbum.h"
35 
37 {
38 
40 {
41  Login = 0,
47  AddPhoto
48 };
49 
51 {
75 };
76 
78 {
79 public:
80 
81  explicit RajceSession();
82  ~RajceSession();
83 
86  RajceSession(const RajceSession& other);
87 
90  RajceSession& operator=(const RajceSession& other);
91 
92 public:
93 
94  QString& sessionToken();
95  QString const& sessionToken() const;
96  QString& nickname();
97  QString const& nickname() const;
98  QString& username();
99  QString const& username() const;
100  QString& openAlbumToken();
101  QString const& openAlbumToken() const;
102  QString& lastErrorMessage();
103  QString const& lastErrorMessage() const;
104 
105  unsigned& maxWidth();
106  unsigned maxWidth() const;
107  unsigned& maxHeight();
108  unsigned maxHeight() const;
109  unsigned& imageQuality();
110  unsigned imageQuality() const;
111  unsigned& lastErrorCode();
112  unsigned lastErrorCode() const;
113 
114  QVector<RajceAlbum>& albums();
115  const QVector<RajceAlbum>& albums() const;
116 
119 
120 private:
121 
122  class Private;
123  Private* const d;
124 };
125 
126 } // namespace DigikamGenericRajcePlugin
127 
128 QDebug operator<<(QDebug d, const DigikamGenericRajcePlugin::RajceSession& s);
129 
130 #endif // DIGIKAM_RAJCE_SESSION_H
Definition: rajcesession.h:78
QString & username()
Definition: rajcesession.cpp:104
QString & sessionToken()
Definition: rajcesession.cpp:84
QString & nickname()
Definition: rajcesession.cpp:94
RajceCommandType & lastCommand()
Definition: rajcesession.cpp:189
~RajceSession()
Definition: rajcesession.cpp:67
RajceSession()
Definition: rajcesession.cpp:62
QVector< RajceAlbum > & albums()
Definition: rajcesession.cpp:174
unsigned & maxHeight()
Definition: rajcesession.cpp:144
QString & lastErrorMessage()
Definition: rajcesession.cpp:124
unsigned & maxWidth()
Definition: rajcesession.cpp:134
unsigned & lastErrorCode()
Definition: rajcesession.cpp:164
RajceSession & operator=(const RajceSession &other)
Definition: rajcesession.cpp:77
unsigned & imageQuality()
Definition: rajcesession.cpp:154
QString & openAlbumToken()
Definition: rajcesession.cpp:114
Definition: rajcealbum.h:35
RajceErrorCode
Definition: rajcesession.h:51
@ UnknownApplication
12 Nonexistent application.
Definition: rajcesession.h:67
@ InvalidCredentials
3 Invalid credentials.
Definition: rajcesession.h:58
@ UnsupportedFileExtension
17 Unsupported file extension {extension}.
Definition: rajcesession.h:72
@ NonexistentTarget
19 Unknown target.
Definition: rajcesession.h:74
@ InvalidAlbumId
6 Invalid album ID.
Definition: rajcesession.h:61
@ FileNotAttached
14 A file is not attached.
Definition: rajcesession.h:69
@ AlbumNameEmpty
9 Album can't have an empty name.
Definition: rajcesession.h:64
@ FailedToCreateAlbum
10 Failed to create an album (probably a serverside error).
Definition: rajcesession.h:65
@ UnknownError
1 Unknown error.
Definition: rajcesession.h:56
@ InvalidSessionToken
4 Invalid session token.
Definition: rajcesession.h:59
@ UnknownClientVersion
18 Unknown client version.
Definition: rajcesession.h:73
@ NewerVersionExists
15 A newer version already exists {version}.
Definition: rajcesession.h:70
@ AlbumDoesntExistOrNoPrivileges
7 The album doesn't exist or is not owned by the logged in user.
Definition: rajcesession.h:62
@ InvalidAlbumToken
8 Invalid album token.
Definition: rajcesession.h:63
@ InvalidApplicationKey
13 Invalid application key.
Definition: rajcesession.h:68
@ SavingFileFailed
16 Failed to save the file.
Definition: rajcesession.h:71
@ InvalidOrRepeatedColumnName
5 Unknown or repeated column name {colName}.
Definition: rajcesession.h:60
@ InvalidCommand
2 Invalid command.
Definition: rajcesession.h:57
@ AlbumDoesntExist
11 Album doesn't exist.
Definition: rajcesession.h:66
RajceCommandType
Definition: rajcesession.h:40
@ AddPhoto
Definition: rajcesession.h:47
@ CloseAlbum
Definition: rajcesession.h:46
@ CreateAlbum
Definition: rajcesession.h:44
@ Login
Definition: rajcesession.h:41
@ ListAlbums
Definition: rajcesession.h:43
@ OpenAlbum
Definition: rajcesession.h:45
@ Logout
Definition: rajcesession.h:42
QDebug operator<<(QDebug d, const DigikamGenericRajcePlugin::RajceSession &s)
Definition: rajcesession.cpp:196