File indexing completed on 2024-05-19 05:04:05
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "libruqolawidgets_private_export.h" 0009 #include <QPushButton> 0010 class LIBRUQOLAWIDGETS_TESTS_EXPORT RoomAvatarWidget : public QPushButton 0011 { 0012 Q_OBJECT 0013 public: 0014 explicit RoomAvatarWidget(QWidget *parent = nullptr); 0015 ~RoomAvatarWidget() override; 0016 0017 [[nodiscard]] QString roomAvatar() const; 0018 0019 [[nodiscard]] bool wasChanged() const; 0020 0021 void setCurrentIconPath(const QString ¤tPath); 0022 0023 protected: 0024 void contextMenuEvent(QContextMenuEvent *event) override; 0025 0026 private: 0027 LIBRUQOLAWIDGETS_NO_EXPORT void slotCancel(); 0028 LIBRUQOLAWIDGETS_NO_EXPORT void slotChangeImage(); 0029 LIBRUQOLAWIDGETS_NO_EXPORT void slotResetAvatar(); 0030 QString mCurrentIconPath; 0031 QString mRoomAvatarPath; 0032 bool mWasChanged = false; 0033 };