

#ifndef __MAPPERWINDOW_H
#define __MAPPERWINDOW_H

#include <mapper/config.h>

#include <qmainwindow.h>
#include <qsplitter.h>
#include <leftbar.h>
#include <rightfield.h>

#include <iwlocator/wlanlocator.h>
#include <iwsens/sensorsurveillance.h>
#include <iwear/servicemanager.h>
#include <iwear/basemodulemanager.h>
#include <iwsens/sensormanager.h>
#include <iwlocator/locationmanager.h>
#include <iwlocator/wlanlocator.h>
#include <dbclasses/iwpgdb.h>
#include <actualizer.h>
#include <tr1/memory>

namespace iwear
{
    namespace sensor
    {
	namespace location
	{
/**
 * The MapperWindow is the main window of our mapper application. Its derived
 * from QMainWindow to have some menubar, toolbar and a statusbar.
 *
 * The Window will contain on the left side a view for location lists, and on
 * the right side a map display. The LocationList itself will be described in its own class.
 * Between those two sides there is a splitter object so we can choose which one is bigger.
 *
 * This Class also holds all of the other objects that might be needed by
 * others, so it should be passed to them too...
 */
class MapperWindow : public QMainWindow
{
    Q_OBJECT
private:
protected:
    QSplitter* d_splitter;
    LeftBar* d_leftbar;
    RightField* d_rightfield;

    ServiceManager* serman;
    EventDispatcher* evdis;

    Actualizer* act;

    void setup( const std::list<tr1::shared_ptr<iwear::sensor::location::Locator> >& locl, 
	const std::list<tr1::shared_ptr<iwear::sensor::location::wlan_locator> >& wlanl);
public:
    MapperWindow( const std::list<tr1::shared_ptr<iwear::sensor::location::Locator> >& locl, 
	const std::list<tr1::shared_ptr<iwear::sensor::location::wlan_locator> >& wlanl,
	ServiceManager*, EventDispatcher*);
    ~MapperWindow();

    /**
     * This function sets the elements for the "Edit" menu.
     */
    void set_editmenu( QPopupMenu* pm );

    /**
     * This sets the menu elements for the "Database" menu
     */
    void set_databasemenu( QPopupMenu* dm );

    void set_viewmenu( QPopupMenu* vm );

    void set_extramenu( QPopupMenu* xm );
};

}
}
}

#endif
