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

📄 scbrktarget.h

📁 Source code for EMFexplorer 1.0
💻 H
字号:
/*
*	This file is part of the EMFexplorer projet.
*	Copyright (C) 2004 Smith Charles.
*
*	This library is free software; you can redistribute it and/or
*	modify it under the terms of the GNU Lesser General Public
*	License as published by the Free Software Foundation; either
*	version 2.1 of the License, or (at your option) any later version.
*
*   This library 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
*   Lesser General Public License for more details.
*
*   You should have received a copy of the GNU Lesser General Public
*   License along with this library; if not, write to the Free Software
*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
*
*	Extension: for commercial use, apply the Equity Public License, which
*	adds to the normal terms of the GLPL a condition of donation to the author.
*   If you are interested in support for this source code,
*   contact Smith Charles <smith.charles@free.fr> for more information.
*/
#ifndef _SCBRKTARGET_H_
#define _SCBRKTARGET_H_

#include "SCBrkDefs.h"
#include "SCGenTypes.h"

// Interface to be implemented by a callback to manage record breaking events
class I_SCBrkCallBack
{
public:
	virtual long OnSCBrkPos(long lCurPos)=0;
	virtual long OnSCBrkMaxPos(long lMaxPos)=0;
	virtual long OnSCBrkRecStr(long lCurPos, SCgenTCHAR *szRecStr)=0;
};

class SCBrkTarget
{
// Constructor/Destructor
public:
	SCBrkTarget();
	virtual ~SCBrkTarget();

// Methods
public:
	SC_BRKRESULT OnBrkRecord(long lMsg);
	virtual SC_BRKRESULT OnBrkUNKRecord(long lMsg);

//accessors
	// getters
#ifdef _DEBUG
    virtual CString SCGetClassName() const { return _T("SCBrkTarget"); };
#endif

	SC_BRKRESULT SCGetLastError() const { return m_nLastError; }
	void* SCGetLastRecord() const { return m_pRecord; }

	// setters
	void SCSetBrkCallBack(I_SCBrkCallBack *pBrkCallBack) {m_pIBrkCallBack=pBrkCallBack;}

protected:
	virtual long SCGetRecordSize() const { return 0; }
	void* SCCloneRecord() const;
	void SCFreeCloneRecord(void* pCloneRec) const { ASSERT(pCloneRec); delete [] pCloneRec; }
	void SCSetError(SC_BRKRESULT nError) { m_nLastError = nError; }
	SC_BRKRESULT SCInitBreak();

	SC_DECLARE_MESSAGE_MAP()       // base class - no {{ }} macros
#ifdef SC_USE_FLATMSGMAP
	void				SCFlattenMessageMap();
#endif

//shared
protected:
	I_SCBrkCallBack*	m_pIBrkCallBack; // installed callback
	void*				m_pRecord;		 // current record
	SC_BRKRESULT		m_nLastError;	 // error while parsing last record

//data
private:
#ifdef SC_USE_FLATMSGMAP
	PCSC_MSGMAP_ENTRY*	m_pFlatMsgMap;   // message map entries with inheritance solved
	long				m_lMaxMsg;
	inline const SC_MSGMAP_ENTRY* SCFindMessageEntry(long lMsg);
#endif

//prohibited calls
private:
 /*No default =*/void operator=(const SCBrkTarget &rCopySCBrkTarget) { ; }
 /*No default copy*/SCBrkTarget(const SCBrkTarget &rCopySCBrkTarget) { ; }
};

#endif //_SCBRKTARGET_H_
//  ------------------------------------------------------------

⌨️ 快捷键说明

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