1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995 Matthias Ettrich
|
|
|
|
* Copyright (C) 1995-1998 The LyX Team.
|
|
|
|
*
|
|
|
|
*======================================================*/
|
|
|
|
|
|
|
|
#ifndef _INSET_BIB_H
|
|
|
|
#define _INSET_BIB_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
|
|
|
|
|
|
|
// Created by Alejandro 970222
|
|
|
|
|
|
|
|
|
|
|
|
/** Used to insert citations
|
|
|
|
*/
|
|
|
|
class InsetCitation: public InsetCommand {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetCitation(): InsetCommand("cite") { }
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetCitation(string const & key, string const & note=string());
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
~InsetCitation();
|
|
|
|
///
|
|
|
|
Inset* Clone() { return new InsetCitation(contents, options); }
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string getScreenLabel()const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Edit(int, int);
|
|
|
|
///
|
|
|
|
unsigned char Editable() const {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Used to insert bibitem's information (key and label)
|
|
|
|
|
|
|
|
Must be automatically inserted as the first object in a
|
|
|
|
bibliography paragraph.
|
|
|
|
*/
|
|
|
|
class InsetBibKey: public InsetCommand {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetBibKey(): InsetCommand("bibitem") { counter = 1; }
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetBibKey(string const & key, string const & label=string());
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
InsetBibKey(InsetBibKey const*);
|
|
|
|
///
|
|
|
|
~InsetBibKey();
|
|
|
|
///
|
|
|
|
Inset* Clone() { return new InsetBibKey(this); }
|
|
|
|
/// Currently \bibitem is used as a LyX2.x command, so we need this method.
|
|
|
|
void Write(FILE *);
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
virtual string getScreenLabel() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Edit(int, int);
|
|
|
|
///
|
|
|
|
unsigned char Editable() const {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
/// A user can't neither insert nor delete this inset
|
|
|
|
bool Deletable() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
void setCounter(int);
|
|
|
|
///
|
|
|
|
int getCounter() const { return counter; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
int counter;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Used to insert BibTeX's information
|
|
|
|
*/
|
|
|
|
class InsetBibtex: public InsetCommand {
|
|
|
|
public:
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetBibtex(): InsetCommand("BibTeX") { owner = 0; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
InsetBibtex(string const & dbase, string const & style,
|
1999-09-27 18:44:28 +00:00
|
|
|
Buffer *);
|
|
|
|
///
|
|
|
|
~InsetBibtex();
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
Inset* Clone() { return new InsetBibtex(contents, options, 0); }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
Inset::Code LyxCode() const
|
|
|
|
{
|
|
|
|
return Inset::BIBTEX_CODE;
|
|
|
|
}
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string getScreenLabel() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Edit(int, int);
|
|
|
|
///
|
|
|
|
int Latex(FILE *, signed char);
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
int Latex(string &file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string getKeys();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
unsigned char Editable() const {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
bool addDatabase(string const&);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
bool delDatabase(string const&);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
bool Display() const { return true; }
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
Buffer *owner;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|