VR-Engage  2.3
Loading...
Searching...
No Matches
vreChatWindowInterface.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreChatWindowInterface.h
7//! \brief Declares the DtChatWindowInterface pure abstract interface.
8//!
9//! This header has no Qt dependency and may be included from any translation
10//! unit, including those in the backend simulation layer.
11
12#pragma once
13
15
16#include <string>
17#include <vector>
18
19namespace makVre
20{
21
22//! \brief Pure abstract interface for the chat window component.
23//!
24//! DtChatWindowInterface defines the operations that DtVreChatManager uses to
25//! drive the chat UI without depending on Qt. Implementations are free to use
26//! Qt internally; callers only see this Qt-free surface.
28{
29public:
30 //! \brief Virtual destructor
31 virtual ~DtChatWindowInterface() = default;
32
33 // -------------------------------------------------------------------------
34 // Send pipeline
35 // -------------------------------------------------------------------------
36
37 //! \brief Sends a message or slash command to the chat system
38 //! \param message Text message or /command string
39 virtual void send(const std::string& message) = 0;
40
41 //! \brief Sends a chat message to a specific channel
42 //! \param message Text message to send
43 //! \param channel Target channel name
44 //! \param force Force identifier for the channel
45 virtual void sendChatMessage(const std::string& message,
46 const std::string& channel, int force) = 0;
47
48 //! \brief Sends a message to the system (notification) channel
49 //! \param message Text to display in the system channel
50 virtual void sendToSystemChannel(const std::string& message) = 0;
51
52 //! \brief Checks whether a channel is currently active
53 //! \param channelName Name of the channel to check
54 //! \param force Force identifier of the channel
55 //! \return True if the channel is active, false otherwise
56 virtual bool isChannelActive(const std::string& channelName, int force) const = 0;
57
58 // -------------------------------------------------------------------------
59 // Channel management
60 // -------------------------------------------------------------------------
61
62 //! \brief Adds a channel to the available channels list
63 //! \param channelName Name of the channel
64 //! \param force Force identifier associated with the channel
65 //! \param active Whether the channel starts active
66 //! \param entities List of entity markings that belong to this channel
67 //! \return True if the channel was added, false if it already existed
68 virtual bool addChannel(const std::string& channelName, int force,
69 bool active, const std::vector<std::string>& entities) = 0;
70
71 //! \brief Refreshes the active-channel list based on current entity state
72 virtual void updateAvailableChannels() = 0;
73
74 //! \brief Removes all channels from the chat system
75 virtual void clearChannels() = 0;
76
77 //! \brief Sets the entity marking text used for username generation
78 //! \param text Marking (call sign) of the local entity
79 virtual void setEntityMarkingText(const std::string& text) = 0;
80
81 //! \brief Sets the entity force identifier used for channel filtering
82 //! \param force Force identifier
83 virtual void setEntityForce(int force) = 0;
84
85 //! \brief Sets the entity role used for username generation
86 //! \param role Role description string
87 virtual void setEntityRole(const std::string& role) = 0;
88
89 //! \brief Regenerates the displayed username from current settings
90 virtual void updateUsername() = 0;
91
92 // -------------------------------------------------------------------------
93 // UI state
94 // -------------------------------------------------------------------------
95
96 //! \brief Displays an incoming chat message received over the network
97 //! \param username Sender's username
98 //! \param force Force identifier of the sender
99 //! \param channel Channel the message arrived on
100 //! \param message Raw message text (will be HTML-converted by the implementation)
101 virtual void displayReceivedMessage(const std::string& username, int force,
102 const std::string& channel, const std::string& message) = 0;
103
104 //! \brief Opens the chat window
105 virtual void open() = 0;
106
107 //! \brief Closes the chat window
108 virtual void close() = 0;
109
110 //! \brief Opens the window or gives focus to the input if already open
111 virtual void openOrFocus() = 0;
112
113 //! \brief Toggles the pinned (always-visible) state of the chat window
114 virtual void togglePinChat() = 0;
115
116 //! \brief Returns whether the chat window root item is visible
117 virtual bool isVisible() const = 0;
118
119 //! \brief Returns whether the full chat panel (not just the notification strip) is visible
120 virtual bool isFullChatVisible() const = 0;
121
122 //! \brief Returns whether the chat window is permitted to be shown
123 virtual bool isShowingAllowed() const = 0;
124
125 //! \brief Sets whether the chat window is permitted to be shown
126 //! \param canShow True to permit display, false to block it
127 virtual void setShowingAllowed(bool canShow) = 0;
128
129 //! \brief Adjusts chat window layout for the given application state
130 //! \param state Application state identifier string
131 virtual void updatePositionFromState(const std::string& state) = 0;
132};
133
134} // namespace makVre
Pure abstract interface for the chat window component.
Definition vreChatWindowInterface.h:28
virtual void sendChatMessage(const std::string &message, const std::string &channel, int force)=0
Sends a chat message to a specific channel.
virtual void updateUsername()=0
Regenerates the displayed username from current settings.
virtual void updateAvailableChannels()=0
Refreshes the active-channel list based on current entity state.
virtual void send(const std::string &message)=0
Sends a message or slash command to the chat system.
virtual void displayReceivedMessage(const std::string &username, int force, const std::string &channel, const std::string &message)=0
Displays an incoming chat message received over the network.
virtual void close()=0
Closes the chat window.
virtual bool isFullChatVisible() const =0
Returns whether the full chat panel (not just the notification strip) is visible.
virtual bool addChannel(const std::string &channelName, int force, bool active, const std::vector< std::string > &entities)=0
Adds a channel to the available channels list.
virtual void openOrFocus()=0
Opens the window or gives focus to the input if already open.
virtual bool isShowingAllowed() const =0
Returns whether the chat window is permitted to be shown.
virtual ~DtChatWindowInterface()=default
Virtual destructor.
virtual void setEntityRole(const std::string &role)=0
Sets the entity role used for username generation.
virtual void sendToSystemChannel(const std::string &message)=0
Sends a message to the system (notification) channel.
virtual void updatePositionFromState(const std::string &state)=0
Adjusts chat window layout for the given application state.
virtual void setShowingAllowed(bool canShow)=0
Sets whether the chat window is permitted to be shown.
virtual bool isChannelActive(const std::string &channelName, int force) const =0
Checks whether a channel is currently active.
virtual void clearChannels()=0
Removes all channels from the chat system.
virtual void open()=0
Opens the chat window.
virtual void togglePinChat()=0
Toggles the pinned (always-visible) state of the chat window.
virtual void setEntityForce(int force)=0
Sets the entity force identifier used for channel filtering.
virtual bool isVisible() const =0
Returns whether the chat window root item is visible.
virtual void setEntityMarkingText(const std::string &text)=0
Sets the entity marking text used for username generation.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
!
Definition glsVreMessageUtil.h:50