/***********************************************************************
**
**   tasklist.h
**
**   This file is part of KFLogEmbedded.
**
************************************************************************
**
**   Copyright (c):  2002 by Heiner Lamprecht
**
**   This file is distributed under the terms of the General Public
**   Licence. See the file COPYING for more information.
**
**   $Id: tasklist.h,v 1.2 2004/04/20 19:39:44 axel Exp $
**
***********************************************************************/

#ifndef TASKLIST_H
#define TASKLIST_H

#include "flighttask.h"

#include <qlist.h>
#include <qlistview.h>
#include <qtextview.h>
#include <qwidget.h>

class TaskList : public QWidget
{
  Q_OBJECT

  public:
    /** */
    TaskList( QWidget* parent, const char* name );
    /** */
    ~TaskList();
    /** */
    FlightTask* selectedTask();

  private:
    /** */
    bool saveTaskList(); 

  public slots:
    /** */
    void slotTaskDetails();
    /** load tasks from file*/
    bool slotLoadTask();
    /** */
    void slotNewTask();
    /** */
    void slotEditTask();
    /** */
    void slotDeleteTask();
    /** overtake a new task item from the editor */
    void slotUpdateTaskList( FlightTask* );
    /** overtake a edited task item from the editor */
    void slotEditTaskList( FlightTask* );

  private:

    /** */
    QListView* taskListView;
    /** */
    QTextView* taskRoute;
    /** */
    QList<FlightTask> taskList;
    /** */
    static uint lastSelection;
    /** flight task being edited */
    FlightTask* editTask;
};

#endif // TASKLIST_H
