#ifndef CSETTINGSWINDOW_H
#define CSETTINGSWINDOW_H

#include "GlobalDefine.h"
#include <QDialog>
#include <QTabBar>
#include <QLineEdit>
#include <QCalendarWidget>
#include <QComboBox>
#include <QPushButton>
#include "ProgramSettings.h"
#include "QTableWidget"
#include <QLabel>
#include "LoraSettingsGui.h"


class CMasterCtrl;


class CSettingsWindow : public QDialog
{
    Q_OBJECT
public:
    CSettingsWindow();
    virtual ~CSettingsWindow();

    CMasterCtrl *mProgramHandle;

    QWidget *mSMSPage;
    QWidget *mContactsPage;
    QTabBar *mOptionsTabBar;
    CLoraSettingsGui *mLoraSettingsPage;

    //SMS Page
    QLineEdit *mVoipMSUsername;
    QLineEdit *mVoipMSPassword;
    QCalendarWidget *mVoipMSCalendar;
    QComboBox *mDIDSelectionDropList;
    QPushButton *mRetreiveDIDSButton;

    //Contacts Page
    QTableWidget *mContactsList;
    QPixmap *mDefaultContactPixmap;
    QPixmap mContactPixmap;
    QLineEdit *mContactRawNbrEdit;
    QLineEdit *mContactNameEdit;
    QLineEdit *mContactNbrEdit;
    QLabel *mContactPixmapLabel;
    QPushButton *mSelectContactPicBtn;
    QPushButton *mNewContactBtn;
    QPushButton *mSaveContactBtn;
    QPushButton *mDeleteContactBtn;


    QPushButton *mDoneButton;

    unsigned int SetSettingsData(CSettings *SettingsData);
    int UpdateContacts();
    void ClearTable();
    int GetCurSelectedItemIndexInTable();

public slots:
    void TabBarClicked(int);
    void RetreiveDIDButtonClicked(bool);
    void DIDsListFetched(QStringList);
    void DoneButtonClicked(bool);

    void SelectContactPicClicked(bool checked);
    void SaveContactClicked(bool checked);
    void NewContactClicked(bool checked);
    void DeleteContactClicked(bool checked);
    void TableDoubleClicked(int,int);
    void TableCellSelected(/*int,int*/);
};

#endif // CSETTINGSWINDOW_H
