1 /*************************************************************************** 2 * Copyright (C) 2004-2021 by Pere Constans 3 * constans@molspaces.com 4 * cb2Bib version 2.0.1. Licensed under the GNU GPL version 3. 5 * See the LICENSE file that comes with this distribution. 6 ***************************************************************************/ 7 #ifndef C2BCITERWIDGET_H 8 #define C2BCITERWIDGET_H 9 10 #include "ui_c2bCiterWidget.h" 11 12 #include <QSystemTrayIcon> 13 14 15 class QLabel; 16 class c2bCiterModel; 17 class c2bCoreCiter; 18 class c2bSettings; 19 20 21 class c2bCiterWidget : public QWidget 22 { 23 24 Q_OBJECT 25 26 public: 27 explicit c2bCiterWidget(QWidget* parentw = 0); 28 ~c2bCiterWidget(); 29 30 31 public: 32 void load(); 33 void setTrayIcon(); 34 35 36 public slots: 37 void show(); 38 void toggleVisible(); 39 40 41 signals: 42 void openAnnote(); 43 void openFile(const QString& fn); 44 45 46 private: 47 QString _status_label; 48 QStringList _bibtex_files; 49 QSystemTrayIcon* _tray_icon; 50 Ui::c2bCiterWidget ui; 51 bool _clipboard_connected; 52 c2bCiterModel* _citations; 53 c2bCoreCiter* _citerP; 54 c2bSettings* _settingsP; 55 void reload(const c2bCiter::State& state); 56 void setActions(); 57 58 59 private slots: 60 void citeReferences(); 61 void doSearchInFiles(); 62 void editReference(); 63 void filterDataChanged(const QString& filter); 64 void help(); 65 void indexDocuments(); 66 void openDirectory(); 67 void openFile(); 68 void openFiles(); 69 void openUrl(); 70 void reload(); 71 void showLabel(); 72 void showLabel(const QString& label); 73 void showMessage(const QString& message); 74 void toggleCb2Bib(); 75 void toggleClipboard(); 76 void toggleFullScreen(); 77 void trayIconActivated(QSystemTrayIcon::ActivationReason r); 78 void updatePatternFilter(const bool mode, const QString& pattern); 79 }; 80 81 #endif