/*
 * Copyright 2009 Benjamin Adler <benadler@gmx.net>
 *
 * 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.
 */

#ifndef KONSUME_H
#define KONSUME_H

#include <QDialog>
#include <QWidget>
#include <QRegExp>
#include <QValidator>
#include <QMap>
#include <QTextCodec>
#include <QAction>
#include <QTimer>
#include <QDebug>
#include <QMenu>
#include <QKeySequence>
#include <QTreeWidget>
#include "ui_mainwidget.h"
#include "ebay.h"
#include "auction.h"

class QTreeWidgetItem;
class KConfig;

class Konsume : public QDialog, public Ui::MainWidget
{
    Q_OBJECT
  public:
    Konsume(QWidget *parent=0);
    ~Konsume();

  private slots:
     void slotUpdateCountdown();
     void slotLoadAuctions(const QList<Auction*>);
     void slotAuthTokenChanged(const QString authToken);
     void slotGetWatchList();
     void slotOpenAuctionInBrowser(QTreeWidgetItem *auction);
     void slotQuit();

     void slotCustomContextMenuRequested(const QPoint &point);
     void slotOpenCurrentItemInBrowser();
     void slotRemoveCurrentItemFromWatchList();

     void slotSaveSettings();
     void slotLoadSettings();
     
  private:
    QTimer *timerCountdown, *timerUpdateWatchlist;
    eBay m_eBay;
    QMap<QString, int> siteIds;
    QMenu* menuActions;

    void initSiteIds();
};

#endif
