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 prepareIcons(void);
50  void reset(void);
51  void show(QMainWindow *parent, const bool center = true);
52 
53  private:
54  enum class BorrowTableColumns
55  {
56  CATEGORY_COLUMN = 0,
57  COPY_IDENTIFIER_COLUMN = 2,
58  FIELD_COLUMN = 4,
59  IDENTIFIER_COLUMN = 1,
60  RESULTS_COLUMN = 3
61  };
62 
63  enum class DiscoverTableColumns
64  {
65  CATEGORY_COLUMN = 1,
66  IDENTIFIER_COLUMN = 0,
67  TITLE_COLUMN = 2
68  };
69 
70  enum class Pages
71  {
72  Borrow = 0,
73  Discover = 1,
74  Return = 2
75  };
76 
77 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
78 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
79  QScopedPointer<QAudioOutput> m_audioOutput;
80 #endif
81 #endif
82  Ui_batchActivitiesBrowser m_ui;
83  biblioteq *m_qmain;
84  static QColor s_notSoOkColor;
85  static QColor s_okColor;
86  void borrow(void);
87  void changeEvent(QEvent *event);
88  void discover(void);
89  void play(const QString &file);
90  void returnItems(void);
91 
92  private slots:
93  void slotAddBorrowingRow(void);
94  void slotAudioEnabled(void);
95  void slotBorrowItemChanged(QTableWidgetItem *item);
96  void slotBorrowerMemberIdEdited(const QString &text);
97  void slotClose(void);
98  void slotDeleteBorrowingRow(void);
99  void slotDiscoverMemberName(void);
100  void slotExportMissing(void);
101  void slotGo(void);
102  void slotListDiscoveredItems(void);
103  void slotListMembersReservedItems(void);
104 #ifdef BIBLIOTEQ_AUDIO_SUPPORTED
105  void slotMediaError(QMediaPlayer::Error error);
106  void slotMediaError(QMediaPlayer::Error error, const QString &errorString);
107  void slotMediaStatusChanged(QMediaPlayer::MediaStatus status);
108 #endif
109  void slotReset(void);
110  void slotScanBorrowingTimerTimeout(void);
111  void slotScanDiscoverTimerTimeout(void);
112  void slotScanReturnTimerTimeout(void);
113  void slotScannedBorrowing(void);
114  void slotScannedDiscover(void);
115  void slotScannedReturn(void);
116  void slotSetGlobalFonts(const QFont &font);
117 
118  signals:
119  void listMembersReservedItems(const QString &id);
120 };
121 
122 #endif
Definition: biblioteq_batch_activities.h:44
Definition: biblioteq.h:276