File indexing completed on 2024-04-21 04:58:35

0001 /*
0002 SPDX-FileCopyrightText: 2007-2012 Urs Wolfer <uwolfer@kde.org>
0003 SPDX-FileCopyrightText: 2012 AceLan Kao <acelan@acelan.idv.tw>
0004 
0005 SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef RDPHOSTPREFERENCES_H
0009 #define RDPHOSTPREFERENCES_H
0010 
0011 #include "hostpreferences.h"
0012 #include "ui_rdppreferences.h"
0013 
0014 #include <QFileDialog>
0015 
0016 class RdpHostPreferences : public HostPreferences
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     enum class Resolution {
0022         Small,
0023         Medium,
0024         Large,
0025         MatchWindow,
0026         MatchScreen,
0027         Custom,
0028     };
0029 
0030     enum class Sound {
0031         Local,
0032         Remote,
0033         Disabled,
0034     };
0035 
0036     enum class Acceleration {
0037         Auto,
0038         ForceGraphicsPipeline,
0039         ForceRemoteFx,
0040         Disabled,
0041     };
0042 
0043     enum class ColorDepth {
0044         Auto,
0045         Depth32,
0046         Depth24,
0047         Depth16,
0048         Depth8,
0049     };
0050 
0051     enum class TlsSecLevel {
0052         Any,
0053         Bit80,
0054         Bit112,
0055         Bit128,
0056         Bit192,
0057         Bit256,
0058     };
0059 
0060     explicit RdpHostPreferences(KConfigGroup configGroup, QObject *parent = nullptr);
0061     ~RdpHostPreferences() override;
0062 
0063     bool scaleToSize() const;
0064     void setScaleToSize(bool scale);
0065 
0066     Resolution resolution() const;
0067     void setResolution(Resolution resolution);
0068 
0069     ColorDepth colorDepth() const;
0070     void setColorDepth(ColorDepth colorDepth);
0071 
0072     QString keyboardLayout() const;
0073     int rdpKeyboardLayout() const;
0074     void setKeyboardLayout(const QString &keyboardLayout);
0075 
0076     Sound sound() const;
0077     void setSound(Sound sound);
0078 
0079     Acceleration acceleration() const;
0080     void setAcceleration(Acceleration acceleration);
0081 
0082     void setShareMedia(const QString &shareMedia);
0083     QString shareMedia() const;
0084 
0085     TlsSecLevel tlsSecLevel() const;
0086     void setTlsSecLevel(TlsSecLevel tlsSecLevel);
0087 
0088 protected:
0089     QWidget *createProtocolSpecificConfigPage() override;
0090     void acceptConfig() override;
0091 
0092 private:
0093     void updateWidthHeight(Resolution resolution);
0094     void updateColorDepth(Acceleration acceleration);
0095 
0096     Ui::RdpPreferences rdpUi;
0097 };
0098 
0099 #endif