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 prepareFavorites(void);
98  void resetQueryHighlights(void);
99 
100  protected slots:
101  void setGlobalFonts(const QFont &font);
102  void slotAttachFiles(void);
103  void slotCancel(void);
104  void slotDeleteFiles(void);
105  void slotExportFiles(void);
106  void slotFilesDoubleClicked(QTableWidgetItem *item);
107  void slotGo(void);
108  void slotParseMarcTags(void);
109  void slotPopulateCopiesEditor(void);
110  void slotPrepareIcons(void);
111  void slotPrint(void);
112  void slotProxyAuthenticationRequired(const QNetworkProxy &proxy,
113  QAuthenticator *authenticator);
114  void slotPublicationDateEnabled(bool state);
115  void slotReset(void);
116  void slotSRUCanceled(void);
117  void slotSRUDownloadFinished(bool error);
118  void slotSRUDownloadFinished(void);
119  void slotSRUError(QNetworkReply::NetworkError error);
120  void slotSRUQuery(void);
121  void slotSRUQueryError(const QString &text);
122  void slotSRUReadyRead(void);
123  void slotSRUSslErrors(const QList<QSslError> &list);
124  void slotSelectImage(void);
125  void slotShowPDF(void);
126  void slotShowUsers(void);
127  void slotZ3950Query(void);
128  void sruDownloadFinished(void);
129 
130  signals:
131  void sruQueryError(const QString &text);
132 };
133 
135 {
136  Q_OBJECT
137 
138  public:
139  biblioteq_journal(biblioteq *parentArg,
140  const QString &oidArg,
141  const QModelIndex &index);
143  void changeEvent(QEvent *event);
144  void closeEvent(QCloseEvent *event);
145 
146  private slots:
147  void slotCancel(void);
148 };
149 
150 #endif
Definition: biblioteq_generic_thread.h:38
Definition: biblioteq_item.h:72
Definition: biblioteq_magazine.h:135
Definition: biblioteq_magazine.h:41
Definition: biblioteq.h:276