mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-22 16:04:07 +00:00
31d7f2ed30
In frontend/qt4/Dialog.C, we use these class like this: } else if (name == "citation") { QCitation * ci = new QCitation(*dialog); dialog->setController(ci); dialog->setView(new QCitationDialog(*dialog, ci)); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); Now, it should be possible to define another view like this: } else if (name == "citation-inline") { QCitation * ci = new QCitation(*dialog); dialog->setController(ci); dialog->setView(new QCitationInline(*dialog, ci)); All the citation functionalities are not there yet but the basic ones are there. There are still a few "intelligence" still to be transfered from the view to the dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13635 a592a061-630c-0410-9148-cb99ea01b6c8
117 lines
2.5 KiB
C++
117 lines
2.5 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file QCitation.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
* \author Kalle Dalheimer
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef QCITATION_H
|
|
#define QCITATION_H
|
|
|
|
#include "ControlCitation.h"
|
|
|
|
#include <QStringListModel>
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
class QCitation : public ControlCitation
|
|
{
|
|
public:
|
|
///
|
|
QCitation(Dialog &);
|
|
|
|
QStringListModel * available()
|
|
{ return &available_keys_; }
|
|
|
|
QStringListModel * selected()
|
|
{ return &selected_keys_; }
|
|
|
|
QStringListModel * found()
|
|
{ return &found_keys_; }
|
|
|
|
QString textBefore();
|
|
QString textAfter();
|
|
|
|
QModelIndex findKey(QString const & str, QModelIndex const & index) const;
|
|
QModelIndex findKey(QString const & str) const;
|
|
|
|
void addKeys(QModelIndexList const & indexes);
|
|
void deleteKeys(QModelIndexList const & indexes);
|
|
void upKey(QModelIndexList const & indexes);
|
|
void downKey(QModelIndexList const & indexes);
|
|
|
|
QStringList citationStyles(int sel);
|
|
|
|
|
|
virtual bool isValid();
|
|
|
|
/// Set the Params variable for the Controller.
|
|
virtual void apply(int const choice, bool const full, bool const force,
|
|
QString before, QString After);
|
|
|
|
/// Update dialog before/whilst showing it.
|
|
virtual void updateModel();
|
|
|
|
private:
|
|
/// available keys
|
|
QStringListModel available_keys_;
|
|
|
|
/// selected keys
|
|
QStringListModel selected_keys_;
|
|
|
|
/// found keys
|
|
QStringListModel found_keys_;
|
|
};
|
|
|
|
|
|
/** A controller for Citation dialogs.
|
|
*/
|
|
/*
|
|
class Citation {
|
|
public:
|
|
///
|
|
Citation();
|
|
|
|
///
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
/// clean-up on hide.
|
|
virtual void clearParams();
|
|
|
|
/** Disconnect from the inset when the Apply button is pressed.
|
|
* Allows easy insertion of multiple citations.
|
|
*/
|
|
/* virtual bool disconnectOnApply() const { return true; }
|
|
|
|
/// Returns a reference to the map of stored keys
|
|
biblio::InfoMap const & bibkeysInfo() const;
|
|
|
|
///
|
|
biblio::CiteEngine_enum getEngine() const;
|
|
|
|
/// Possible citations based on this key
|
|
std::vector<std::string> const getCiteStrings(std::string const & key) const;
|
|
|
|
/// available CiteStyle-s (depends on availability of Natbib/Jurabib)
|
|
static std::vector<biblio::CiteStyle> const & getCiteStyles() {
|
|
return citeStyles_;
|
|
}
|
|
private:
|
|
/// The info associated with each key
|
|
biblio::InfoMap bibkeysInfo_;
|
|
|
|
///
|
|
static std::vector<biblio::CiteStyle> citeStyles_;
|
|
};
|
|
*/
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // QCITATION_H
|