00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef LIBRARYDIALOG_H
00013 #define LIBRARYDIALOG_H
00014
00015 #include <qpe/config.h>
00016
00017 #include "SearchDialog.h"
00018 #include "NetworkDialog.h"
00019 #include <qstringlist.h>
00020 #include <qdialog.h>
00021 #include <qcheckbox.h>
00022 #include <qdatetime.h>
00023 #include <qfile.h>
00024 #include <qheader.h>
00025 #include <qlistview.h>
00026 #include <qmessagebox.h>
00027 #include <qregexp.h>
00028 #include <qstring.h>
00029 #include <qtextstream.h>
00030 #include <qlabel.h>
00031 #include <stdlib.h>
00032 #include <qtabwidget.h>
00033 #include <qvaluelist.h>
00034
00035 class QVBoxLayout;
00036 class QHBoxLayout;
00037 class QGridLayout;
00038 class QListView;
00039 class QListViewItem;
00040 class QPushButton;
00041
00042 class QWidget;
00043
00044
00045 typedef struct {
00046 QString title;
00047 QString author;
00048 QString year;
00049 QString file;
00050 } etext;
00051
00052
00053 class LibraryDialog : public QDialog {
00054 Q_OBJECT
00055
00056 public:
00057 LibraryDialog( QWidget* parent = 0, const char* name = 0 , bool modal = TRUE, WFlags fl = 0 );
00058 ~LibraryDialog();
00059
00060 QTabWidget *tabWidget;
00061 QListView *ListView1,*ListView2,*ListView3,*ListView4,*ListView5;
00062 QWidget *widget_1,*widget_2,*widget_3,*widget_4,*widget_5,*widget_6;
00063 QString ftp_host,ftp_base_dir;
00064 QLabel *statusLabel;
00065 QListViewItem *QList_Item1,*QList_Item2,*QList_Item3,*QList_Item4,*QList_Item5;
00066 QStringList list,ItemStrlist,Searchlist,resultLs;
00067
00068
00069 QPushButton *buttonSearch,*buttonCancel,*buttonDownload,*buttonLibrary,*buttonNewList,*moreInfoButton;
00070 QString new_index,old_index;
00071 QFile newindexLib,indexLib;
00072
00073 int checked;
00074 int i_binary;
00075 bool useSmallInterface;
00076 bool indexLoaded;
00077 QPushButton *cancel,*DownloadAll;
00078 QCheckBox *checkBox,*httpBox,*authBox;
00079
00080
00081 QString filename;
00082 QString downDir;
00083 int ftpNumb;
00084 int i;
00085 QString year,title,number,file,author;
00086 QString DlglistItemNumber,DlglistItemFile,DlglistItemYear,DlglistItemTitle,NewlistItemFile;
00087 QString m_getFilePath;
00088 QString Edir;
00089
00090 QString index;
00091 QString IDontKnowWhy;
00092 QString local_library;
00093 QString local_index;
00094 QString File_Name;
00095 QString proxy_http;
00096 int doitAll;
00097 QString texter;
00098
00099 void parseSearchResults( QString resultStr);
00100
00101 public slots:
00102 bool getItem(QListViewItem* );
00103 void doListView();
00104 void FindLibrary();
00105 void newList();
00106 void Newlibrary();
00107 void Library();
00108 bool getAuthor();
00109 void select_title(QListViewItem*);
00110 void cancelIt();
00111 void sortLists(int);
00112 bool moreInfo();
00113
00114 bool httpDownload();
00115 bool setTitle();
00116 void saveConfig();
00117 bool download_Etext();
00118 bool download_newEtext();
00119
00120 void onButtonSearch();
00121 bool onButtonDownload();
00122
00123
00124 void comboSelect(int index);
00125 protected slots:
00126
00127
00128 protected:
00129
00130 QValueList<etext> etextLibrary;
00131
00132 void initDialog();
00133 QHBoxLayout *hbox,*hbox1,*hbox2;
00134 QVBoxLayout *vbox;
00135
00136 private:
00137 void addItems();
00138 void clearItems();
00139 void cleanStrings();
00140 bool getEtext(const QStringList &);
00141 private slots:
00142 void authBoxClicked();
00143
00144 };
00145
00146 #endif // LIBRARYDIALOG_H