⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chatchannelpage.h

📁 Last change: 2008-02-03 This is the source code of KCeasy。
💻 H
字号:
/*
This file is part of KCeasy (http://www.kceasy.com)
Copyright (C) 2002-2005 Markus Kern <mkern@kceasy.com>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
*/
//---------------------------------------------------------------------------
#ifndef ChatChannelPageH
#define ChatChannelPageH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TChatUser : public TObject
{
public:
    TChatUser() : TObject(), Op(false), Voice(false) {}

    AnsiString Name;
    bool Op;
    bool Voice;
};

class TChatChannelFrame;
typedef void __fastcall (__closure *TChatChannelFrameCmdEvent)(TChatChannelFrame* ChannelFrame, AnsiString Cmd);

class TChatChannelFrame : public TFrame
{
__published:	// IDE-managed Components
    TSplitter *VSplitter;
    TPanel *UserPanel;
    TListBox *UserListBox;
    TPanel *TextPanel;
    TRichEdit *RecvRichEdit;
    TPanel *SendEditPanel;
    TEdit *SendEdit;
    TPanel *TopicPanel;
    TStaticText *TopicStatic;
    void __fastcall SendEditKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
    void __fastcall SendEditKeyPress(TObject *Sender, char &Key);
    void __fastcall UserListBoxDblClick(TObject *Sender);
    void __fastcall RecvRichEditKeyPress(TObject *Sender, char &Key);

__published:
    __property TChatChannelFrameCmdEvent OnCommand = {read=FOnCommand, write=FOnCommand, default=NULL};
    
protected:
    TChatChannelFrameCmdEvent FOnCommand;

private:	// User declarations
    TFont* ChatFont;
    AnsiString Channel;
    bool UserChat;

    TStringList* CmdHistory;
    int CmdHistoryIndex;
    static int const MaxHistorySize = 20;
    DWORD LastSendTime;

public:		// User declarations
    __fastcall TChatChannelFrame(TComponent* Owner, AnsiString Chan, bool User);
    __fastcall ~TChatChannelFrame();

    void SetChatFont(const TFont* Font);
    bool Print(AnsiString Text, TColor Color, bool Time = false, bool Star = false);

    // user management
    bool AddUser(AnsiString Name); // name can be "[@|+]fred"
    bool RemoveUser(AnsiString Name);
    bool ExistsUser(AnsiString Name);
    bool JoinUser(AnsiString Name, AnsiString Address, TColor Color);
    bool PartUser(AnsiString Name, AnsiString Address, AnsiString Message, TColor Color);
    bool RenameUser(AnsiString OldName, AnsiString NewName, TColor Color);
    bool QuitUser(AnsiString Name, AnsiString Address, AnsiString Message, TColor Color);
    bool KickUser(AnsiString Name, AnsiString Reason, AnsiString Oper, TColor Color);
    bool KillUser(AnsiString Name, AnsiString Reason, AnsiString Oper, TColor Color);
    bool ModeChange(AnsiString Mode, AnsiString Param, AnsiString Oper, TColor Color);

    // topic management
    bool SetTopic(AnsiString Topic, TColor Color);
    bool ChangeTopic(AnsiString User, AnsiString Topic, TColor Color);
    bool SetTopicInfo(AnsiString User, TDateTime When, TColor Color);

    const AnsiString& GetChannel() { return Channel; }
    bool IsUserChat() { return UserChat; }
};
//---------------------------------------------------------------------------
extern PACKAGE TChatChannelFrame *ChatChannelFrame;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -