/* MSHV
 *
 * By Hrisimir Hristov - LZ2HV
 * (Edited by Harper Innes, VK1TTY - to remove Gendered Language and Replace with Non-Gendered language)  NOTE:May be used under the terms of the GNU General Public License (GPL)
 */

#ifndef HVLOGLIST_H
#define HVLOGLIST_H

#include "../../config.h"

#include <QHeaderView>
#include <QTreeView>
#include <QCoreApplication>
#include <QStandardItemModel>
#include <QMouseEvent>
#include <QPainter>
#include <QMessageBox>
#include <QClipboard>
#include <QApplication>
//#include <QFont>
//#include <QtGui>

/*class HvHeaderLog : public QHeaderView
{
    Q_OBJECT
public:
    HvHeaderLog(Qt::Orientation orientation, QWidget *parent = 0);
    virtual ~HvHeaderLog();

};*/
class HvStandardItemModel : public QStandardItemModel
{
	Q_OBJECT
public:
    HvStandardItemModel(QObject *parent = 0);
    virtual ~HvStandardItemModel();
private:
	QList<QStringList> list_;    
	void sort(int column, Qt::SortOrder order);
signals:
	void EmitSortEnd();
};

class HvLogList : public QTreeView
{
    Q_OBJECT
public:
    HvLogList(bool,QWidget *parent = 0);
    virtual ~HvLogList();

	//void SetFocus();
    HvStandardItemModel model;
    void Clear_List();
    void SetItem_hv(QStringList,int);
    void SetEditRow(int);
    void InsertItem_hv(QStringList);
    int GetListCount()
    {
        return 	model.rowCount();
    };

signals:
	//void SendRightClick();
	void EmitDoubleClick();
	void SortClicked(int);

public slots:
    void DeleteSel();
    
private slots:
	void HideSections();
	
private:
    //HvHeaderLog *THvHeader;
    QHeaderView *THvHeader;
    int ActiveIndex;
    QColor ActiveRowText;
    QColor ActiveRowBackg;
    QClipboard *clipboard;
    QString last_logged_dt;   
    int enum_sec_logged;

protected:
	//void mousePressEvent (QMouseEvent*);
	void drawRow(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
	void paintEvent(QPaintEvent *);
	void mouseDoubleClickEvent(QMouseEvent * event);
	void keyPressEvent(QKeyEvent * event);

};
#endif
