mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
IRCClient: Start working on a simple graphical IRC client.
This will be a nice way to exercise both LibGUI and the TCP/IP support. :^)
This commit is contained in:
parent
f87dec1cbf
commit
aa19735c5a
18 changed files with 779 additions and 1 deletions
45
Applications/IRCClient/IRCChannel.h
Normal file
45
Applications/IRCClient/IRCChannel.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/CircularQueue.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/Retainable.h>
|
||||
#include <AK/RetainPtr.h>
|
||||
#include "IRCLogBuffer.h"
|
||||
|
||||
class IRCClient;
|
||||
|
||||
class IRCChannel : public Retainable<IRCChannel> {
|
||||
public:
|
||||
static Retained<IRCChannel> create(IRCClient&, const String&);
|
||||
~IRCChannel();
|
||||
|
||||
bool is_open() const { return m_open; }
|
||||
void set_open(bool b) { m_open = b; }
|
||||
|
||||
String name() const { return m_name; }
|
||||
|
||||
void add_member(const String& name, char prefix);
|
||||
void remove_member(const String& name);
|
||||
|
||||
void add_message(char prefix, const String& name, const String& text);
|
||||
|
||||
void dump() const;
|
||||
|
||||
const IRCLogBuffer& log() const { return *m_log; }
|
||||
IRCLogBuffer& log() { return *m_log; }
|
||||
|
||||
private:
|
||||
IRCChannel(IRCClient&, const String&);
|
||||
|
||||
IRCClient& m_client;
|
||||
String m_name;
|
||||
struct Member {
|
||||
String name;
|
||||
char prefix { 0 };
|
||||
};
|
||||
Vector<Member> m_members;
|
||||
bool m_open { false };
|
||||
|
||||
Retained<IRCLogBuffer> m_log;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue