BiblioteQ
biblioteq_magazine.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_MAGAZINE_H_
29 #define _BIBLIOTEQ_MAGAZINE_H_
30 
31 #include "biblioteq_item.h"
32 #include "ui_biblioteq_maginfo.h"
33 #include "ui_biblioteq_passwordPrompt.h"
34 
35 #include <QNetworkReply>
36 #include <QPointer>
37 
39 
40 class biblioteq_magazine: public QMainWindow, public biblioteq_item
41 {
42  Q_OBJECT
43 
44  public:
45  biblioteq_magazine(biblioteq *parentArg,
46  const QString &oidArg,
47  const QModelIndex &index,
48  const QString &subTypeArg);
49  virtual ~biblioteq_magazine();
50  Ui_magDialog dialog(void) const;
51  void duplicate(const QString &p_oid, const int state);
52  void insert(void);
53  void modify(const int);
54  void populateDisplayAfterSRU(const QByteArray &data);
55  void populateDisplayAfterZ3950(const QStringList &list,
56  const QString &recordSyntax);
57 
58  void setPublicationDateFormat(const QString &dateFormat)
59  {
60  ma.publication_date->setDisplayFormat(dateFormat);
61  }
62 
63  void search(const QString &field = "", const QString &value = "");
64  void updateWindow(const int state);
65 
66  protected:
67  enum Columns
68  {
69  COMPRESSED_SIZE = 2,
70  DESCRIPTION = 3,
71  DIGEST = 1,
72  FILE = 0,
73  MYOID = 4
74  };
75 
76  QByteArray m_sruResults;
77  QDialog *m_proxyDialog;
78  QNetworkAccessManager *m_sruManager;
79  QPalette m_cb_orig_pal;
80  QPalette m_te_orig_pal;
81  QPalette m_white_pal;
82  QPointer<biblioteq_generic_thread> m_thread;
83  QPointer<biblioteq_item_working_dialog> m_sruWorking;
84  QString m_dt_orig_ss;
85  QString m_engWindowTitle;
86  QString m_subType;
87  Ui_magDialog ma;
88  Ui_passwordDialog ui_p;
89  bool m_duplicate;
90  void changeEvent(QEvent *event);
91  void closeEvent(QCloseEvent *event);
92  void createFile(const QByteArray &digest,
93  const QByteArray &bytes,
94  const QString &fileName) const;
95  void createSRUDialog(void);
96  void populateFiles(void);
97  void resetQueryHighlights(void);
98 
99  protected slots:
100  void setGlobalFonts(const QFont &font);
101  void slotAttachFiles(void);
102  void slotCancel(void);
103  void slotDeleteFiles(void);
104  void slotExportFiles(void);
105  void slotFilesDoubleClicked(QTableWidgetItem *item);
106  void slotGo(void);
107  void slotParseMarcTags(void);
108  void slotPopulateCopiesEditor(void);
109  void slotPrint(void);
110  void slotProxyAuthenticationRequired(const QNetworkProxy &proxy,
111  QAuthenticator *authenticator);
112  void slotPublicationDateEnabled(bool state);
113  void slotReset(void);
114  void slotSRUCanceled(void);
115  void slotSRUDownloadFinished(bool error);
116  void slotSRUDownloadFinished(void);
117  void slotSRUError(QNetworkReply::NetworkError error);
118  void slotSRUQuery(void);
119  void slotSRUQueryError(const QString &text);
120  void slotSRUReadyRead(void);
121  void slotSRUSslErrors(const QList<QSslError> &list);
122  void slotSelectImage(void);
123  void slotShowPDF(void);
124  void slotShowUsers(void);
125  void slotZ3950Query(void);
126  void sruDownloadFinished(void);
127 
128  signals:
129  void sruQueryError(const QString &text);
130 };
131 
133 {
134  Q_OBJECT
135 
136  public:
137  biblioteq_journal(biblioteq *parentArg,
138  const QString &oidArg,
139  const QModelIndex &index);
141  void changeEvent(QEvent *event);
142  void closeEvent(QCloseEvent *event);
143 
144  private slots:
145  void slotCancel(void);
146 };
147 
148 #endif
Definition: biblioteq_generic_thread.h:38
Definition: biblioteq_item.h:72
Definition: biblioteq_magazine.h:133
Definition: biblioteq_magazine.h:41
Definition: biblioteq.h:274