diff --git a/framebuffers/xcb/xcb_framebuffer.h b/framebuffers/xcb/xcb_framebuffer.h index 6be8c1d..684c566 100644 --- a/framebuffers/xcb/xcb_framebuffer.h +++ b/framebuffers/xcb/xcb_framebuffer.h @@ -1,48 +1,48 @@ /* This file is part of the KDE project Copyright (C) 2017 Alexey Min This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H #define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H #include "framebuffer.h" #include #include /** @author Alexey Min */ class XCBFrameBuffer: public FrameBuffer { Q_OBJECT public: - XCBFrameBuffer(WId winid, QObject *parent = nullptr); + explicit XCBFrameBuffer(WId winid, QObject *parent = nullptr); ~XCBFrameBuffer() override; public: QList modifiedTiles() override; int depth() override; int height() override; int width() override; int paddedWidth() override; void getServerFormat(rfbPixelFormat &format) override; void startMonitor() override; void stopMonitor() override; public: void handleXDamageNotify(xcb_generic_event_t *xevent); private: void cleanupRects(); class P; P *const d; }; #endif diff --git a/krfb/connectiondialog.h b/krfb/connectiondialog.h index b2a844f..229185c 100644 --- a/krfb/connectiondialog.h +++ b/krfb/connectiondialog.h @@ -1,69 +1,69 @@ /* This file is part of the KDE project Copyright (C) 2010 Collabora Ltd @author George Kiagiadakis Copyright (C) 2004 Nadeem Hasan This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CONNECTIONDIALOG_H #define CONNECTIONDIALOG_H #include "ui_connectionwidget.h" #include template class ConnectionDialog : public QDialog { public: - ConnectionDialog(QWidget *parent); + explicit ConnectionDialog(QWidget *parent); ~ConnectionDialog() override {}; void setAllowRemoteControl(bool b); bool allowRemoteControl(); protected: QWidget *m_connectWidget; UI m_ui; }; template void ConnectionDialog::setAllowRemoteControl(bool b) { m_ui.cbAllowRemoteControl->setChecked(b); m_ui.cbAllowRemoteControl->setVisible(b); } template bool ConnectionDialog::allowRemoteControl() { return m_ui.cbAllowRemoteControl->isChecked(); } //********* class InvitationsConnectionDialog : public ConnectionDialog { Q_OBJECT public: InvitationsConnectionDialog(QWidget *parent); void setRemoteHost(const QString & host); }; //********* #endif // CONNECTIONDIALOG_H diff --git a/krfb/invitationsrfbclient.h b/krfb/invitationsrfbclient.h index a44dffd..3e4fe51 100644 --- a/krfb/invitationsrfbclient.h +++ b/krfb/invitationsrfbclient.h @@ -1,51 +1,51 @@ /* Copyright (C) 2010 Collabora Ltd @author George Kiagiadakis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef INVITATIONSRFBCLIENT_H #define INVITATIONSRFBCLIENT_H #include "rfbclient.h" class InvitationsRfbClient : public RfbClient { public: - InvitationsRfbClient(rfbClientPtr client, QObject* parent = nullptr) + explicit InvitationsRfbClient(rfbClientPtr client, QObject* parent = nullptr) : RfbClient(client, parent) {} }; class PendingInvitationsRfbClient : public PendingRfbClient { Q_OBJECT public: - PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = nullptr); + explicit PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent = nullptr); ~PendingInvitationsRfbClient() override; protected Q_SLOTS: void processNewClient() override; virtual void onSocketActivated(); bool checkPassword(const QByteArray & encryptedPassword) override; private Q_SLOTS: void dialogAccepted(); private: struct Private; Private* const d; }; #endif // INVITATIONSRFBCLIENT_H diff --git a/krfb/mainwindow.h b/krfb/mainwindow.h index ddf5871..945ec91 100644 --- a/krfb/mainwindow.h +++ b/krfb/mainwindow.h @@ -1,49 +1,49 @@ /* This file is part of the KDE project Copyright (C) 2007 Alessandro Praduroux Copyright (C) 2013 Amandeep Singh This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef MANAGEINVITATIONSDIALOG_H #define MANAGEINVITATIONSDIALOG_H #include "ui_mainwidget.h" #include class KLineEdit; class MainWindow : public KXmlGuiWindow { Q_OBJECT public: - MainWindow(QWidget *parent = nullptr); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow() override; public Q_SLOTS: void showConfiguration(); protected: void readProperties(const KConfigGroup & group) override; void saveProperties(KConfigGroup & group) override; private Q_SLOTS: void editPassword(); void editUnattendedPassword(); void toggleDesktopSharing(bool enable); void passwordChanged(const QString&); void aboutConnectionAddress(); void aboutUnattendedMode(); private: Ui::MainWidget m_ui; bool m_passwordEditable; KLineEdit *m_passwordLineEdit; }; #endif diff --git a/krfb/rfbclient.h b/krfb/rfbclient.h index 9b94573..a9c9591 100644 --- a/krfb/rfbclient.h +++ b/krfb/rfbclient.h @@ -1,109 +1,109 @@ /* Copyright (C) 2009-2010 Collabora Ltd @author George Goldberg @author George Kiagiadakis Copyright (C) 2007 Alessandro Praduroux This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef RFBCLIENT_H #define RFBCLIENT_H #include "rfb.h" #include class RfbClient : public QObject { Q_OBJECT Q_PROPERTY(bool controlEnabled READ controlEnabled WRITE setControlEnabled NOTIFY controlEnabledChanged) Q_PROPERTY(bool onHold READ isOnHold WRITE setOnHold NOTIFY holdStatusChanged) public: - RfbClient(rfbClientPtr client, QObject *parent = nullptr); + explicit RfbClient(rfbClientPtr client, QObject *parent = nullptr); ~RfbClient() override; /** Returns a name for the client, to be shown to the user */ virtual QString name() const; static bool controlCanBeEnabled(); bool controlEnabled() const; bool isOnHold() const; public Q_SLOTS: void setControlEnabled(bool enabled); void setOnHold(bool onHold); void closeConnection(); Q_SIGNALS: void controlEnabledChanged(bool enabled); void holdStatusChanged(bool onHold); protected: friend class RfbServer; //the following event handling methods are called by RfbServer rfbClientPtr getRfbClientPtr(); virtual void handleKeyboardEvent(bool down, rfbKeySym keySym); virtual void handleMouseEvent(int buttonMask, int x, int y); private Q_SLOTS: void onSocketActivated(); private: ///called by RfbServerManager to send framebuffer updates ///and check for possible disconnection void update(); friend class RfbServerManager; struct Private; Private *const d; }; class PendingRfbClient : public QObject { Q_OBJECT public: - PendingRfbClient(rfbClientPtr client, QObject *parent = nullptr); + explicit PendingRfbClient(rfbClientPtr client, QObject *parent = nullptr); ~PendingRfbClient() override; Q_SIGNALS: void finished(RfbClient *client); protected Q_SLOTS: virtual void processNewClient() = 0; void accept(RfbClient *newClient); void reject(); protected: friend class RfbServer; //Following two methods are handled by RfbServer /** This method is supposed to check if the provided \a encryptedPassword * matches the criteria for authenticating the client. * The default implementation returns false if a password is required. * Reimplement to do more useful stuff. */ virtual bool checkPassword(const QByteArray & encryptedPassword); /** This method checks if the \a encryptedPassword that was sent from the remote * user matches the \a password that you have specified localy to be the password * for this connection. This assumes that the standard VNC authentication mechanism * is used. Returns true if the password matches or false otherwise. */ bool vncAuthCheckPassword(const QByteArray & password, const QByteArray & encryptedPassword) const; rfbClientPtr m_rfbClient; }; #endif // RFBCLIENT_H diff --git a/krfb/rfbserver.h b/krfb/rfbserver.h index 40760bc..b0483d4 100644 --- a/krfb/rfbserver.h +++ b/krfb/rfbserver.h @@ -1,72 +1,72 @@ /* Copyright (C) 2009-2010 Collabora Ltd @author George Goldberg @author George Kiagiadakis Copyright (C) 2007 Alessandro Praduroux This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef RFBSERVER_H #define RFBSERVER_H #include "rfb.h" #include "rfbclient.h" #include class RfbServer : public QObject { Q_OBJECT public: - RfbServer(QObject *parent = nullptr); + explicit RfbServer(QObject *parent = nullptr); ~RfbServer() override; QByteArray listeningAddress() const; int listeningPort() const; bool passwordRequired() const; void setListeningAddress(const QByteArray & address); void setListeningPort(int port); void setPasswordRequired(bool passwordRequired); public Q_SLOTS: virtual bool start(); virtual void stop(); void updateScreen(const QList & modifiedTiles); void updateCursorPosition(const QPoint & position); private Q_SLOTS: void krfbSendServerCutText(); void onListenSocketActivated(); void pendingClientFinished(RfbClient *client); protected: virtual PendingRfbClient *newClient(rfbClientPtr client) = 0; private: static rfbNewClientAction newClientHook(rfbClientPtr cl); static void clientGoneHook(rfbClientPtr cl); static rfbBool passwordCheck(rfbClientPtr cl, const char *encryptedPassword, int len); static void keyboardHook(rfbBool down, rfbKeySym keySym, rfbClientPtr cl); static void pointerHook(int bm, int x, int y, rfbClientPtr cl); static void clipboardHook(char *str, int len, rfbClientPtr cl); Q_DISABLE_COPY(RfbServer) struct Private; Private *const d; }; #endif // RFBSERVER_H diff --git a/krfb/trayicon.h b/krfb/trayicon.h index 4744ff1..6517e4a 100644 --- a/krfb/trayicon.h +++ b/krfb/trayicon.h @@ -1,47 +1,47 @@ /*************************************************************************** trayicon.h - description ------------------- begin : Tue Dec 11 2001 copyright : (C) 2001-2002 by Tim Jansen email : tim@tjansen.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef TRAYICON_H #define TRAYICON_H #include class RfbClient; class ClientActions; /** * Implements the trayicon. * @author Tim Jansen */ class TrayIcon : public KStatusNotifierItem { Q_OBJECT public: - TrayIcon(QWidget *mainWindow); + explicit TrayIcon(QWidget *mainWindow); public Q_SLOTS: void onClientConnected(RfbClient *client); void onClientDisconnected(RfbClient *client); void showAbout(); private: QAction *m_aboutAction; QHash m_clientActions; }; #endif