2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiCitation.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
* \author Kalle Dalheimer
|
2007-03-25 01:32:12 +00:00
|
|
|
* \author Abdelrazak Younes
|
2007-08-31 22:16:11 +00:00
|
|
|
* \author Richard Heck
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUICITATION_H
|
|
|
|
#define GUICITATION_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#include "ControlCitation.h"
|
2007-08-20 16:30:02 +00:00
|
|
|
#include "support/docstring.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
#include <QStringList>
|
2006-03-25 21:26:09 +00:00
|
|
|
#include <QStringListModel>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiCitation : public ControlCitation
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
2007-08-31 05:53:55 +00:00
|
|
|
GuiCitation(Dialog &);
|
|
|
|
virtual ~GuiCitation() {}
|
2007-03-25 01:32:12 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
|
|
|
|
///
|
|
|
|
void init();
|
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Available keys
|
2007-03-25 01:32:12 +00:00
|
|
|
QStringListModel * available() { return &available_model_; }
|
2006-03-25 21:26:09 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Selected keys
|
2007-03-25 01:32:12 +00:00
|
|
|
QStringListModel * selected() { return &selected_model_; }
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Text before cite
|
2006-04-11 08:26:43 +00:00
|
|
|
QString textBefore();
|
2006-06-28 08:28:16 +00:00
|
|
|
|
|
|
|
/// Text after cite
|
2006-04-11 08:26:43 +00:00
|
|
|
QString textAfter();
|
|
|
|
|
2006-06-28 08:28:16 +00:00
|
|
|
/// Get key description
|
|
|
|
QString getKeyInfo(QString const &);
|
|
|
|
|
2006-12-15 09:58:44 +00:00
|
|
|
/// Clear selected keys
|
|
|
|
void clearSelection();
|
2007-08-20 16:30:02 +00:00
|
|
|
|
|
|
|
/// Return a list of available fields
|
|
|
|
QStringList getFieldsAsQStringList();
|
|
|
|
|
|
|
|
/// Return a list of available fields
|
|
|
|
QStringList getEntriesAsQStringList();
|
|
|
|
|
2007-03-25 01:32:12 +00:00
|
|
|
/// Find keys containing a string.
|
|
|
|
void findKey(
|
|
|
|
QString const & str, //< string expression
|
|
|
|
bool only_keys, //< set to true if only keys shall be searched.
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring field, //<field to search, empty for all fields
|
|
|
|
docstring entryType, //<entry type to display, empty for all
|
2007-03-25 01:32:12 +00:00
|
|
|
bool case_sensitive, //< set to true for case sensitive search.
|
2007-08-20 16:30:02 +00:00
|
|
|
bool reg_exp, //< set to true if \c str is a regular expression.
|
|
|
|
bool reset = false //< whether to reset and search all keys
|
2007-03-25 01:32:12 +00:00
|
|
|
);
|
2006-06-28 08:28:16 +00:00
|
|
|
|
|
|
|
/// List of example cite strings
|
|
|
|
QStringList citationStyles(int);
|
2006-04-11 08:26:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Set the Params variable for the Controller.
|
2006-04-11 08:26:43 +00:00
|
|
|
virtual void apply(int const choice, bool const full, bool const force,
|
2006-06-28 08:28:16 +00:00
|
|
|
QString before, QString after);
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This third patch just re-factors some code presently in QCitation*. (It also incorporates some bug fixes that have been committed separately.) We're going to use essentially the same set of widgets for choosing modules that is used for choosing citation keys, so we pull the controlling logic out into a new class, QSelectionManager. I did not make this a QWidget. That seemed to me to be overkill, and it would have made things much more complicated, I think...and I'm not all that experienced with Qt, anyway. Anyone who wants to do that is of course welcome.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19860 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-28 16:49:40 +00:00
|
|
|
|
|
|
|
void setCitedKeys();
|
2006-04-11 08:26:43 +00:00
|
|
|
|
2007-05-28 22:27:45 +00:00
|
|
|
private:
|
2007-03-25 01:32:12 +00:00
|
|
|
/// available keys.
|
|
|
|
QStringListModel available_model_;
|
|
|
|
/// selected keys.
|
|
|
|
QStringListModel selected_model_;
|
|
|
|
/// All keys.
|
|
|
|
QStringList all_keys_;
|
|
|
|
/// Cited keys.
|
|
|
|
QStringList cited_keys_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2006-04-11 08:26:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUICITATION_H
|