BiblioteQ: Source/biblioteq_batch_activities.h Source File

BiblioteQ

biblioteq_batch_activities.h
1 /*
2 ** Copyright (c) 2006 - present, Alexis Megas.
3 ** All rights reserved.
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 ** 1. Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** 3. The name of the author may not be used to endorse or promote products
14 ** derived from BiblioteQ without specific prior written permission.
15 **
16 ** BIBLIOTEQ IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 ** BIBLIOTEQ, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #ifndef _BIBLIOTEQ_BATCH_ACTIVITIES_H_
29 #define _BIBLIOTEQ_BATCH_ACTIVITIES_H_
30
31 #include <QApplication>
32 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
33 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
34 #include <QAudioOutput>
35 #endif
36 #include <QMediaPlayer>
37 #endif
38
39 #include "ui_biblioteq_batch_activities_browser.h"
40
41 class biblioteq;
42
43 class biblioteq_batch_activities: public QMainWindow
44 {
45 Q_OBJECT
46
47 public:
48 biblioteq_batch_activities(biblioteq *parent);
49 void reset(void);
50 void show(QMainWindow *parent, const bool center = true);
51
52 private:
53 enum class BorrowTableColumns
54 {
55 CATEGORY_COLUMN = 0,
56 COPY_IDENTIFIER_COLUMN = 2,
57 FIELD_COLUMN = 4,
58 IDENTIFIER_COLUMN = 1,
59 RESULTS_COLUMN = 3
60 };
61
62 enum class DiscoverTableColumns
63 {
64 CATEGORY_COLUMN = 1,
65 IDENTIFIER_COLUMN = 0,
66 TITLE_COLUMN = 2
67 };
68
69 enum class Pages
70 {
71 Borrow = 0,
72 Discover = 1,
73 Return = 2
74 };
75
76 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
77 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
78 QScopedPointer<QAudioOutput> m_audioOutput;
79 #endif
80 #endif
81 Ui_batchActivitiesBrowser m_ui;
82 biblioteq *m_qmain;
83 static QColor s_notSoOkColor;
84 static QColor s_okColor;
85 void borrow(void);
86 void changeEvent(QEvent *event);
87 void discover(void);
88 void play(const QString &file);
89 void returnItems(void);
90
91 private slots:
92 void slotAddBorrowingRow(void);
93 void slotAudioEnabled(void);
94 void slotBorrowItemChanged(QTableWidgetItem *item);
95 void slotBorrowerMemberIdEdited(const QString &text);
96 void slotClose(void);
97 void slotDeleteBorrowingRow(void);
98 void slotDiscoverMemberName(void);
99 void slotExportMissing(void);
100 void slotGo(void);
101 void slotListDiscoveredItems(void);
102 void slotListMembersReservedItems(void);
103 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
104 void slotMediaError(QMediaPlayer::Error error);
105 void slotMediaError(QMediaPlayer::Error error, const QString &errorString);
106 void slotMediaStatusChanged(QMediaPlayer::MediaStatus status);
107 #endif
108 void slotReset(void);
109 void slotScanBorrowingTimerTimeout(void);
110 void slotScanDiscoverTimerTimeout(void);
111 void slotScanReturnTimerTimeout(void);
112 void slotScannedBorrowing(void);
113 void slotScannedDiscover(void);
114 void slotScannedReturn(void);
115 void slotSetGlobalFonts(const QFont &font);
116
117 signals:
118 void listMembersReservedItems(const QString &id);
119 };
120
121 #endif
biblioteq_batch_activities
Definition: biblioteq_batch_activities.h:44
biblioteq
Definition: biblioteq.h:274