Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Be Sweet - a set of visual source code browsers

, 1 Jul 2003
A set of source code and project browsers to compliment Visual Studio.
besweet-latest-greatest.zip
BeSweet-0.6.2
besweet-screen.jpg
ctags55
ctags.exe
dot-net-addin-experimental
AddIn.tlb
BeSweetDotNetAddin.dll
dte.tlh
install-screen-shot.jpg
MSADDNDR.tlh
MSO.tlh
ESBAddInSimulator.exe
ESBDSAddin.dll
ESBDSAddin.tlb
ESBServer.exe
ESBServer.ini
ESBServer.pdb
ESBServer.tlb
res
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
Copy of enum256.bmp
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
icon2.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline-icon-large.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
stlport_vc645.dll
besweet_061_src.zip
BeSweet_061_src
beswee-screen.jpg
EclipseStyleBrowsers.dsw
ESBDSAddin
ESBDSAddin.clw
ESBDSAddin.dsp
res
Commands.rgs
ESBDSAddin.rgs
TBarLrge.bmp
TBarMedm.bmp
src
ESBDSAddin.def
ESBDSAddinSimulator
src
ESBAddInSimulator.clw
ESBAddInSimulator.dsp
res
ESBAddInSimulator.ico
ESBDSAddin.rgs
ESBServer
bin
ctags55
ctags.exe
res
.cvsignore
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
Copy of enum256.bmp
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
icon2.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline-icon-large.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
doc
esbserver.proj
images
no_fields_a256.bmp
no_static_a256.bmp
outline.jpg
outlineProperties.jpg
public_only_a256.bmp
sort_a256.bmp
src
Controller
Browsers
ESBServer.clw
ESBServer.dsp
ESBServer.ini
ESBServer.rgs
ESBServerManager.rgs
ESBServerMgr.rgs
Model
CTags
MetaModel
Simulators
RemoteInterface
COM
Renderer
MFC
.#ESBServerCtrlPanel.cpp.1.20
3rdParty
OptionPage
Base
Browsers
.#ScopedNameBrowserRenderer.cpp.1.12
.#ScopedNameBrowserRenderer.h.1.12
Properties
res
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline-icon-large.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
prototype256.bmp
prototype_256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
Test
Utilities
bsuite_demo.zip
BeSweet_051
ctags54
ctags.exe
ESBDSAddin.dll
ESBDSAddin.exp
ESBDSAddin.tlb
ESBDSAddinSimulator.exe
ESBServer.exe
ESBServer.ini
ESBServer.ini.bak
ESBServer.pdb
ESBServer.tlb
regsvr32.trg
res
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
Copy of enum256.bmp
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
icon2.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
stlport_vc645.dll
bsuite_src.zip
EclipseStyleBrowsers
doc
images
architecture.jpg
hierarchybrowser.jpg
methodbrowser.jpg
outlinebrowser.jpg
overview.jpg
typebrowser.jpg
vsplugin.jpg
workspacebrowser.jpg
EclipseStyleBrowsers.dsw
ESBDSAddin
ESBDSAddin.dsp
res
Commands.rgs
ESBDSAddin.rgs
TBarLrge.bmp
TBarMedm.bmp
src
CVS
ESBDSAddin.def
ESBDSAddinSimulator
ESBDSAddinSimulator.clw
ESBDSAddinSimulator.dsp
res
ESBAddInSimulator.ico
src
ESBServer
bin
ctags54
ctags.exe
res
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
Copy of enum256.bmp
CVS
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
icon2.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
src
Controller
Browsers
CVS
CVS
CVS
ESBServer.clw
ESBServer.dsp
ESBServer.ini
ESBServer.rgs
ESBServerMgr.rgs
Model
CTags
CVS
CVS
MetaModel
CVS
Simulators
CVS
RemoteInterface
COM
CVS
CVS
Renderer
CVS
MFC
3rdParty
CVS
OptionPage
CVS
Base
CVS
Browsers
CVS
CVS
Properties
CVS
res
abstract256.bmp
class256.bmp
close_a256.bmp
close_f256.bmp
const256.bmp
Copy of enum256.bmp
CVS
enum256.bmp
ESBServer.ico
field256.bmp
function256.bmp
headerfile256.bmp
hierarchy.ico
icon2.ico
inherited_members_a256.bmp
inherited_members_f256.bmp
lock_hierarchy_a256.bmp
lock_hierarchy_f256.bmp
members_a256.bmp
method256.bmp
namespace256.bmp
no_fields_a256.bmp
no_field_f256.bmp
no_field_s256.bmp
no_public_a256.bmp
no_public_f256.bmp
no_public_s256.bmp
no_static_a256.bmp
no_static_f256.bmp
no_static_s256.bmp
outline-icon-large.bmp
outline.ico
outline256.bmp
overwriten256.bmp
packages_a256.bmp
package_browser.ico
previous_hierarchies_a256.bmp
previous_hierarchies_f256.bmp
private256.bmp
private_field256.bmp
private_method256.bmp
problem256.bmp
problem_256.bmp
protected256.bmp
protected_field256.bmp
protected_method256.bmp
public256.bmp
public_field256.bmp
public_method256.bmp
public_only_a256.bmp
public_only__f256.bmp
public__only_s256.bmp
questionmark256.bmp
questionmark_256.bmp
selection_arrow256.bmp
sort_a256.bmp
sort_f256.bmp
sort_s256.bmp
sourcefile256.bmp
static256.bmp
struct256.bmp
subtype_hierarchy_a256.bmp
subtype_hierarchy_f256.bmp
supertype_hierarchy_a256.bmp
supertype_hierarchy_f256.bmp
typebrowser.ico
typedef256.bmp
types_a256.bmp
type_hierarchy_a256.bmp
type_hierarchy_f256.bmp
union256.bmp
variable256.bmp
virtual256.bmp
workspace.ico
workspace256.bmp
Test
CVS
Utilities
CVS
/*!
	\file

	CSMLDoc and it's associated classes are used to load and/or parse a markup
	language loosly based on HTML. The results of the parsing yields a series
	of paragraph groups and text blocks each of which include their own set
	of formatting attributes. Although the CSMLDoc collection of classes was
	written to be used with the CSMLStatic class, it was kept seperate in order
	to allow it's use with other MFC extentions.
*/

