/***********************************************************************
**
**   settingspagemap.h
**
**   This file is part of Cumulus.
**
************************************************************************
**
**   Copyright (c):  2002 by André Somers
**
**   This file is distributed under the terms of the General Public
**   Licence. See the file COPYING for more information.
**
**   $Id: settingspagemap.h,v 1.16 2005/02/25 09:23:29 andre Exp $
**
***********************************************************************/

#ifndef SETTINGSPAGEMAP_H
#define SETTINGSPAGEMAP_H

#include <qwidget.h>
#include <qdialog.h>
#include <qcheckbox.h>
#include <qlistview.h>
#include <qcombobox.h>
#include <qpushbutton.h>
#include <qstringlist.h>
#include "guicontrols/coordedit.h"
#include "projectionbase.h"

/**contains map-related settings
  *@author André Somers
  */
class SettingsPageMapAdv;

class SettingsPageMap : public QWidget  {
   Q_OBJECT
public: 
  SettingsPageMap(QWidget *parent=0, const char *name=0);
  ~SettingsPageMap();

public slots: // Public slots
  /** Called to initiate saving to the configurationfile. */
  void slot_save();
  /** Called to initiate loading of the configurationfile */
  void slot_load();
  /** Called to ask is confirmation on the close is needed. */
  void slot_query_close(bool& warn, QStringList& warnings);
  
protected:
  QCheckBox * chkDrawDirectionLine;
  
  QListView * lvLoadOptions;

  //listitems in listview
  QCheckListItem * liIsolines;
  QCheckListItem * liIsolineBorders;
  QCheckListItem * liWpLabels;
  QCheckListItem * liWpLabelsExtraInfo;
  QCheckListItem * liRoads;
  QCheckListItem * liHighways;
  QCheckListItem * liRailroads;
  QCheckListItem * liCities;
  QCheckListItem * liWaterways;
  QCheckListItem * liForests;  //forests and ice

  SettingsPageMapAdv * advancedPage;
  QPushButton * cmdAdvanced;
  
private: // Private methods
  /** Fills the list with loadoptions */
  void fillLoadOptionList();
};


class SettingsPageMapAdv : public QDialog {
Q_OBJECT
  SettingsPageMapAdv(QWidget *parent=0, const char *name=0);
  ~SettingsPageMapAdv();
  friend class SettingsPageMap; //SettingsPageMap takes care of our loading and saving, so it needs access to our internals

public slots: // Public slots
  /** Called to initiate saving to the configurationfile. */
  void slot_save();
  /** Called to initiate loading of the configurationfile */
  void slot_load();
  /** Called to ask is confirmation on the close is needed. */
  void slot_query_close(bool& warn, QStringList& warnings);

protected:
  QCheckBox * chkDeleteAfterCompile;
  QCheckBox * chkUnloadUnneeded;
  QComboBox * cmbProjection;
  LatEdit * edtLat1;
  LatEdit * edtLat2;
  LongEdit * edtLon;

  int cylinPar;
  int lambertV1;
  int lambertV2;
  int lambertOrigin;

  // variable currentProjType is an enum ProjectionBase::ProjectionType
  int currentProjType;

  /** Reďmplemented from QDialog
   * Reload settings from configurationfile so that changes won't be written to the configuration.
   */
  void reject();

protected slots:
  void slotSelectProjection(int);
};
#endif
