2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiRef.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 John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUIREF_H
|
|
|
|
#define GUIREF_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_RefUi.h"
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
#include "insets/InsetCommandParams.h"
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
class QListWidgetItem;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2008-04-20 09:24:14 +00:00
|
|
|
class GuiRef : public GuiDialog, public Ui::RefUi
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-25 10:57:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
public:
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiRef(GuiView & lv);
|
2007-04-25 10:57:54 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
private Q_SLOTS:
|
2007-04-25 10:57:54 +00:00
|
|
|
void changed_adaptor();
|
|
|
|
void gotoClicked();
|
|
|
|
void refHighlighted(QListWidgetItem *);
|
|
|
|
void selectionChanged();
|
|
|
|
void refSelected(QListWidgetItem *);
|
2009-02-19 19:41:41 +00:00
|
|
|
void sortToggled();
|
2009-02-24 22:56:57 +00:00
|
|
|
void caseSensitiveToggled();
|
2007-04-25 10:57:54 +00:00
|
|
|
void updateClicked();
|
2009-05-23 09:47:20 +00:00
|
|
|
void resetDialog();
|
|
|
|
void dialogRejected();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
private:
|
2007-10-05 19:04:38 +00:00
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
/** disconnect from the inset when the Apply button is pressed.
|
|
|
|
Allows easy insertion of multiple references. */
|
|
|
|
bool disconnectOnApply() const { return true; }
|
|
|
|
///
|
|
|
|
void gotoRef(std::string const &);
|
|
|
|
///
|
|
|
|
void gotoBookmark();
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
///
|
|
|
|
bool isValid();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// apply changes
|
2007-09-05 20:33:29 +00:00
|
|
|
void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update dialog
|
2007-09-11 18:33:42 +00:00
|
|
|
void updateContents();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// is name allowed for this ?
|
|
|
|
bool nameAllowed();
|
|
|
|
/// is type allowed for this ?
|
|
|
|
bool typeAllowed();
|
|
|
|
/// go to current reference
|
|
|
|
void gotoRef();
|
|
|
|
/// set go back button
|
|
|
|
void setGoBack();
|
|
|
|
/// set goto ref button
|
|
|
|
void setGotoRef();
|
|
|
|
/// re-enter references
|
|
|
|
void redoRefs();
|
|
|
|
/// update references
|
|
|
|
void updateRefs();
|
2008-04-20 09:24:14 +00:00
|
|
|
///
|
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
/// clean-up on hide.
|
|
|
|
void clearParams() { params_.clear(); }
|
|
|
|
/// clean-up on hide.
|
|
|
|
void dispatchParams();
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
InsetCommandParams params_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-24 22:10:56 +00:00
|
|
|
/// went to a reference ?
|
2006-03-05 17:24:44 +00:00
|
|
|
bool at_ref_;
|
2007-04-24 22:10:56 +00:00
|
|
|
/// the last reference entered or examined
|
|
|
|
QString last_reference_;
|
2006-03-05 17:24:44 +00:00
|
|
|
/// store the buffer settings
|
|
|
|
int restored_buffer_;
|
2008-10-28 15:38:28 +00:00
|
|
|
/// store the last active buffer
|
|
|
|
int active_buffer_;
|
2006-03-05 17:24:44 +00:00
|
|
|
/// the references
|
2007-04-25 16:39:21 +00:00
|
|
|
std::vector<docstring> refs_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUIREF_H
|