48d0b7bc96
This is a commit with it's foot in a lot of places, but: The Conversation class was created as the abstraction of chats: All ImMessages that are relevant to a conversation get routed through it, meta-data on chats is stored in it (even if right now that's basically limited to the user list and ID). Server was given more methods to help accessing contacts― ContactById(BString) and AddContact(Contact*). This better allows Conversations to add and fetch Contacts as necessary. Right now, all users in chats are treated as Contacts, so in the future creating an independent userlist for Server (fUserMap?) would be useful. Server also now stores all Conversations (fChatMap) and has some convenience methods like for Contacts: Conversations(), ConversationById(BString), and AddConversation(Conversation*). CayaRenderView has been changed to not store user nicks, and will use the appropriate nick of any arbitrarily-numbered user. Users also have a map of all Conversations they are a part of (fChatMap). The Remove* methods of KeyMap now return the removed item.
54 lines
885 B
C++
54 lines
885 B
C++
#ifndef _CayaRenderView_H
|
|
#define _CayaRenderView_H_
|
|
|
|
#include <librunview/RunView.h>
|
|
|
|
#include <librunview/SmileTextRender.h>
|
|
|
|
class RunView;
|
|
class Theme;
|
|
|
|
|
|
enum CayaRenderViewColors {
|
|
COL_URL = 0,
|
|
COL_TIMESTAMP,
|
|
COL_TEXT,
|
|
COL_OWNNICK,
|
|
COL_OTHERNICK,
|
|
COL_ACTION,
|
|
COL_SELECTION,
|
|
COL_TIMESTAMP_DUMMY,
|
|
COL_MAX_COLORS
|
|
};
|
|
|
|
enum {
|
|
R_URL = 0,
|
|
R_TEXT,
|
|
R_TIMESTAMP,
|
|
R_ACTION,
|
|
R_EMOTICON,
|
|
R_TIMESTAMP_DUMMY,
|
|
MAX_RENDERS
|
|
};
|
|
|
|
|
|
class CayaRenderView : public RunView
|
|
{
|
|
public:
|
|
CayaRenderView(const char* name, const char* smileyConfig = NULL);
|
|
|
|
void AppendOtherMessage(const char* otherNick, const char* message);
|
|
void AppendOwnMessage(const char* message);
|
|
void AddEmoticText(const char * txt, int16 cols , int16 font , int16 cols2 , int16 font2);
|
|
|
|
protected:
|
|
void PrepareTheme(Theme* theme);
|
|
|
|
private:
|
|
Theme* fTheme;
|
|
SmileTextRender str;
|
|
|
|
};
|
|
|
|
#endif
|