Room Drawer Media Tab
Add a tab bar to the room drawer which includes a new media tab in addition to the room information tab. This mr completes the architecture for adding others easily later e.g. message highlights or threads. To put this together I had to make sure things like the menus and the maximize delegate were available to both the room drawer and page so there is some rework there to put it all together. Wide\  Mobile\ 
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
#include <Quotient/uriresolver.h>
|
||||
|
||||
#include "chatdocumenthandler.h"
|
||||
#include "models/mediamessagefiltermodel.h"
|
||||
#include "models/messageeventmodel.h"
|
||||
#include "models/messagefiltermodel.h"
|
||||
|
||||
class NeoChatRoom;
|
||||
|
||||
@@ -36,6 +39,34 @@ class RoomManager : public QObject, public UriResolverBase
|
||||
*/
|
||||
Q_PROPERTY(NeoChatRoom *currentRoom READ currentRoom NOTIFY currentRoomChanged)
|
||||
|
||||
/**
|
||||
* @brief The MessageEventModel that should be used for room message visualisation.
|
||||
*
|
||||
* The room object the model uses to get the data will be updated by this class
|
||||
* so there is no need to do this manually or replace the model when a room
|
||||
* changes.
|
||||
*
|
||||
* @note Available here so that the room page and drawer both have access to the
|
||||
* same model.
|
||||
*/
|
||||
Q_PROPERTY(MessageEventModel *messageEventModel READ messageEventModel CONSTANT)
|
||||
|
||||
/**
|
||||
* @brief The MessageFilterModel that should be used for room message visualisation.
|
||||
*
|
||||
* @note Available here so that the room page and drawer both have access to the
|
||||
* same model.
|
||||
*/
|
||||
Q_PROPERTY(MessageFilterModel *messageFilterModel READ messageFilterModel CONSTANT)
|
||||
|
||||
/**
|
||||
* @brief The MediaMessageFilterModel that should be used for room media message visualisation.
|
||||
*
|
||||
* @note Available here so that the room page and drawer both have access to the
|
||||
* same model.
|
||||
*/
|
||||
Q_PROPERTY(MediaMessageFilterModel *mediaMessageFilterModel READ mediaMessageFilterModel CONSTANT)
|
||||
|
||||
/**
|
||||
* @brief Whether a room is currently open in NeoChat.
|
||||
*
|
||||
@@ -57,6 +88,10 @@ public:
|
||||
|
||||
NeoChatRoom *currentRoom() const;
|
||||
|
||||
MessageEventModel *messageEventModel() const;
|
||||
MessageFilterModel *messageFilterModel() const;
|
||||
MediaMessageFilterModel *mediaMessageFilterModel() const;
|
||||
|
||||
bool hasOpenRoom() const;
|
||||
|
||||
/**
|
||||
@@ -151,6 +186,15 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE void openResource(const QString &idOrUri, const QString &action = {});
|
||||
|
||||
/**
|
||||
* @brief Show a media item maximized.
|
||||
*
|
||||
* @param index the index to open the maximize delegate model at. This is the
|
||||
* index in the MediaMessageFilterModel owned by this RoomManager. A value
|
||||
* of -1 opens a the default item.
|
||||
*/
|
||||
Q_INVOKABLE void maximizeMedia(int index);
|
||||
|
||||
/**
|
||||
* @brief Call this when the current used connection is dropped.
|
||||
*/
|
||||
@@ -208,6 +252,15 @@ Q_SIGNALS:
|
||||
*/
|
||||
void showUserDetail(const Quotient::User *user);
|
||||
|
||||
/**
|
||||
* @brief Request a media item is shown maximized.
|
||||
*
|
||||
* @param index the index to open the maximize delegate model at. This is the
|
||||
* index in the MediaMessageFilterModel owned by this RoomManager. A value
|
||||
* of -1 opens a the default item.
|
||||
*/
|
||||
void showMaximizedMedia(int index);
|
||||
|
||||
/**
|
||||
* @brief Show the direct chat confirmation dialog.
|
||||
*
|
||||
@@ -232,4 +285,8 @@ private:
|
||||
KConfig m_config;
|
||||
KConfigGroup m_lastRoomConfig;
|
||||
QPointer<ChatDocumentHandler> m_chatDocumentHandler;
|
||||
|
||||
MessageEventModel *m_messageEventModel;
|
||||
MessageFilterModel *m_messageFilterModel;
|
||||
MediaMessageFilterModel *m_mediaMessageFilterModel;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user