-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmainwindow.h
More file actions
executable file
·359 lines (286 loc) · 9.93 KB
/
mainwindow.h
File metadata and controls
executable file
·359 lines (286 loc) · 9.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
/* Copyright © Abouzakaria
* (c)GPL2 (c)GPL3
*
* This file is part of booksorg.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 or at your option version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "editbookdialog.h"
#include "mymodel.h"
#include "actions.h"
#include "searchtools.h"
#include "widgetpdf.h"
#include "ratingwidget.h"
#include "widgetbookmark.h"
#include <QMainWindow>
#include <QActionGroup>
#include <QToolBar>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void closeEvent(QCloseEvent *event);
signals:
void curPageChanged(int);
private slots:
void updateItem(QModelIndex index);
//! \brief slotOpen فتح الكتاب المحدد عند النقر على الكتاب
//!
void slotOpen();
//! \brief slotOpenFileName استدعاء فتح الكتاب
//! \param fileName مسار الكتاب
//!
void slotOpenFileName(const QString &fileName);
//! \brief bookTitle جلب عنوان الكتاب اذا كان موجودا
//! او اضافته اذا لم يكن موجودا
//! \param fileName مسار الكتاب
//! \param w الودجات الحاوية للكتاب
//! \return عنوان الكتاب
//!
QString bookTitle(const QString &fileName);
//! \brief slotOpenWith فتح الكتاب بببرنامج خارجي
//!
void slotOpenWith();
//! \brief addBook اضافة كتاب جديد
//!
bool addBook(const QString &file=QString());
//! \brief setCurentTab في حال تغير اللسان
//! سيتم تغيير القوائم والاوامر حسب اللسان وما يحويه
//! \param arg معرف اللسان
//!
void setCurentTab(int arg);
//! \brief scanFolder مسح مجلد لاضافة كتب
//!
void scanFolder();
//! \brief editBookOrGroup تحرير المجموعة او الكتاب
//!
void editBookOrGroup();
//! \brief editBookInfo تحرير الكتاب المفتوح
//!
void editBookInfo();
//! \brief deletSelectedIndexes حذف العناصر المحددة
//!
void deletSelectedIndexes();
//! \brief changeAuthor تغيير تسمية المؤلف
//!
void changeAuthor();
//! \brief changeGroup تغيير تسمية المجموعة
//!
void changeGroup();
//! \brief moveItems نقل العنصر الى مجموعة او مؤلف موجود
//! \param authors مجموعة او مؤلف
//!
void moveItems(bool authors);
//! \brief goRootPath الانتقال الى البيت سواء مجموعة او مؤلف او تنقيط
//!
void goRootPath();
//! \brief slotItemActivated عند تفعيل عنصر
//! \param index المعرف
//!
void slotItemActivated(const QModelIndex & index);
//! \brief slotcurrentRowChanged عند تحديد عنصر
//! يتم جلد معلومات العنصر لعرضها على نافذة المعلومات
//! \param current معرف العنصر
//!
void slotcurrentRowChanged(const QModelIndex ¤t, const QModelIndex &);
//! \brief customContextMenu تكوين القائمة الفرعية
//!
void customContextMenu(QPoint);
//! \brief setupTools تكوين الاوامر والقوائم
//!
void setupTools();
//! \brief switchSkins التغيير بين السمة التقليدية والجديدة
//!
void switchSkins();
//! \brief toggleView تغيير العرض بين الايقونات والتفاصيل
//! \param action الامر
//!
void toggleView(QAction* action);
//! \brief toggleRootPath تغيير المنزل بين مجموعات او مؤلفيين او تنقيط
//! \param action الامر
//!
void toggleRootPath(QAction* action);
//! \brief pathChanged مغرفة هل الودجات المفعلة هي لعض الايقومات او التفاصيل
//!
void pathChanged(QString);
//! \brief currentIndex معرفة مغرف العنصر المفعل
//! \return المعرف
//!
QModelIndex currentIndex();
//! \brief goSearch بدأ البحث
//! \param arg نص البحث
//!
void goSearch(const QString &arg);
//! \brief updateRecentFileActions تحميل الملفات السابقة
//!
void updateRecentFileActions();
//! \brief openRecentFile فتح ملف سابق
//!
void openRecentFile();
//! \brief slotAbout حول البرنامج
//!
void slotAbout();
//! \brief swichLanguage تغيير اللغة
//! \param act الامر
//!
void swichLanguage(QAction* act);
//! \brief switchToolBarMode امر تغيير السمة
//! \param arg التقليدية او الجديدة
//!
void switchToolBarMode(bool arg);
//! \brief slotAddBookmark اضافة مفضلة
//!
void slotAddBookmark();
//! \brief bookmarkOpenDocument فتح الملف من المفضلة
//! \param fileName الملف
//! \param page الصفحة
//! \param left ليسار
//! \param top فوق
//!
void bookmarkOpenDocument(const QString &fileName,int page,qreal left,qreal top);
//! \brief on_tabWidget_tabCloseRequested عند غلق اللسان
//! \param index المعرف
//!
void on_tabWidget_tabCloseRequested(int index);
//! \brief widgetPdf معرفة الودجاة المفعلة
//! \return الودجاة
//!
WidgetPdf *widgetPdf();
//! \brief showTabBooks عرض لسان اختيار الكتب
//!
void showTabBooks();
//! \brief wPdfEmitFirstPage الانتقال الى الضفحة الاولى من ملف
//!
void wPdfEmitFirstPage();
//! \brief wPdfEmitPreviousPage الانتقال الى الصفحة السابقة
//!
void wPdfEmitPreviousPage();
//! \brief wPdfEmitNextPage الانتقال الى الصفحة التالية
//!
void wPdfEmitNextPage();
//! \brief wPdfEmitLastPage الانتقال الى الصفحة الاخيرة
//!
void wPdfEmitLastPage();
//! \brief wPdfEmitAddBookmark اضافة مفضلة
//!
void wPdfEmitAddBookmark();
//! \brief wPdfRefresh تحديث ملف بي دي اف
//!
void wPdfRefresh();
//! \brief wPdfEmitZoomIn تكبير ملف بي دي اف
//!
void wPdfEmitZoomIn();
//! \brief wPdfEmitZoomOut تصغير ملف بي دي اف
//!
void wPdfEmitZoomOut();
//! \brief wPdfEmitSetRubberBand تفعيل وضع التحديد في ملف بي دي اف
//! \param arg
//!
void wPdfEmitSetRubberBand(bool arg);
//! \brief wPdfEmitSetInvertColors عكس الالوان في ملف بي دي اف
//! \param arg
//!
void wPdfEmitSetInvertColors(bool arg);
//! \brief wPdfSetPage الانتقال الى صفحة في ملف بي دي اف
//! \param arg
//!
void wPdfSetPage(int arg);
//! \brief wPdfSetContinousMode وضع التتابع ملف بي دي اف
//! \param arg
//!
void wPdfSetContinousMode(bool arg);
//! \brief wPdfSetFiteWith عرض التتابع او صفحة واحدة
//! \param arg
//!
void wPdfSetFiteWith(int arg);
//! \brief wPdfSetLayoutMode طريقة عرض الصفحة
//! \param arg
//!
void wPdfSetLayoutMode(int arg);
//! \brief showHideSearch تفغيل الغاء البحث
//!
void showHideSearch();
//! \brief on_labelTags_linkActivated تفعيل الوسم
//! \param link
//!
void on_labelTags_linkActivated(const QString &link);
//! \brief configure تحرير الخيارات
//!
void configure();
void fontModel(EditBookDialog *w);
void slotShowFullScreen(bool show);
bool chekForaddBook();
void addCurrentBook();
private:
void dragEnterEvent(QDragEnterEvent *e);
void dropEvent(QDropEvent *e);
Ui::MainWindow *ui;
enum ViewMode{
IconView,
DetailView
};
//!
//! \brief mPath
//!
// Path *mPath;
//! \brief mRatingWidget ودجات التنقيط
//!
RatingWidget *mRatingWidget;
//! \brief mWidgetPdf ودجات الحاوية لملفات بي دي اف
//!
WidgetPdf *mWidgetPdf;
//! \brief mWidgetBookmark ودجات المفضلات
//!
WidgetBookmark *mWidgetBookmark;
//! \brief mModel قاعدة البيانات
//!
MyModel *mModel;
//! \brief mSearchTools اداة البحث
//!
SearchTools *mSearchTools;
//! \brief mActions كل الاوامر الخاصة بقائمة الكتب او البي دي اف
//!
Actions *mActions;
/// الاوامر المشتركة
QAction *mActBooksTab;
QAction *mActScanFolder;
QAction *mActOpen;
QAction *mActOpenWith;
QAction *mActMoveToGroup;
QAction *mActMoveToAuthor;
QAction *mActAddBook;
QAction *mActAddCurrent;
QAction *mActAbout;
QAction *mActFind;
QAction *mActStandardMode;
QAction *mActShowFullScreen;
QAction *mActcleanBooks;
/// عدد الملفات السابقة
enum { MaxRecentFiles = 7 };
QAction *recentFileActs[MaxRecentFiles];
QMenu *menuRecent;
QAction *mActRecents;
QAction *mActConfig;
bool mDebug;
};
#endif // MAINWINDOW_H