/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     2000/02/08
// RCS-ID:      $Id: textediting.h,v 1.2 2001/04/22 19:58:14 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:   	GPL (version 2.0 or later)
/////////////////////////////////////////////////////////////////////////////

#ifndef __PM_INF_TEXTEDITING_G__
#define __PM_INF_TEXTEDITING_G__

#include "wx/string.h"
#include "wx/window.h"

// text-content related interfaces

class I_ContainingText
{
public:
	virtual bool GetAllText( wxString* toStr ) = 0;

	virtual bool GetTextRange( wxString* toStr, int line1, int column1,
							   int line2, int column2 ) = 0;

	virtual void GetEndPosition( int* line, int* column ) = 0;

	virtual void GetCursorPosition( int* line, int* column ) = 0;
};

class I_MarkableText
{
public:
	enum MARK_TYPES 
	{	
		BOOKMARK,
		BREAKPOINT,
		EXECUTIONMARK
	};

	// returns unique id of the added mark

	virtual long AddMark( int type, int line ) = 0;

	virtual bool IsMarked( int type, int line ) = 0;

	// returns TRUE if mark with given id is present

	virtual bool GetMarkInfo( long markId, int* type, int* line ) = 0;

	virtual void RemoveAllMarks( int type ) = 0;
	virtual bool RemoveMarkAt( int type, int line ) = 0;
	virtual bool RemoveMark( long markId ) = 0;
	virtual bool JumpToMark( long markId ) = 0;
};

class I_EditableText
{
public:
	virtual void StartTextUpdateBatch() = 0;
	virtual void FinishTextUpdateBatch() = 0;

	virtual void InsertText( wxString& text, int line, int column ) = 0;
	
	virtual void GetSelection( int* line1, int* column1, int* line2, int* column2 ) = 0;
	virtual void SetSelection( int line1, int column1, int line2, int column2 ) = 0;

	virtual void TextPosToScreenPos( int line, int column, int* x, int* y ) = 0;
	virtual void SetCursorPosition( int line, int column ) = 0;
	virtual void GetPagePosition( int* line, int* column ) = 0;
	
	virtual bool DeleteRenage( int line1, int column1, int line2, int column2 ) = 0;

	virtual wxWindow* GetTextWidgetWindow() = 0;
	virtual wxSize GetCharacterSize() = 0;
	virtual void HoldCursor( bool hold ) = 0;
};

class I_KeyEventInterception
{
public:
	// TBD::
};

#endif // __PM_INF_TEXTEDITING_G__