blob: eef4bdcc9a986a1b4050dd469484511458e8b8c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
/***************************************************************************
copyright : (C) 2003-2006 by Robby Stephenson
email : robby@periapsis.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of version 2 of the GNU General Public License as *
* published by the Free Software Foundation; *
* *
***************************************************************************/
#ifndef FETCHDIALOG_H
#define FETCHDIALOG_H
#include "datavectors.h"
#include <kdialogbase.h>
#include <qguardedptr.h>
namespace Tellico {
class EntryView;
namespace Fetch {
class Fetcher;
class SearchResult;
}
namespace GUI {
class ComboBox;
class ListView;
}
}
namespace barcodeRecognition {
class barcodeRecognitionThread;
}
class KComboBox;
class KLineEdit;
class KPushButton;
class KStatusBar;
class KTextEdit;
class QProgressBar;
class QTimer;
class QCheckBox;
namespace Tellico {
/**
* @author Robby Stephenson
*/
class FetchDialog : public KDialogBase {
Q_OBJECT
public:
/**
* Constructor
*/
FetchDialog(QWidget* parent, const char* name = 0);
~FetchDialog();
public slots:
void slotResetCollection();
protected:
bool eventFilter(QObject* obj, QEvent* ev);
private slots:
void slotSearchClicked();
void slotClearClicked();
void slotAddEntry();
void slotMoreClicked();
void slotShowEntry();
void slotMoveProgress();
void slotStatus(const QString& status);
void slotUpdateStatus();
void slotFetchDone(bool checkISBN = true);
void slotResultFound(Tellico::Fetch::SearchResult* result);
void slotKeyChanged(int);
void slotSourceChanged(const QString& source);
void slotMultipleISBN(bool toggle);
void slotEditMultipleISBN();
void slotInit();
void slotLoadISBNList();
void slotUPC2ISBN();
void slotBarcodeRecognized(QString);
void slotBarcodeGotImage(QImage&);
private:
void startProgress();
void stopProgress();
void setStatus(const QString& text);
void adjustColumnWidth();
void customEvent( QCustomEvent *e );
class SearchResultItem;
KComboBox* m_sourceCombo;
GUI::ComboBox* m_keyCombo;
KLineEdit* m_valueLineEdit;
KPushButton* m_searchButton;
QCheckBox* m_multipleISBN;
KPushButton* m_editISBN;
GUI::ListView* m_listView;
EntryView* m_entryView;
KPushButton* m_addButton;
KPushButton* m_moreButton;
KStatusBar* m_statusBar;
QProgressBar* m_progress;
QTimer* m_timer;
QGuardedPtr<KTextEdit> m_isbnTextEdit;
QLabel *m_barcodePreview;
bool m_started;
int m_resultCount;
QString m_oldSearch;
QStringList m_isbnList;
QStringList m_statusMessages;
QMap<int, Data::EntryPtr> m_entries;
QPtrList<Fetch::SearchResult> m_results;
int m_collType;
barcodeRecognition::barcodeRecognitionThread *m_barcodeRecognitionThread;
};
} //end namespace
#endif
|