File indexing completed on 2024-04-28 08:51:00

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     explicit RdpHostPreferences(KConfigGroup configGroup, QObject *parent = nullptr);
0052     ~RdpHostPreferences() override;
0053 
0054     bool scaleToSize() const;
0055     void setScaleToSize(bool scale);
0056 
0057     Resolution resolution() const;
0058     void setResolution(Resolution resolution);
0059 
0060     ColorDepth colorDepth() const;
0061     void setColorDepth(ColorDepth colorDepth);
0062 
0063     QString keyboardLayout() const;
0064     int rdpKeyboardLayout() const;
0065     void setKeyboardLayout(const QString &keyboardLayout);
0066 
0067     Sound sound() const;
0068     void setSound(Sound sound);
0069 
0070     Acceleration acceleration() const;
0071     void setAcceleration(Acceleration acceleration);
0072 
0073     void setShareMedia(const QString &shareMedia);
0074     QString shareMedia() const;
0075 
0076 protected:
0077     QWidget* createProtocolSpecificConfigPage() override;
0078     void acceptConfig() override;
0079 
0080 private:
0081     void updateWidthHeight(Resolution resolution);
0082     void updateColorDepth(Acceleration acceleration);
0083 
0084     Ui::RdpPreferences rdpUi;
0085 };
0086 
0087 #endif