File indexing completed on 2024-12-01 03:37:34

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2018 Ralf Habacker <ralf.habacker@freenet.de>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 #ifndef ATTICA_CONFIG_H
0009 #define ATTICA_CONFIG_H
0010 
0011 #include <QSharedDataPointer>
0012 #include <QString>
0013 
0014 #include "attica_export.h"
0015 
0016 namespace Attica
0017 {
0018 /**
0019  * @class Config config.h <Attica/Config>
0020  *
0021  * Represents a server config
0022  */
0023 class ATTICA_EXPORT Config
0024 {
0025 public:
0026     typedef QList<Config> List;
0027     class Parser;
0028 
0029     /**
0030      * Creates an empty Config
0031      */
0032     Config();
0033 
0034     /**
0035      * Copy constructor.
0036      * @param other the Config to copy from
0037      */
0038     Config(const Config &other);
0039 
0040     /**
0041      * Assignment operator.
0042      * @param other the Config to assign from
0043      * @return pointer to this Config
0044      */
0045     Config &operator=(const Config &other);
0046 
0047     /**
0048      * Destructor.
0049      */
0050     ~Config();
0051 
0052     QString contact() const;
0053     QString host() const;
0054     QString version() const;
0055     bool ssl() const;
0056     QString website() const;
0057 
0058     void setContact(const QString &contact);
0059     void setHost(const QString &host);
0060     void setSsl(bool ssl);
0061     void setVersion(const QString &version);
0062     void setWebsite(const QString &website);
0063 
0064     /**
0065      * Checks whether this config is valid
0066      * @return @c true if config is valid, @c false otherwise
0067      */
0068     bool isValid() const;
0069 
0070 private:
0071     class Private;
0072     QSharedDataPointer<Private> d;
0073 };
0074 
0075 }
0076 
0077 #endif