Diffstat (limited to 'noncore/apps/opie-gutenbrowser/gutenbrowser.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.h | 226 |
1 files changed, 226 insertions, 0 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.h b/noncore/apps/opie-gutenbrowser/gutenbrowser.h new file mode 100644 index 0000000..acb6e59 --- a/dev/null +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.h | |||
@@ -0,0 +1,226 @@ | |||
1 | /*************************************************************************** | ||
2 | gutenbrowser.h - description | ||
3 | ------------------- | ||
4 | begin : Mon Jul 24 22:33:12 MDT 2000 | ||
5 | copyright : (C) 2000 -2004 by llornkcor | ||
6 | email : ljp@llornkcor.com | ||
7 | ***************************************************************************/ | ||
8 | /*************************************************************************** | ||
9 | * * | ||
10 | * This program is free software; you can redistribute it and/or modify * | ||
11 | * it under the terms of the GNU General Public License as published by * | ||
12 | * the Free Software Foundation; either version 2 of the License, or * | ||
13 | * (at your option) any later version. * | ||
14 | * * | ||
15 | ***************************************************************************/ | ||
16 | #ifndef GUTENBROWSER_H | ||
17 | #define GUTENBROWSER_H | ||
18 | |||
19 | class QPainter; | ||
20 | class QPushButton; | ||
21 | class QListView; | ||
22 | class QString; | ||
23 | class QTextView; | ||
24 | class QPopupMenu; | ||
25 | class QMenuBar; | ||
26 | class QToolBar; | ||
27 | class QLayout; | ||
28 | class QToolTip; | ||
29 | class QPixMap; | ||
30 | class QFile; | ||
31 | |||
32 | #include <qtoolbutton.h> | ||
33 | |||
34 | #include <qpe/qpeapplication.h> | ||
35 | #include <qpe/qpemenubar.h> | ||
36 | #include <qpe/menubutton.h> | ||
37 | |||
38 | #include <qmainwindow.h> | ||
39 | #include <qapplication.h> | ||
40 | #include <qwhatsthis.h> | ||
41 | #include <qfontmetrics.h> | ||
42 | #include <qfontinfo.h> | ||
43 | #include <qpoint.h> | ||
44 | |||
45 | #include "LibraryDialog.h" | ||
46 | #include "multiline_ex.h" | ||
47 | #include "resource.h" | ||
48 | |||
49 | #include <qvaluelist.h> | ||
50 | |||
51 | class Gutenbrowser : public QMainWindow { | ||
52 | Q_OBJECT | ||
53 | public: | ||
54 | static QString appName() { return QString::fromLatin1("gutenbrowser"); } | ||
55 | #ifdef NOQUICKLAUNCH | ||
56 | Gutenbrowser(); | ||
57 | #else | ||
58 | Gutenbrowser(QWidget *p = 0, const char* name = 0, WFlags fl = 0); | ||
59 | #endif | ||
60 | ~Gutenbrowser(); | ||
61 | LibraryDialog* LibraryDlg; | ||
62 | QButton* InfoBar; | ||
63 | QFile newindexLib, indexLib; | ||
64 | QListBox *mainList; | ||
65 | QPrinter *printer; | ||
66 | QString brow; | ||
67 | QString file_name; | ||
68 | QString fontStr, pointSizeStr, weightStr, italicStr, boldStr; | ||
69 | QString ftp_base_dir; | ||
70 | QString ftp_host; | ||
71 | QString iniFile; | ||
72 | QString listItemFile; | ||
73 | QString listItemNumber; | ||
74 | QString listItemTitle; | ||
75 | QString listItemYear; | ||
76 | QString local_index; | ||
77 | QString local_library; | ||
78 | QString networkUrl; | ||
79 | QString pattern; | ||
80 | QString prefBrowser; | ||
81 | QString s_Wrap; | ||
82 | QString status; | ||
83 | QString statusTop; | ||
84 | QString title; | ||
85 | QPushButton *DownloadButton, *LibraryButton, *OpenButton, *ForwardButton, *BackButton, *PrintButton, *SearchButton, *dictionaryButton, *beginButton, *ExitButton, *OptionsButton, *FontButton, *ClearButton, *HelpButton, *setBookmarkButton; | ||
86 | MenuButton* lastBmkButton; | ||
87 | SearchDialog* searchDlg; | ||
88 | |||
89 | bool buttonsHidden; | ||
90 | bool italic, bold; | ||
91 | bool loadCheck; | ||
92 | bool useSplitter; | ||
93 | char host[1024]; | ||
94 | char login[1024]; | ||
95 | char password[1024]; | ||
96 | int check; | ||
97 | int direction; | ||
98 | int i_pageNum; | ||
99 | int lastScrollRow; | ||
100 | int lineCheck; | ||
101 | int pages; | ||
102 | int pointSize, weight; | ||
103 | // int styleI; | ||
104 | |||
105 | public slots: | ||
106 | |||
107 | private: | ||
108 | |||
109 | /* typedef QValueList<int> pageStop; */ | ||
110 | /* pageStop pageStopArray; */ | ||
111 | // QVector<int> pageStopArray; | ||
112 | QArray<int> pageStopArray; | ||
113 | |||
114 | MultiLine_Ex* Lview; | ||
115 | QBoxLayout *buttons2; | ||
116 | QBoxLayout *buttons; | ||
117 | QBoxLayout *edits; | ||
118 | QBoxLayout *menu; | ||
119 | QBoxLayout *topLayout; | ||
120 | QFile f; | ||
121 | QPEMenuBar* menubar; | ||
122 | QPopupMenu *fileMenu, *editMenu, *viewMenu, *DownloadMenu, *optionsMenu, *bookmarksMenu, *donateMenu, *helpMenu; | ||
123 | bool useWrap; | ||
124 | int fileHandle, currentFilePos, currentLine; | ||
125 | int last_search; | ||
126 | |||
127 | bool getTitle( const char *file); | ||
128 | bool setTitle(); | ||
129 | int repeatSearch(); | ||
130 | void Search(); | ||
131 | void OnNetworkDialog( const QString &networkUrl,const QString & output); | ||
132 | void hideButtons(); | ||
133 | |||
134 | private slots: | ||
135 | |||
136 | bool load( const char *fileName ); | ||
137 | bool setStatus(); | ||
138 | void BeginBtn(); | ||
139 | void TopBtn(); | ||
140 | void cleanUp(); | ||
141 | void doBeginBtn(); | ||
142 | void goGetit(const QString &url, bool showMsg); | ||
143 | void infoGutenbrowser(); | ||
144 | void listClickedSlot( QListBoxItem *); | ||
145 | void mainListPressed(int, QListBoxItem *, const QPoint &); | ||
146 | void menuEditTitle(); | ||
147 | void search_slot(); | ||
148 | void searchdone_slot(); | ||
149 | void setDocument(const QString&); | ||
150 | void slotFilePrint(); | ||
151 | // void setStyle(int styleInt); | ||
152 | |||
153 | |||
154 | protected: | ||
155 | |||
156 | bool UnZipIt(const QString &zipFile); | ||
157 | bool b_queryExit; | ||
158 | bool queryExit(); | ||
159 | bool showMainList; | ||
160 | bool useIcons; | ||
161 | bool working; | ||
162 | |||
163 | |||
164 | protected slots: | ||
165 | |||
166 | void BackBtn(); | ||
167 | void Bookmark( int); | ||
168 | void ByeBye(); | ||
169 | void ChangeFont(); | ||
170 | void ClearEdit(); | ||
171 | void DownloadIndex(); | ||
172 | void ForwardBtn(); | ||
173 | void HelpBtn(); | ||
174 | void InfoBarClick(); | ||
175 | void LibraryBtn(); | ||
176 | void LookupBtn(); | ||
177 | void OpenBtn(); | ||
178 | void PrintBtn(); | ||
179 | void SearchBtn(); | ||
180 | void annotations(); | ||
181 | void doOptions(); | ||
182 | void donateByteMonkie(); | ||
183 | void donateGutenberg(); | ||
184 | void downloadFtpList(); | ||
185 | void downloadLibIndex(); | ||
186 | void enableButtons(bool); | ||
187 | void fillWithTitles(); | ||
188 | void fixKeys(); | ||
189 | void initButtonBar(); | ||
190 | void initConfig(); | ||
191 | void initMenuBar(); | ||
192 | void initSlots(); | ||
193 | void initStatusBar(); | ||
194 | void initView(); | ||
195 | void menuGoogle(); | ||
196 | void menuOpen(); | ||
197 | void searchGoogle(const QString &); | ||
198 | void setBookmark(); | ||
199 | void toggleButtonIcons( bool usingIcons); | ||
200 | // virtual void setBrowser(); | ||
201 | // void stylePlatinum(); | ||
202 | // void styleWindows(); | ||
203 | // void defaultStyle(); | ||
204 | /* void styleMotif(); */ | ||
205 | /* void styleMotifPlus(); */ | ||
206 | /* void styleWood(); */ | ||
207 | /* void stylePlatinumPlus(); */ | ||
208 | /* void styleCDE(); */ | ||
209 | // void styleMetal(); | ||
210 | /* void styleSgi(); */ | ||
211 | /* void styleLace(); */ | ||
212 | /* void styleLacePlus(); */ | ||
213 | /* #endif */ | ||
214 | protected: | ||
215 | |||
216 | int doSearch(const QString & s_pattern , bool case_sensitive, bool forward, int line, int col ); | ||
217 | void focusInEvent( QFocusEvent* ); | ||
218 | void focusOutEvent( QFocusEvent* ); | ||
219 | void keyPressEvent( QKeyEvent * ); | ||
220 | void keyReleaseEvent( QKeyEvent *e); | ||
221 | void resizeEvent( QResizeEvent * ); | ||
222 | void writeConfig(); | ||
223 | // void moveSplitter( int pos); | ||
224 | }; | ||
225 | #endif | ||
226 | |||