// HTDoc.h: interface for the CSMLDoc class.
//
//////////////////////////////////////////////////////////////////////

//#ifndef DOXYGEN_SHOULD_SKIP_THIS

#if !defined(AFX_SMLDOC_H__198B6DF4_8CCC_445E_AEAD_82674B31A7F6__INCLUDED_)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define AFX_SMLDOC_H__198B6DF4_8CCC_445E_AEAD_82674B31A7F6__INCLUDED_
#endif

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define JUSTIFY_CENTER	0x0001	//!<	Specifies center justification
#define JUSTIFY_RIGHT	0x0002	//!<	Specifies right justification
#define JUSTIFY_LEFT	0x0004	//!<	Specifies left justification
#define STYLE_BOLD		0x0010	//!<	Specifies text block is bold
#define STYLE_ITALICS	0x0020	//!<	Specifies text block is italics
#define STYLE_UNDERLINE	0x0040	//!<	Specifies text block is underlined

#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define JUSTIFY_MASK	(JUSTIFY_CENTER | JUSTIFY_LEFT | JUSTIFY_RIGHT)
#define STYLE_MASK		(STYLE_BOLD | STYLE_ITALICS | STYLE_UNDERLINE)
#endif

/*!
	\brief	Document object.

	The CSMLDoc class represents a document containing text groups and
	text blocks.
*/
class CSMLDoc {
private:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
	struct CSMLTagOption {
		CSMLTagOption(CString &param, CString &value);

		CString		m_Param;
		CString		m_Value;
	};

	class CSMLTagOptionList : public CList<CSMLTagOption*, CSMLTagOption*> {
	public:
		virtual ~CSMLTagOptionList();
		void Reset();
		CString *GetParam(LPCSTR param);
		CString GetParamTypeface(CString &defaultFace);
		DWORD GetParamSize(DWORD defaultSize);
		DWORD GetParamColor(DWORD defaultColor);
		DWORD GetBkgndColor(DWORD defaultColor);
	};

	class CSMLFontInfo {
	public:
		CSMLFontInfo();
		CSMLFontInfo(CSMLFontInfo *info);
		CSMLFontInfo(DWORD size, DWORD style, COLORREF color, CString &face);
		CSMLFontInfo(DWORD size, DWORD style, COLORREF color, LPCSTR face);

		DWORD		m_Size;
		DWORD		m_Style;
		COLORREF	m_Color;
		CString		m_Face;
	};
#endif

public:
	/*!
		\brief	List class for managing font information.
	*/
	typedef CList<CSMLFontInfo*, CSMLFontInfo*> CSMLFontInfoList;


	/*!
		\brief	Group object.

		The CSMLTextGroup represents a group of text objects contained within a document.
	*/
	class CSMLTextGroup {

	public:
		/*!
			\brief	text object

			The CSMLTextBlock represents a text objects contained within a text group.
		*/
		class CSMLTextBlock {
		public:
			/*!
				\brief	Constructor

				\param	text	Pointer to the text for the block
				\param	info	Pointer to the font formatting information for the block.
			*/
			CSMLTextBlock(LPCSTR text, CSMLFontInfo *info);

			/*!
				\brief	Retrieves the typeface used by the text block

				\return	A CString containing the typeface.
			*/
			CString &GetTypeface();

			/*!
				\brief	Retrieves the font point size used by the text block

				\return	The point size of the font used by the text block.
			*/
			DWORD GetPointSize();

			/*!
				\brief	Retrieves the formatting style used by the text block

				\return	The formatting style used by the text block.
			*/
			DWORD GetStyle();

			/*!
				\brief	Retrieves the text color used by the text block

				\return	The text color used by the text block.
			*/
			COLORREF GetColor();

			/*!
				\brief	Retrieves the text managed by the block.

				\return	A string containing the text managed by the block.
			*/
			CString &GetText();

