File indexing completed on 2024-12-01 04:37:00

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolawidgets_private_export.h"
0010 #include "roomheaderwidget.h"
0011 #include <QObject>
0012 #include <QPointer>
0013 class QMenu;
0014 class QAction;
0015 class Room;
0016 class LIBRUQOLAWIDGETS_TESTS_EXPORT ChannelActionPopupMenu : public QObject
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit ChannelActionPopupMenu(QObject *parent = nullptr);
0021     ~ChannelActionPopupMenu() override;
0022 
0023     [[nodiscard]] QMenu *menu() const;
0024     void setCurrentRocketChatAccount(RocketChatAccount *account);
0025 
0026     void setRoom(Room *room);
0027 Q_SIGNALS:
0028     void actionRequested(RoomHeaderWidget::ChannelActionType type);
0029 
0030 private:
0031     LIBRUQOLAWIDGETS_NO_EXPORT void slotUpdateMenu();
0032     LIBRUQOLAWIDGETS_NO_EXPORT void createMenu();
0033     LIBRUQOLAWIDGETS_NO_EXPORT QAction *createSeparator();
0034     QMenu *const mMenu;
0035     QAction *mShowMentions = nullptr;
0036     QAction *mShowPinnedMessages = nullptr;
0037     QAction *mShowStarredMessages = nullptr;
0038     QAction *mConfigureNotification = nullptr;
0039     QAction *mShowFileAttachments = nullptr;
0040     QAction *mShowDiscussions = nullptr;
0041     QAction *mShowThreads = nullptr;
0042     QAction *mAutoTranslate = nullptr;
0043     QAction *mAutoTranslateSeparator = nullptr;
0044     QAction *mInviteUsersGenerateUrl = nullptr;
0045     QAction *mInviteUsersGenerateUrlSeparator = nullptr;
0046     QAction *mAddUserInRoomsSeparator = nullptr;
0047     QAction *mAddUserInRooms = nullptr;
0048     QAction *mStartVideoChat = nullptr;
0049     QAction *mPruneMessages = nullptr;
0050     QAction *mPruneMessagesSeparator = nullptr;
0051     QAction *mExportMessages = nullptr;
0052     QAction *mOffTheRecordMessages = nullptr;
0053     QAction *mEncryptMessages = nullptr;
0054 
0055     QPointer<Room> mRoom;
0056     QPointer<RocketChatAccount> mCurrentRocketChatAccount;
0057 };