//  qexuiW.h
//
//  Qsas - Data Export Header File
//
//  Tony Allen
//  Nov 2001
//

#ifndef QSAS_DATA_EXPW_H_
#define QSAS_DATA_EXPW_H_

#include <qfiledialog.h>
#include <qlistview.h>
#include <qstatusbar.h>
#include <qmenubar.h>
#include <qgroupbox.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include "qt_version.h"
#include <qobject.h>
#if QT_VERSION >= 0x040000
#include <qgridlayout.h>
#endif
#include "Qdos.h"
#include "qie.h"

class DataExportWindow : public QFileDialog {

Q_OBJECT

  QGridLayout* _top_gl;
  QListView* _exp_listview;
  QStatusBar* _status_bar;
  QMenuBar *_menu_bar;
  QGroupBox* options_groupbox;
  QCheckBox* _OverWrite;
  QCheckBox* _RecNumOn;
  QCheckBox* _AttachHead;
  QComboBox* _DataDelim;
  QComboBox* _RecDelim;
  
  
public slots:
  void writeFile();
  
signals:
  void QexMessage(QString txt);
  
public:
  DataExportWindow( QWidget *parent=0, const char *name=0 );
  ~DataExportWindow(){;}
  void initName();
  void status(const QString& str)
  {_status_bar->message(str);}
  QMenuBar* menu_bar(){ return _menu_bar;}

protected:
  
};

extern DataExportWindow *QEX_widget;

void QEXCreatePopup(QWidget *parent);
void QEXPopupPopup(QWidget *parent);
void QexBuildExportQIEObj (QdObjectSeq_var ObjList,vector<KVDataBase_var> &OptionList);
int  QexDataToCDFfi(QiCDFContents* qicdf, QdObject_var obj_var);
void QexAddXrefsToAttrs(QiCDFContents* qicdf, int num,  QdObject_var obj, const char *tt_name);
void QexAddAttribute(QiCDFVariable *v,  
                     QdObject_var attr_obj, 
                     const char *name);
bool QexWriteFile (QWidget *parent, bool isTS);
bool QexNameExists(const char *name, QiCDFContents* qicdf);
char * QexNewPath(QString text);
char * QexNewName(QString text);
QString QexDefaultName(QiCDFContents *QiConts);
 
# endif // QSAS_DATA_EXPW_H_
