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

📄 messageitem.h

📁 Simple Jabber Client for Symbian Platform
💻 H
字号:
/*
 *  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.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  Jabber
 *  Copyright (C) 2004 Xie Tian Lu  http://sabber.jabberstudio.org/
 */



#ifndef __MESSAGEITEM_H__
#define __MESSAGEITEM_H__

#include "UUListItem.h"

class CIconSet;

#define HEAP_ALLOC		1

class CMessageItem : public MUUListItem
{
public:
	static CMessageItem* CreateMessageItem( char* from, char* to, char* body, TBool recv );
    virtual ~CMessageItem();

private:
	CMessageItem();

public:
	virtual void ItemDraw( CWindowGc* gc, const TRect& aBox, TInt aItemHeight );
	virtual void ItemDraw( CWindowGc* gc, const TRect& aBox, TInt aItemHeight, CFont* aFont );
	virtual TInt ViewLineNum();
	virtual TInt LineNum();

public:
	void DrawContent( CWindowGc* gc, int lines, int l, int r, int x, int y, int aLineHeight, CFont* aFont );
	void SetTimeStamp( TDesC& aStamp );
	void SetIconSet( CIconSet* aSet );
	char* GetDest();
	TBool IsReceived();
	char* GetFrom();
	char* GetTo();
	TDesC& GetTimeStamp();

private:
	void DrawIcon( CWindowGc* gc, const TRect& aBox );
	void DrawText( CWindowGc* gc, const TRect& aBox, TInt aItemHeight, CFont* aFont );
	TInt GetNextWord( const TDesC& txt, TInt pos, TDes& word );
	void FillOneLine( const TDesC& txt, TInt& pos, TInt left, TInt right, CFont* font );
	void DrawOneLine( CWindowGc* gc, const CFont* font, const TDesC& txt, TInt& pos, TInt left, TInt right, TInt y, TInt height );
	void CalcViewLineNum( CFont* aFont );

protected:
#ifdef HEAP_ALLOC
	char*			iFrom;
	char*			iTo;
	char*			iBody;
#else
	char			iFrom[ 128 ];
	char			iTo	 [ 128 ];
	char			iBody[ 512 ];
#endif
	TBuf< 32 >		iTime;			// date & time the message received or sent
	TBool			iReceived;
	TBool			iRead;
	CIconSet*		iIconSet;
	TInt			iViewLine;
};

#endif

⌨️ 快捷键说明

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