2001-06-14 08:20:41 +00:00
|
|
|
// -*- C++ -*-
|
2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QRef.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
|
|
|
* \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
|
2001-03-23 06:31:30 +00:00
|
|
|
*/
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#ifndef QREF_H
|
|
|
|
#define QREF_H
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
#include "DialogBase.h"
|
|
|
|
#include "LString.h"
|
|
|
|
#include "boost/utility.hpp"
|
|
|
|
#include "insets/insetcommand.h"
|
|
|
|
|
|
|
|
class Dialogs;
|
|
|
|
class LyXView;
|
2001-08-19 13:25:15 +00:00
|
|
|
class QRefDialog;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
class QRef : public DialogBase {
|
2001-03-23 06:31:30 +00:00
|
|
|
public:
|
2001-08-19 13:25:15 +00:00
|
|
|
QRef(LyXView *, Dialogs *);
|
|
|
|
~QRef();
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
/// double-click a ref
|
|
|
|
void select(const char *);
|
|
|
|
/// highlight a ref
|
|
|
|
void highlight(const char *);
|
|
|
|
/// set sort
|
|
|
|
void set_sort(bool);
|
|
|
|
/// goto a ref (or back)
|
|
|
|
void goto_ref();
|
|
|
|
/// update dialog
|
|
|
|
void update();
|
|
|
|
/// update just the refs
|
|
|
|
void do_ref_update();
|
|
|
|
/// Apply changes
|
|
|
|
void apply();
|
|
|
|
/// close the connections
|
|
|
|
void close();
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum Type {
|
|
|
|
REF, PAGEREF, VREF, VPAGEREF, PRETTYREF
|
2001-08-19 13:25:15 +00:00
|
|
|
};
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
enum GotoType {
|
|
|
|
GOTOREF, GOTOBACK
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Create the dialog if necessary, update it and display it.
|
|
|
|
void show();
|
|
|
|
/// Hide the dialog.
|
|
|
|
void hide();
|
|
|
|
|
|
|
|
/// create a Reference inset
|
|
|
|
void createRef(string const &);
|
|
|
|
/// edit a Reference inset
|
|
|
|
void showRef(InsetCommand * const);
|
|
|
|
|
|
|
|
/// update the keys list
|
|
|
|
void updateRefs(void);
|
|
|
|
|
|
|
|
/// Real GUI implementation.
|
2001-08-19 13:25:15 +00:00
|
|
|
QRefDialog * dialog_;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
/// the LyXView we belong to
|
|
|
|
LyXView * lv_;
|
|
|
|
|
|
|
|
/** Which Dialogs do we belong to?
|
|
|
|
Used so we can get at the signals we have to connect to.
|
|
|
|
*/
|
|
|
|
Dialogs * d_;
|
|
|
|
/// pointer to the inset if any
|
|
|
|
InsetCommand * inset_;
|
|
|
|
/// insets params
|
|
|
|
InsetCommandParams params;
|
|
|
|
/// is the inset we are reading from a readonly buffer ?
|
|
|
|
bool readonly;
|
|
|
|
|
|
|
|
/// Hide connection.
|
2001-08-19 13:25:15 +00:00
|
|
|
SigC::Connection h_;
|
2001-03-23 06:31:30 +00:00
|
|
|
/// Update connection.
|
2001-08-19 13:25:15 +00:00
|
|
|
SigC::Connection u_;
|
2001-03-23 06:31:30 +00:00
|
|
|
/// Inset hide connection.
|
2001-08-19 13:25:15 +00:00
|
|
|
SigC::Connection ih_;
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
/// to sort or not to sort
|
|
|
|
bool sort;
|
|
|
|
|
|
|
|
/// where to go
|
|
|
|
GotoType gotowhere;
|
|
|
|
|
|
|
|
/// current type
|
|
|
|
Type type;
|
|
|
|
|
|
|
|
/// available references
|
|
|
|
std::vector< string > refs;
|
|
|
|
};
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#endif // QREF_H
|