| 1 | /* |
| 2 | This file is part of KDE. |
| 3 | |
| 4 | SPDX-FileCopyrightText: 2018 Ralf Habacker <ralf.habacker@freenet.de> |
| 5 | |
| 6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | #ifndef ATTICA_CONFIG_H |
| 9 | #define ATTICA_CONFIG_H |
| 10 | |
| 11 | #include <QSharedDataPointer> |
| 12 | #include <QString> |
| 13 | |
| 14 | #include "attica_export.h" |
| 15 | |
| 16 | namespace Attica |
| 17 | { |
| 18 | /*! |
| 19 | * \class Attica::Config |
| 20 | * \inheaderfile Attica/Config |
| 21 | * \inmodule Attica |
| 22 | * |
| 23 | * \brief Represents a server config. |
| 24 | */ |
| 25 | class ATTICA_EXPORT Config |
| 26 | { |
| 27 | public: |
| 28 | /*! |
| 29 | * |
| 30 | */ |
| 31 | typedef QList<Config> List; |
| 32 | class Parser; |
| 33 | |
| 34 | /*! |
| 35 | * Creates an empty Config |
| 36 | */ |
| 37 | Config(); |
| 38 | |
| 39 | Config(const Config &other); |
| 40 | |
| 41 | Config &operator=(const Config &other); |
| 42 | |
| 43 | ~Config(); |
| 44 | |
| 45 | /*! |
| 46 | * |
| 47 | */ |
| 48 | QString contact() const; |
| 49 | |
| 50 | /*! |
| 51 | * |
| 52 | */ |
| 53 | QString host() const; |
| 54 | |
| 55 | /*! |
| 56 | * |
| 57 | */ |
| 58 | QString version() const; |
| 59 | |
| 60 | /*! |
| 61 | * |
| 62 | */ |
| 63 | bool ssl() const; |
| 64 | |
| 65 | /*! |
| 66 | * |
| 67 | */ |
| 68 | QString website() const; |
| 69 | |
| 70 | /*! |
| 71 | * |
| 72 | */ |
| 73 | void setContact(const QString &contact); |
| 74 | |
| 75 | /*! |
| 76 | * |
| 77 | */ |
| 78 | void setHost(const QString &host); |
| 79 | |
| 80 | /*! |
| 81 | * |
| 82 | */ |
| 83 | void setSsl(bool ssl); |
| 84 | |
| 85 | /*! |
| 86 | * |
| 87 | */ |
| 88 | void setVersion(const QString &version); |
| 89 | |
| 90 | /*! |
| 91 | * |
| 92 | */ |
| 93 | void setWebsite(const QString &website); |
| 94 | |
| 95 | /*! |
| 96 | * Returns whether this config is valid |
| 97 | */ |
| 98 | bool isValid() const; |
| 99 | |
| 100 | private: |
| 101 | class Private; |
| 102 | QSharedDataPointer<Private> d; |
| 103 | }; |
| 104 | |
| 105 | } |
| 106 | |
| 107 | #endif |
| 108 | |