// bytran -|- spectral calculations for portable devices using the HITRAN database
//
// Developed by Dzianis Pliutau (Denis Plutov) and Kostya Roslyakov
// www.bytran.org | contact@bytran.org
// Copyright (c) 2016 Dzianis Pliutau
// Distributed under the MIT license
//
// The MIT License (MIT)
// Copyright (c) 2016 Dzianis Pliutau
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



// Object linking the spectral line calculation configuration parameters in the main calculation module with the QML interface component
#ifndef LINEOPTIONSDATAOBJECT_H
#define LINEOPTIONSDATAOBJECT_H

#include <QObject>
#include <QLocale>
#include "bytrancore.h"

class LineOptionsDataObject : public QObject
{
    Q_OBJECT

    Q_PROPERTY(int lineshapeProfile READ lineshapeProfile WRITE setLineshapeProfile NOTIFY lineshapeProfileChanged)
    Q_PROPERTY(QString intensThresh READ intensThresh WRITE setIntensThresh NOTIFY intensThreshChanged)
    Q_PROPERTY(QString wingContribSatHw READ wingContribSatHw WRITE setWingContribSatHw NOTIFY wingContribSatHwChanged)
    Q_PROPERTY(QString wingContribAbs READ wingContribAbs WRITE setWingContribAbs NOTIFY wingContribAbsChanged)
    Q_PROPERTY(int lineBroadening READ lineBroadening WRITE setLineBroadening NOTIFY lineBroadeningChanged)
    Q_PROPERTY(bool useLineShift READ useLineShift WRITE setUseLineShift NOTIFY useLineShiftChanged)

public:

    explicit LineOptionsDataObject(QObject *parent = 0, BytranCore *inCore = 0);
    LineOptionsDataObject(const QString &intensThresh, const QString &wingContribSatHw, const QString &wingContribAbs, const int &lineshapeProfile, const int &lineBroadening, const bool &useLineShift, QObject *parent=0);

    // Lineshape profile
    int lineshapeProfile() const;
    void setLineshapeProfile(const int &lineshapeProfile);

    // Intensity treshold
    QString intensThresh() const;
    void setIntensThresh(const QString &intensTresh);

    // Line wing contribution in saturated halfwidths
    QString wingContribSatHw() const;
    void setWingContribSatHw(const QString &wingContribSatHw);

    // Line wing contribution absolute
    QString wingContribAbs() const;
    void setWingContribAbs(const QString &rwingContribAbs);

    // Broadening type
    int lineBroadening() const;
    void setLineBroadening(const int &lineBroadening);

    // Line shift
    bool useLineShift() const;
    void setUseLineShift(const bool &useLineShift);

signals:

    void lineshapeProfileChanged();
    void intensThreshChanged();
    void wingContribSatHwChanged();
    void wingContribAbsChanged();
    void lineBroadeningChanged();
    void useLineShiftChanged();

private:

    QString m_intensTresh;
    QString m_wingContribSatHw;
    QString m_wingContribAbs;
    int m_lineshapeProfile;
    int m_lineBroadening;
    bool m_useLineShift;

    // Core object with the calculation logic etc.
    BytranCore *core;

    // Locale specific string to number and inverse conversions
    QLocale loc;

};

#endif // LINEOPTIONSDATAOBJECT_H
