//  qdi.h
//
//  Qsas - Direct Import Header File
//
//  Tony Allen
//  Sept 2002
//

#ifndef QSAS_DI_H_
#define QSAS_DI_H_

#include <QObject>
#include "qdutil.h"
#include "qslot.h"

#include "qbu_qt4.h"
#include "qgu_qt4.h"

#include "Qdos.h"
#include "qie.h"
#include "qie_caa.h"

#define  TYPE_NONE   0
#define  TYPE_CDF    1
#define  TYPE_FLAT   2
#define  TYPE_HEADER 3

#define  ATTR_NAME_LEN 300

// --------------------------------------------------

class DirectImportWindow : public QMainWindow {

Q_OBJECT

  QStatusBar* _status_bar;
  QMenuBar *_menu_bar;
  
public slots:
  void close();
  void getData();
  void browseData();
  void clearGattrList();
  void clearVarList();
  void varDoubleClick(Q3ListViewItem*);
  void GattrDoubleClick(Q3ListViewItem*);
  void launchVersion();
  void launchManDirectImport();
  void launchManual();

signals:
  
public:
  DirectImportWindow( QWidget *parent=0, const char *name=0 );
  void getFileContents(const char *file);
  QdObject_var qie2qdos(long vnum);
  QdObject_var QdiVarToObj ( QiCDFContents* info, int vnum);
  void  QdiSet_VAttrs(QdObject_var dobj, QiCDFContents * info, int vnum);
  QStatusBar *msgBar;
  Q_LIST_VIEW *varList;
  Q_LIST_VIEW *GattrList;
  QiCDFContents *QieContents;		/* qie Contents Structure */
  QiOptions *QieOpt;                    /* qie options structure */
  QString Selected_File_Path;
  Q_LIST_VIEW *activeList;
  QdTimeSeq_var  tt;               /* single time tag source for whole file */
  RecordSlider *fromSlider;
  RecordSlider *toSlider;
  
protected:
  void keyPressEvent(QKeyEvent * e );
  QPushButton *getVarBtn;
  QPushButton *browseVarBtn;
  QPushButton *dismissBtn;
  
};
 
 void QdiLaunchWindow(QString file, QWidget *parent);
 long QdiGetTimeVar(QiCDFContents *info, int vnum);
 QdObject_var  QdiGattrToObj ( QiCDFContents* info, int Anum);
 int Qdi_DistinctVarExists(QiCDFContents *info, int vnum, int attr);
 char * QdiAttrName(char * in_name);
 void QdiAttrToXref(QdObject_var dobj, QiSVarAttribute attribute);
 long  QdiFindVarNum(QiCDFContents *QieCont, const char *name );
 long  QdiFindGattrNum(QiCDFContents *QieCont, const char *name );


// Direct Access QIE rewrite
// --------------------------------------------------

class DirectAccessWindow : public QMainWindow {

Q_OBJECT

  QStatusBar* _status_bar;
  QMenuBar *_menu_bar;
  
public slots:
  void close();
  int getFileContents(const char *file);
  void setSliders(int nRecs);
  void getData();
  void browseData();
  void clearGattrList();
  void clearVarList();
  void varDoubleClick(Q3ListViewItem*);
  void GattrDoubleClick(Q3ListViewItem*);
  void setSliderForItem(Q3ListViewItem*);
  void launchVersion();
  void launchManDirectImport();
  void launchManual();
  void updateOnSelection(QieVariable *V=0);
  void tRangeToggle();

signals:
  
public:
  DirectAccessWindow( QWidget *parent=0, const char *name=0 );
    
  QStatusBar *msgBar;
  Q_LIST_VIEW *varList;
  Q_LIST_VIEW *GattrList;
  QieData *QieDataCont;		/* qie Contents Structure */
  QString Selected_File_Path;
  Q_LIST_VIEW *activeList;
  QdTimeSeq_var  tt;               /* single time tag source for whole file */
  RecordSlider *fromSlider;
  RecordSlider *toSlider;
  QGroupBox *subset_panel;
  QCheckBox *useTcheck;
  
protected:
  void keyPressEvent(QKeyEvent * e );
  QPushButton *getVarBtn;
  QPushButton *browseVarBtn;
  QPushButton *dismissBtn;
  
};
 

 void QdaLaunchWindow(QString file, QWidget *parent);

# endif // QSAS_DI_H_
