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

 Copyright 2015 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 *************************************/

#ifndef MvQComboBoxLine_H
#define MvQComboBoxLine_H

#include <QComboBox>
#include <QString>

#include "MvQRequestPanelLine.h"
#include "MvIconParameter.h"

class Request;
class RequestPanel;

class MvQEditorComboBox : public QComboBox
{
public:
    MvQEditorComboBox(QWidget* parent = 0);

protected:
    void wheelEvent(QWheelEvent* event);
    void focusInEvent(QFocusEvent* event);
    void focusOutEvent(QFocusEvent* event);
};


class MvQComboBoxLine : public MvQRequestPanelLine, public ParameterScanner
{
    Q_OBJECT

public:
    MvQComboBoxLine(RequestPanel& owner, const MvIconParameter& param);

    QString currentValue() { return QString(); }
    void addValue(QString) {}

    void refresh(const vector<string>&);

public slots:
    void slotCurrentChanged(int);

protected:
    void next(const MvIconParameter&, const char* first, const char* second);

    MvQEditorComboBox* cbEdit_;
    bool reportChange_;
};


#endif
