using Microsoft.AspNetCore.SignalR.Client;
using QtCNETAPI.Dtos.User;
using QtCNETAPI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace QtCNETAPI.Services.GatewayService
{
public interface IGatewayService
{
// VARIABLES
///
/// The Current Room The Current User Is In
///
public Room? CurrentRoom { get; }
///
/// Is The User Currently In The Lobby?
///
public bool InLobby { get; }
///
/// The Current Connection To The Gateway
///
public HubConnection? HubConnection { get; }
// FUNCTIONS
///
/// The Function Used To Connect To The Gateway Server Asynchronously
///
///
public Task StartAsync();
///
/// Stops The Connection To The Gateway Server
///
///
public Task StopAsync();
///
/// Disposes Of The Gateway Connection And Clears Other Variables
///
///
public Task DisposeAsync();
///
/// Joins The Lobby Of The Server
///
///
/// Thrown if the function is called before the connection is established.
public Task JoinLobbyAsync();
///
/// Joins The Current User To A Room On The Server
///
/// Room To Join
///
/// Thrown if the function is called before the connection is established.
public Task JoinRoomAsync(Room room);
///
/// Leaves The Current Room The Current User Is In
///
///
public Task LeaveRoomAsync();
///
/// Posts A Message To Whatever Room The User Is In
///
/// Message To Post
///
/// Thrown if the function is called before the connection is established.
public Task PostMessageAsync(Message message);
///
/// Sends A Direct Message To The Specified User
///
/// The User You Wish To DM
/// Yourself
///
///
public Task SendDirectMessageAsync(UserInformationDto user, Message message);
///
/// Refreshes Contacts List For A Specified User
///
/// The User You Wish To Refresh
/// Yourself
///
public Task RefreshContactsForUser(UserInformationDto user);
///
/// Updates The Status For The Current User
///
/// The Status You Want To Set On The Current User
///
public Task UpdateStatus(int status);
// EVENTS
///
/// When A Server Message Is Received, This Event Fires
///
public event EventHandler OnServerMessageReceived;
///
/// When A Client Function/Event Is Received, This Event Fires
///
public event EventHandler OnClientFunctionReceived;
///
/// When The Client Received A DM, This Event Fires
///
public event EventHandler OnDirectMessageReceived;
///
/// When The Server Config Is Received, This Event Fires
///
public event EventHandler OnServerConfigReceived;
///
/// When The Connection To The Gateway Is Lost, This Event Fires
///
public event EventHandler OnServerDisconnect;
///
/// When The Connection Attempts To Reconnect, This Event Fires
///
public event EventHandler OnServerReconnecting;
///
/// When the Connection Reconnects, This Event Fires
///
public event EventHandler OnServerReconnected;
}
}