		private:
			CString		m_Text;			//!<	CString object containing the text for the block.
			DWORD		m_Style;		//!<	Formatting styles for the text block.
			DWORD		m_PointSize;	//!<	Point size for the font that will be applied to the text block.
			COLORREF	m_Color;		//!<	Text Color.
			CString		m_Typeface;		//!<	Typeface for the text block.
		};

	private:
		CArray<CSMLTextBlock*, CSMLTextBlock*>	m_Blocks;	//!<	Array of text blocks belonging to the group.

	public:
		/*!
			\brief	Constructor.
		*/
		CSMLTextGroup();

		/*!
			\brief	Destructor.
		*/
		~CSMLTextGroup();

		/*!
			\brief	Adds a text block to the group.

			This method adds an already created texth block to the group. Once added
			the group "owns" the text block and may delete or modify it at any time.
			Once a text block has been added to a group, it should not be added to
			any other group until the owner has relinquished ownership.

			\param	block	Pointer to the text block being added to the group.

			\sa	Empty
		*/
		void Add(CSMLTextBlock *block);

		/*!
			\brief	Removes all text blocks from the group.

			This method will remove all text blocks from the group and optionally
			deleted them upon removal.

			\param	bDelete	TRUE if the blocks should be deleted or FALSE if
					they should be removed without being destroyed.
		*/
		void Empty(BOOL bDelete);

		/*!
			\brief Retrieve the number of text blocks owned by the group.

			\return	The number of text blocks owned by the group.
		*/
		int GetBlockCount();

		/*!
			\brief	Retrieves a text block from the group.

			This method returns a text block specified by the index. Before calling
			this method you should ensure that the block at the requested index exists.

			\param	index	A zero based index of the text block to retrieve.

			\return	The text block associated with the index.
		*/
		CSMLTextBlock *GetBlock(int index);

		/*!
			\brief	Assignment operator used for copying a text group.
		*/
		void operator=(CSMLTextGroup &line);
	};


private:
	CArray<CSMLTextGroup*, CSMLTextGroup*>	m_Blocks;	//!< Array of text blocks.
	COLORREF	m_BkgndColor;	//!<	Background color of the document.
	CString		m_PageTypeface;	//!<	Global typeface of the document.

	/*!
		\brief	Parses a tag.

		Parses a formatting tag from the document stream.

		\param	src			Pointer to the document stream.
		\param	tagText		CString buffer to store the tags text identifier in.
		\param	tagID		DWORD argument to store the numerical tag ID in.
		\param	paramList	An option list object used to store all of the tags options in.

		\return	A pointer to the character immediately AFTER the entire tag.
	*/
	LPCSTR ParseTag(LPCSTR src, CString &tagText, DWORD &tagID, CSMLTagOptionList &paramList);

	/*!
		\brief	Adds a text group to the document.

		Adds a text group to the document.

		\param	line	A CSMLTextGroup object to add to the document.
	*/
	void AddGroup(CSMLTextGroup &line);

	/*!
		\brief	Purges (deletes) all text groups and text blocks associated with the document.

		Purges (deletes) all text groups and text blocks associated with the document.
	*/
	void PurgeBlocks();

public:
	/*!
		Destructor
	*/
	~CSMLDoc();

	/*!
		\brief	Returns the number of text groups in the document.

		Returns the number of text groups in the document.

		\return	Number of text groups in the document.
	*/
	int GetGroupCount();

	/*!
		\brief	Retrieve text group.

		Retrieves the text group.

		\param	index	Index of the text group to retrieve.
		\return	A Pointer to the text group.
	*/
	CSMLTextGroup *GetTextGroup(int index);

	/*!
		\brief	Parses a "hypertext" stream.

		Parses a "hypertext" stream.

		\param	stream	A null terminated character buffer containing the
						"hypertext" stream to parse.

		\return	State of the parsing operation
		\retval	TRUE	Operation was successful.
		\retval FALSE	Operation failed.
	*/
	BOOL ParseSMLText(LPCSTR stream);

	/*!
		\brief	Parses a "hypertext" stream.

		Parses a "hypertext" stream.

		\param	nID	ID of the resource containing the "hypertext" stream to parse.
					The resource <b>MUST</b> be a custom type of "SMLDOC".

		\return	State of the parsing
		\retval	TRUE	Operation was successful.
		\retval FALSE	Operation failed.
	*/
	BOOL ParseSMLText(UINT nID);

	/*!
		\brief	Retrieves the background color of the document.

		Retrieves the background color of the document.

		\return	Value represending the background color of the document.
	*/
	COLORREF GetBkgndColor();

	/*!
		\brief	Retrieves the global typeface of the document.

		Retrieves the global typeface of the document.

		\return	A reference to a CString object containing the 
	*/
	CString &GetTypeface();
};



#endif // !defined(AFX_SMLDOC_H__198B6DF4_8CCC_445E_AEAD_82674B31A7F6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

cider1

Switzerland Switzerland
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 2 Jul 2003
Article Copyright 2003 by cider1
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid