/***************************** LICENSE START ***********************************

 Copyright 2012 ECMWF and INPE. This software is distributed under the terms
 of the Apache License version 2.0. In applying this license, ECMWF does not
 waive the privileges and immunities granted to it by virtue of its status as
 an Intergovernmental Organization or submit itself to any jurisdiction.

 ***************************** LICENSE END *************************************/

// File EditorDrawer.h
// Baudouin Raoult - ECMWF Jul 99

#ifndef EditorDrawer_H
#define EditorDrawer_H

#ifndef Drawer_H
#include "Drawer.h"
#endif

class InternalEditor;
class IconClass;


#ifndef InternalEditor_H
#include "InternalEditor.h"
#endif

class EditorDrawer : public Drawer {
public:

// -- Exceptions
	// None

	EditorDrawer(InternalEditor&);

// -- Destructor

	virtual ~EditorDrawer(); // Change to virtual if base class

// -- Convertors
	// None

// -- Operators
	// None

// -- Methods

	virtual void edit(IconObject*);
	virtual void update();

	// ---


// -- Overridden methods
	// None	
	  

// -- Class members
	// None

// -- Class method

protected:

// -- Contructors


// -- Members
       
	InternalEditor& editor_;
	

// -- Methods
	
	// void print(ostream&) const; // Change to virtual if base class	

// -- Overridden methods
	// None

// -- Class members
	// None

// -- Class methods
	// None

private:

// No copy allowed

	EditorDrawer(const EditorDrawer&);
	EditorDrawer& operator=(const EditorDrawer&);

// -- Members
	

// -- Methods


// -- Overridden methods


// -- Class members


// -- Class methods
	// None

// -- Friends

	//friend ostream& operator<<(ostream& s,const EditorDrawer& p)
	//	{ p.print(s); return s; }

};



template<class T>
class XEditorDrawer : public EditorDrawer, public T {
	virtual Widget widget() { return T::xd_rootwidget(); }
public:
	XEditorDrawer(InternalEditor& e,const char* name = 0) : EditorDrawer(e)
	{
		T::create(e.drawer(), const_cast<char*>(name));
		XtManageChild(T::xd_rootwidget());
	}
};

#endif
