/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     2000/02/08
// RCS-ID:      $Id: markersvc.h,v 1.3 2001/04/04 12:42:37 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:   	GPL (version 2.0 or later)
/////////////////////////////////////////////////////////////////////////////

#ifndef __MERKERSVC_G__
#define __MAKRERSVC_G__

#include "wx/pmf/pm.h"

#include "wx/listbox.h"
#include "wx/dynarray.h"

#include "wx/pmf/inf/textediting.h"

class MarkData
{
public:
	wxPMFileInfo mFile;
	int		     mLine;
	long		 mId;
	wxString     mName;
};

WX_DEFINE_ARRAY( MarkData*, MarkDataListT );

class MarkerService : public wxPMPane // this base class is also wxPMService derivative
{
public:
	MarkerService();
	~MarkerService();

	// overriden methods of wxPMService

	virtual bool Stop();

	virtual wxPMMergableMenuChain* GetMergableMenuChain();

	// overriden methods of wxPMPane

	virtual wxWindow* GetPaneWindow();
	virtual void CreatePaneWindow( wxWindow* pParent );

	virtual wxStringList* GetDocumentTypes(); 

	// event handlers

	enum MY_MENU_COMMANDS 
	{	
		ADDMARK = 100,
		REMOVE_MARK,
		SHOW_MARKS,
		HIDE_MARKS,

		ID_MARKS_LIST
	};

	void OnAddMark( wxCommandEvent& event );
	void OnRemoveMark( wxCommandEvent& event );
	void OnShowMarks( wxCommandEvent& event );
	void OnHideMarks( wxCommandEvent& event );

	void OnListItemSelected( wxCommandEvent& event );

	DECLARE_EVENT_TABLE()

	DECLARE_DYNAMIC_CLASS( MarkerService )

protected:
	I_MarkableText* GetMarkingInterface();
	I_ContainingText* GetTextInterface();

protected:
	wxListBox*	  mpMarksBox;
	MarkDataListT mMarks;
};

#endif // __MAKRERSVC_G__
