2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QCitationDialog.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Kalle Dalheimer
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QCITATIONDIALOG_H
|
|
|
|
#define QCITATIONDIALOG_H
|
|
|
|
|
|
|
|
#include "ui/QCitationUi.h"
|
|
|
|
#include "ui/QCitationFindUi.h"
|
|
|
|
#include "controllers/biblio.h"
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <QDialog>
|
2006-03-25 21:26:09 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class Q3ListBox;
|
|
|
|
class Q3ListBoxItem;
|
|
|
|
|
|
|
|
class InsetCommandParams;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QCitation;
|
2006-03-25 21:26:09 +00:00
|
|
|
class QCitationFind;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
class QCitationDialog : public QDialog, public Ui::QCitationUi {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
QCitationDialog(QCitation * form);
|
|
|
|
|
|
|
|
~QCitationDialog();
|
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
void update(InsetCommandParams const & params);
|
|
|
|
void apply(InsetCommandParams & params);
|
|
|
|
|
|
|
|
// virtual bool isValid();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
|
|
// void on_selectedLB_currentChanged(Q3ListBoxItem*);
|
|
|
|
|
|
|
|
void on_okPB_clicked();
|
|
|
|
void on_cancelPB_clicked();
|
|
|
|
void on_restorePB_clicked();
|
|
|
|
void on_applyPB_clicked();
|
|
|
|
void on_addPB_clicked();
|
|
|
|
|
|
|
|
void on_deletePB_clicked();
|
|
|
|
void on_upPB_clicked();
|
|
|
|
void on_downPB_clicked();
|
|
|
|
void on_findLE_textChanged(const QString & text);
|
|
|
|
void on_advancedSearchPB_clicked();
|
|
|
|
|
|
|
|
virtual void changed();
|
|
|
|
|
|
|
|
private:
|
2006-03-05 17:24:44 +00:00
|
|
|
void setButtons();
|
|
|
|
/// open the find dialog if nothing selected
|
|
|
|
void openFind();
|
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
/// fill the styles combo
|
|
|
|
void fillStyles();
|
|
|
|
|
|
|
|
/// set the styles combo
|
|
|
|
void updateStyle();
|
|
|
|
|
|
|
|
/// check if apply has been pressed
|
|
|
|
bool open_find_;
|
|
|
|
|
|
|
|
/// selected keys
|
|
|
|
std::vector<std::string> citekeys;
|
|
|
|
|
|
|
|
/// selected natbib style
|
|
|
|
int style_;
|
|
|
|
|
|
|
|
QCitation * form_;
|
|
|
|
QCitationFind * find_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class QCitationFind: public QDialog, public Ui::QCitationFindUi {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
QCitationFind(QCitation * form, QWidget * parent = 0, Qt::WFlags f = 0);
|
|
|
|
|
|
|
|
void update();
|
|
|
|
|
|
|
|
std::vector<std::string> const & foundCitations()
|
|
|
|
{ return foundkeys; }
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void newCitations();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
void on_availableLB_currentChanged(Q3ListBoxItem *);
|
|
|
|
void on_availableLB_selected(Q3ListBoxItem *);
|
|
|
|
void on_addPB_clicked();
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual void previous();
|
|
|
|
virtual void next();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void find(biblio::Direction dir);
|
|
|
|
|
2006-03-25 21:26:09 +00:00
|
|
|
/// selected keys
|
|
|
|
std::vector<std::string> foundkeys;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
QCitation * form_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QCITATIOINDIALOG_H
|