home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / insetbib.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  3KB  |  132 lines

  1. // -*- C++ -*-
  2. /* This file is part of*
  3.  * ======================================================
  4.  *
  5.  *           LyX, The Document Processor
  6.  *      
  7.  *        Copyright (C) 1995 Matthias Ettrich
  8.  *          Copyright (C) 1995-1998 The LyX Team.
  9.  * 
  10.  *======================================================*/
  11.  
  12. #ifndef _INSET_BIB_H
  13. #define _INSET_BIB_H
  14.  
  15. #ifdef __GNUG__
  16. #pragma interface
  17. #endif
  18.  
  19. #include "insetcommand.h"
  20.  
  21. // Created by Alejandro 970222
  22.  
  23.  
  24. /** Used to insert citations  
  25.  */
  26. class InsetCitation: public InsetCommand {
  27. public:
  28.     ///
  29.     InsetCitation(): InsetCommand("cite") { }
  30.     ///
  31.     InsetCitation(LString const & key, LString const & note=LString());
  32.         ///
  33.     ~InsetCitation();
  34.         ///
  35.         Inset* Clone() { return new InsetCitation(contents, options); }
  36.         ///
  37.     LString getScreenLabel()const;
  38.         ///
  39.     void Edit(int, int);
  40.         ///
  41.     unsigned char Editable() const {
  42.         return 1;
  43.     }
  44. };
  45.  
  46.  
  47. /** Used to insert bibitem's information (key and label)
  48.   
  49.   Must be automatically inserted as the first object in a
  50.   bibliography paragraph. 
  51.   */
  52. class InsetBibKey: public InsetCommand {
  53. public:
  54.     ///
  55.     InsetBibKey(): InsetCommand("bibitem") { counter = 1; }
  56.     ///
  57.     InsetBibKey(LString const & key, LString const & label=LString());
  58.     ///
  59.     InsetBibKey(InsetBibKey const*);
  60.     ///
  61.     ~InsetBibKey();
  62.     ///
  63.         Inset* Clone() { return new InsetBibKey(this); }
  64.     /// Currently \bibitem is used as a LyX2.x command, so we need this method.
  65.         void Write(FILE *);
  66.     ///
  67.     LString getScreenLabel() const;
  68.         ///
  69.     void Edit(int, int);
  70.     ///
  71.     unsigned char Editable() const {
  72.         return 1;
  73.     }
  74.     /// A user can't neither insert nor delete this inset
  75.     bool Deletable() const {
  76.         return false;
  77.     }
  78.         ///
  79.         void setCounter(int);
  80.         ///
  81.         int  getCounter() const { return counter; }
  82.  
  83.  private:
  84.     ///
  85.         int counter;
  86. };
  87.  
  88.  
  89. /** Used to insert BibTeX's information 
  90.   */
  91. class InsetBibtex: public InsetCommand {
  92. public:
  93.     /// 
  94.     InsetBibtex(): InsetCommand("BibTeX") { owner = NULL; }
  95.     ///
  96.     InsetBibtex(LString const & dbase, LString const & style,
  97.             Buffer *);
  98.         ///
  99.         ~InsetBibtex();
  100.         ///
  101.     Inset* Clone() { return new InsetBibtex(contents, options, NULL); }
  102.     ///  
  103.     Inset::Code LyxCode() const
  104.     {
  105.         return Inset::BIBTEX_CODE;
  106.     }
  107.     ///
  108.     LString getScreenLabel() const;
  109.     ///
  110.     void Edit(int, int);
  111.     /// 
  112.     int Latex(FILE *, signed char);
  113.     ///
  114.     int Latex(LString &file, signed char fragile);
  115.     ///
  116.     unsigned char Editable() const {
  117.         return 1;
  118.     }
  119.         ///
  120.         bool addDatabase(LString const&);
  121.         ///
  122.         bool delDatabase(LString const&);
  123.     ///
  124.     bool Display() const { return true; }    
  125. private:
  126.     ///
  127.     Buffer *owner;
  128. };
  129.  
  130.  
  131. #endif
  132.