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:
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 slotClose(void);
96  void slotDeleteBorrowingRow(void);
97  void slotExportMissing(void);
98  void slotGo(void);
99  void slotListDiscoveredItems(void);
100  void slotListMembersReservedItems(void);
101 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
102  void slotMediaError(QMediaPlayer::Error error);
103  void slotMediaError(QMediaPlayer::Error error, const QString &errorString);
104  void slotMediaStatusChanged(QMediaPlayer::MediaStatus status);
105 #endif
106  void slotReset(void);
107  void slotScanBorrowingTimerTimeout(void);
108  void slotScanDiscoverTimerTimeout(void);
109  void slotScanReturnTimerTimeout(void);
110  void slotScannedBorrowing(void);
111  void slotScannedDiscover(void);
112  void slotScannedReturn(void);
113  void slotSetGlobalFonts(const QFont &font);
114 
115  signals:
116  void listMembersReservedItems(const QString &id);
117 };
118 
119 #endif
Definition: biblioteq_batch_activities.h:44
Definition: biblioteq.h:274