File indexing completed on 2026-02-08 05:25:54

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Sandro Knauß <knauss@kolabsys.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 // This code was taken from kmail-account-wizard
0008 
0009 #pragma once
0010 
0011 #include "autoconfigkolabmail.h"
0012 
0013 struct freebusy;
0014 
0015 class AutoconfigKolabFreebusy : public AutoconfigKolabMail
0016 {
0017     Q_OBJECT
0018 public:
0019     /** Constructor */
0020     explicit AutoconfigKolabFreebusy(QObject *parent = nullptr);
0021 
0022     QHash<QString, freebusy> freebusyServers() const;
0023 
0024 protected:
0025     void lookupInDb(bool auth, bool crypt) override;
0026     void parseResult(const QDomDocument &document) override;
0027 
0028 private:
0029     freebusy createFreebusyServer(const QDomElement &n);
0030 
0031     QHash<QString, freebusy> mFreebusyServer;
0032 };
0033 
0034 struct freebusy {
0035     freebusy()
0036         : port(80)
0037         , socketType(Ispdb::None)
0038         , authentication(Ispdb::Plain)
0039     {
0040     }
0041 
0042     bool isValid() const
0043     {
0044         return port != -1;
0045     }
0046 
0047     QString hostname;
0048     QString username;
0049     QString password;
0050     QString path;
0051     int port;
0052     Ispdb::socketType socketType;
0053     Ispdb::authType authentication;
0054 };
0055