joinerror.h
1 //------------------------------------------------------------------------------
2 // joinerror.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2014 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef id0375B082_FEE9_4270_B314893A57DB3840
24 #define id0375B082_FEE9_4270_B314893A57DB3840
25 
26 #include "dptr.h"
27 #include "global.h"
28 #include <QString>
29 #include <QtContainerFwd>
30 
31 class PWad;
32 
41 class MAIN_EXPORT JoinError
42 {
43 public:
45  {
46  NoError,
47  MissingWads,
48  ConfigurationError,
49  Critical,
60  CanAutomaticallyInstallGame
61  };
62 
63  JoinError();
64  JoinError(JoinErrorType errorType);
65  JoinError(const JoinError &other);
66  JoinError &operator=(const JoinError &other);
67  virtual ~JoinError();
68 
69  void addMissingWad(const PWad &wad);
70  void clearMissingWads();
71 
72  const QString &error() const;
73  bool isError() const;
74  bool isMissingIwadOnly() const;
75  bool isMissingWadsError() const;
76 
80  const QString &missingIwad() const;
81 
85  const QList<PWad> &missingWads() const;
89  const QList<PWad> &incompatibleWads() const;
90 
91  void setError(const QString &error);
92  void setMissingIwad(const QString &iwad);
93  void setMissingWads(const QList<PWad> &wads);
94  void setIncompatibleWads(const QList<PWad> &wads);
95  void setType(JoinErrorType type);
96 
97  JoinErrorType type() const;
98 
99 private:
100  DPtr<JoinError> d;
101 };
102 
103 #endif
PWAD hosted on a server.
Aborts without printing error.
Definition: joinerror.h:55
Indicator of error for the server join process.
Definition: joinerror.h:41