00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GUTENBROWSER_H
00017 #define GUTENBROWSER_H
00018
00019 class QPainter;
00020 class QPushButton;
00021 class QListView;
00022 class QString;
00023 class QTextView;
00024 class QPopupMenu;
00025 class QMenuBar;
00026 class QToolBar;
00027 class QLayout;
00028 class QToolTip;
00029 class QPixMap;
00030 class QFile;
00031
00032 #include <qtoolbutton.h>
00033
00034 #include <qpe/qpeapplication.h>
00035 #include <qpe/qpemenubar.h>
00036 #include <qpe/menubutton.h>
00037
00038 #include <qmainwindow.h>
00039 #include <qapplication.h>
00040 #include <qwhatsthis.h>
00041 #include <qfontmetrics.h>
00042 #include <qfontinfo.h>
00043 #include <qpoint.h>
00044
00045 #include "LibraryDialog.h"
00046 #include "multiline_ex.h"
00047 #include "resource.h"
00048
00049 #include <qvaluelist.h>
00050
00051 class Gutenbrowser : public QMainWindow {
00052 Q_OBJECT
00053 public:
00054 static QString appName() { return QString::fromLatin1("gutenbrowser"); }
00055 #ifdef NOQUICKLAUNCH
00056 Gutenbrowser();
00057 #else
00058 Gutenbrowser(QWidget *p = 0, const char* name = 0, WFlags fl = 0);
00059 #endif
00060 ~Gutenbrowser();
00061 LibraryDialog* LibraryDlg;
00062 QButton* InfoBar;
00063 QFile newindexLib, indexLib;
00064 QListBox *mainList;
00065 QPrinter *printer;
00066 QString brow;
00067 QString file_name;
00068 QString fontStr, pointSizeStr, weightStr, italicStr, boldStr;
00069 QString ftp_base_dir;
00070 QString ftp_host;
00071 QString iniFile;
00072 QString listItemFile;
00073 QString listItemNumber;
00074 QString listItemTitle;
00075 QString listItemYear;
00076 QString local_index;
00077 QString local_library;
00078 QString networkUrl;
00079 QString pattern;
00080 QString prefBrowser;
00081 QString s_Wrap;
00082 QString status;
00083 QString statusTop;
00084 QString title;
00085 QPushButton *DownloadButton, *LibraryButton, *OpenButton, *ForwardButton, *BackButton, *PrintButton, *SearchButton, *dictionaryButton, *beginButton, *ExitButton, *OptionsButton, *FontButton, *ClearButton, *HelpButton, *setBookmarkButton;
00086 MenuButton* lastBmkButton;
00087 SearchDialog* searchDlg;
00088
00089 bool buttonsHidden;
00090 bool italic, bold;
00091 bool loadCheck;
00092 bool useSplitter;
00093 char host[1024];
00094 char login[1024];
00095 char password[1024];
00096 int check;
00097 int direction;
00098 int i_pageNum;
00099 int lastScrollRow;
00100 int lineCheck;
00101 int pages;
00102 int pointSize, weight;
00103
00104
00105 public slots:
00106
00107 private:
00108
00109
00110
00111
00112 QArray<int> pageStopArray;
00113
00114 MultiLine_Ex* Lview;
00115 QBoxLayout *buttons2;
00116 QBoxLayout *buttons;
00117 QBoxLayout *edits;
00118 QBoxLayout *menu;
00119 QBoxLayout *topLayout;
00120 QFile f;
00121 QPEMenuBar* menubar;
00122 QPopupMenu *fileMenu, *editMenu, *viewMenu, *DownloadMenu, *optionsMenu, *bookmarksMenu, *donateMenu, *helpMenu;
00123 bool useWrap;
00124 int fileHandle, currentFilePos, currentLine;
00125 int last_search;
00126
00127 bool getTitle( const char *file);
00128 bool setTitle();
00129 int repeatSearch();
00130 void Search();
00131 void OnNetworkDialog( const QString &networkUrl,const QString & output);
00132 void hideButtons();
00133
00134 private slots:
00135
00136 bool load( const char *fileName );
00137 bool setStatus();
00138 void BeginBtn();
00139 void TopBtn();
00140 void cleanUp();
00141 void doBeginBtn();
00142 void goGetit(const QString &url, bool showMsg);
00143 void infoGutenbrowser();
00144 void listClickedSlot( QListBoxItem *);
00145 void mainListPressed(int, QListBoxItem *, const QPoint &);
00146 void menuEditTitle();
00147 void search_slot();
00148 void searchdone_slot();
00149 void setDocument(const QString&);
00150 void slotFilePrint();
00151
00152
00153
00154 protected:
00155
00156 bool UnZipIt(const QString &zipFile);
00157 bool b_queryExit;
00158 bool queryExit();
00159 bool showMainList;
00160 bool useIcons;
00161 bool working;
00162
00163
00164 protected slots:
00165 void hideView();
00166
00167 void BackBtn();
00168 void Bookmark( int);
00169 void ByeBye();
00170 void ChangeFont();
00171 void ClearEdit();
00172 void DownloadIndex();
00173 void ForwardBtn();
00174 void HelpBtn();
00175 void InfoBarClick();
00176 void LibraryBtn();
00177 void LookupBtn();
00178 void OpenBtn();
00179 void PrintBtn();
00180 void SearchBtn();
00181 void annotations();
00182 void doOptions();
00183 void donateByteMonkie();
00184 void donateGutenberg();
00185 void downloadFtpList();
00186 void downloadLibIndex();
00187 void enableButtons(bool);
00188 void fillWithTitles();
00189 void fixKeys();
00190 void initButtonBar();
00191 void initConfig();
00192 void initMenuBar();
00193 void initSlots();
00194 void initStatusBar();
00195 void initView();
00196 void menuGoogle();
00197 void menuOpen();
00198 void searchGoogle(const QString &);
00199 void setBookmark();
00200 void toggleButtonIcons( bool usingIcons);
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215 protected:
00216
00217 int doSearch(const QString & s_pattern , bool case_sensitive, bool forward, int line, int col );
00218 void focusInEvent( QFocusEvent* );
00219 void focusOutEvent( QFocusEvent* );
00220 void keyPressEvent( QKeyEvent * );
00221 void keyReleaseEvent( QKeyEvent *e);
00222 void resizeEvent( QResizeEvent * );
00223 void writeConfig();
00224
00225 };
00226 #endif
00227