| 1 | /***************************************************************************** |
| 2 | ** QNapi |
| 3 | ** Copyright (C) 2008-2017 Piotr KrzemiĆski <[email protected]> |
| 4 | ** |
| 5 | ** This program is free software; you can redistribute it and/or modify |
| 6 | ** it under the terms of the GNU General Public License as published by |
| 7 | ** the Free Software Foundation; either version 2 of the License, or |
| 8 | ** (at your option) any later version. |
| 9 | ** |
| 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | ** |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | #ifndef ENGINECONFIG_H |
| 16 | #define ENGINECONFIG_H |
| 17 | |
| 18 | #include <QString> |
| 19 | |
| 20 | class EngineConfig { |
| 21 | private: |
| 22 | QString nick_; |
| 23 | QString password_; |
| 24 | |
| 25 | public: |
| 26 | EngineConfig(const QString& nick = "", const QString& password = "") |
| 27 | : nick_(nick), password_(password) {} |
| 28 | |
| 29 | static EngineConfig empty; |
| 30 | |
| 31 | QString nick() const { return nick_; } |
| 32 | QString password() const { return password_; } |
| 33 | |
| 34 | const EngineConfig setNick(const QString& nick) const { |
| 35 | return EngineConfig(nick, password_); |
| 36 | } |
| 37 | const EngineConfig setPassword(const QString& password) const { |
| 38 | return EngineConfig(nick_, password); |
| 39 | } |
| 40 | |
| 41 | QString toString() const; |
| 42 | }; |
| 43 | |
| 44 | #endif |