mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
371d623527
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@574 a592a061-630c-0410-9148-cb99ea01b6c8
151 lines
3.0 KiB
C++
151 lines
3.0 KiB
C++
// -*- C++ -*-
|
|
/* This file is part of*
|
|
* ======================================================
|
|
*
|
|
* LyX, The Document Processor
|
|
*
|
|
* Copyright 1995 Matthias Ettrich
|
|
* Copyright 1995-2000 The LyX Team.
|
|
*
|
|
* ====================================================== */
|
|
|
|
#ifndef INSET_BIB_H
|
|
#define INSET_BIB_H
|
|
|
|
#ifdef __GNUG__
|
|
#pragma interface
|
|
#endif
|
|
|
|
#include "insetcommand.h"
|
|
|
|
class Buffer;
|
|
|
|
/** Used to insert citations
|
|
*/
|
|
class InsetCitation: public InsetCommand {
|
|
public:
|
|
///
|
|
InsetCitation() : InsetCommand("cite") {}
|
|
///
|
|
InsetCitation(string const & key, string const & note = string());
|
|
///
|
|
~InsetCitation();
|
|
///
|
|
Inset * Clone() const {
|
|
return new InsetCitation(contents, options);
|
|
}
|
|
///
|
|
string getScreenLabel()const;
|
|
///
|
|
void Edit(BufferView *, int x, int y, unsigned int button);
|
|
///
|
|
unsigned char Editable() const {
|
|
return 1;
|
|
}
|
|
///
|
|
struct Holder {
|
|
InsetCitation * inset;
|
|
BufferView * view;
|
|
};
|
|
|
|
private:
|
|
///
|
|
Holder holder;
|
|
};
|
|
|
|
|
|
/** 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; }
|
|
///
|
|
InsetBibKey(string const & key, string const & label = string());
|
|
///
|
|
InsetBibKey(InsetBibKey const *);
|
|
///
|
|
~InsetBibKey();
|
|
///
|
|
Inset * Clone() const { return new InsetBibKey(this); }
|
|
/// Currently \bibitem is used as a LyX2.x command, so we need this method.
|
|
void Write(ostream &) const;
|
|
///
|
|
virtual string getScreenLabel() const;
|
|
///
|
|
void Edit(BufferView *, int x, int y, unsigned int button);
|
|
///
|
|
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; }
|
|
///
|
|
struct Holder {
|
|
InsetBibKey * inset;
|
|
BufferView * view;
|
|
};
|
|
|
|
private:
|
|
///
|
|
int counter;
|
|
|
|
///
|
|
Holder holder;
|
|
};
|
|
|
|
|
|
/** Used to insert BibTeX's information
|
|
*/
|
|
class InsetBibtex: public InsetCommand {
|
|
public:
|
|
///
|
|
InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
|
|
///
|
|
InsetBibtex(string const & dbase, string const & style,
|
|
Buffer *);
|
|
///
|
|
Inset * Clone() const {
|
|
return new InsetBibtex(contents, options, 0);
|
|
}
|
|
///
|
|
Inset::Code LyxCode() const
|
|
{
|
|
return Inset::BIBTEX_CODE;
|
|
}
|
|
///
|
|
string getScreenLabel() const;
|
|
///
|
|
void Edit(BufferView *, int x, int y, unsigned int button);
|
|
///
|
|
int Latex(ostream &, signed char) const;
|
|
///
|
|
int Latex(string & file, signed char fragile) const;
|
|
///
|
|
string getKeys(char delim);
|
|
///
|
|
unsigned char Editable() const {
|
|
return 1;
|
|
}
|
|
///
|
|
bool addDatabase(string const &);
|
|
///
|
|
bool delDatabase(string const &);
|
|
///
|
|
bool display() const { return true; }
|
|
private:
|
|
///
|
|
mutable Buffer * owner;
|
|
};
|
|
|
|
#endif
|