#ifndef __MAP_SETTINGS_EDITOR_DIALOG__H_
#define __MAP_SETTINGS_EDITOR_DIALOG__H_

/*LICENSE_START*/
/*
 *  Copyright (C) 2014  Washington University School of Medicine
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/*LICENSE_END*/


#include "WuQDialogNonModal.h"

class QCheckBox;
class QLabel;
class QLayout;
class QPushButton;
class QTabWidget;

namespace caret {
    
    class CaretMappableDataFile;
    class LabelTableEditorWidget;
    class MapSettingsFiberTrajectoryWidget;
    class MapSettingsLayerWidget;
    class MapSettingsPaletteColorMappingWidget;
    class MapSettingsParcelsWidget;
    class Overlay;
    
    class MapSettingsEditorDialog : public WuQDialogNonModal {
        Q_OBJECT
        
    public:
        MapSettingsEditorDialog(QWidget* parent);
        
        void updateDialogContent(Overlay* overlay);
        
        void updateDialog();
        
        virtual ~MapSettingsEditorDialog();

        bool isDoNotReplaceSelected() const;
        
    protected:
        virtual void closeButtonPressed();
        
        virtual void focusInEvent(QFocusEvent* event);
        
    private:
        MapSettingsEditorDialog(const MapSettingsEditorDialog&);

        MapSettingsEditorDialog& operator=(const MapSettingsEditorDialog&);
        
    private slots:
        void doNotReplaceCheckBoxStateChanged(int state);
        
        void editLabelTablePushButtonClicked();
        
    private:
        QWidget* createWindowOptionsSection();
        
        QWidget* createMapFileAndNameSection();
        
        QWidget* createLabelsSection();
        
        void setLayoutSpacingAndMargins(QLayout* layout);
        
        QTabWidget* m_tabWidget;
        
        QCheckBox* m_doNotReplaceCheckBox;
        
        CaretMappableDataFile* m_caretMappableDataFile;
        
        Overlay* m_overlay;
        
        int32_t m_mapIndex;
        
        MapSettingsPaletteColorMappingWidget* m_paletteColorMappingWidget;
        
        MapSettingsParcelsWidget* m_parcelsWidget;
        
        LabelTableEditorWidget* m_labelTableEditorWidget;
        
        MapSettingsFiberTrajectoryWidget* m_fiberTrajectoryWidget;
        
        MapSettingsLayerWidget* m_layerWidget;
        
        QWidget* m_labelsWidget;
        
        QPushButton* m_editLabelTablePushButton;
        
        QLabel* m_selectedMapFileNameLabel;
        
        QLabel* m_selectedMapNameLabel;
        
        int32_t m_labelsWidgetTabIndex;
        
        int32_t m_layersWidgetTabIndex;
        
        int32_t m_metadataWidgetTabIndex;
        
        int32_t m_paletteWidgetTabIndex;
        
        int32_t m_parcelsWidgetTabIndex;
        
        int32_t m_trajectoryWidgetTabIndex;
        
    };
    
#ifdef __MAP_SETTINGS_EDITOR_DIALOG_DECLARE__
#endif // __MAP_SETTINGS_EDITOR_DIALOG_DECLARE__

} // namespace
#endif  //__MAP_SETTINGS_EDITOR_DIALOG__H_
