]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcite.h
Translate labels for float:algorithm, float:figure and float:table.
[lyx.git] / src / insets / insetcite.h
index fc2487c41ccea920da49703559add13f5a5204b6..43269b797b6bc422e148f28ed557a26a3b03221e 100644 (file)
@@ -1,11 +1,11 @@
 // -*- C++ -*-
 /* This file is part of*
- * ====================================================== 
+ * ======================================================
  *
  *           LyX, The Document Processor
- *      
- *           Copyright 2000 The LyX Team.
- * 
+ *
+ *           Copyright 2000-2001 The LyX Team.
+ *
  * ====================================================== */
 
 #ifndef INSET_CITE_H
 
 #include "insetcommand.h"
 
-/** Used to insert citations  
+/** Used to insert citations
  */
 class InsetCitation : public InsetCommand {
 public:
        ///
-       InsetCitation(InsetCommandParams const &);
+       InsetCitation(InsetCommandParams const &, bool same_id = false);
+       ///
+       Inset * clone(Buffer const &, bool same_id = false) const {
+               return new InsetCitation(params(), same_id);
+       }
+       ///
+       string const getScreenLabel(Buffer const *) const;
+       ///
+       EDITABLE editable() const { return IS_EDITABLE; }
+       ///
+       Inset::Code lyxCode() const { return Inset::CITE_CODE; }
        ///
-       Inset * Clone() const { return new InsetCitation(params()); }
+       void edit(BufferView *, int, int, unsigned int);
        ///
-       string getScreenLabel() const;
+       void edit(BufferView * bv, bool front = true);
+       ///
+       int ascii(Buffer const *, std::ostream &, int linelen) const;
+       ///
+       int latex(Buffer const *, std::ostream &, bool, bool) const;
+       ///
+       void validate(LaTeXFeatures &) const;
+private:
+       struct Cache {
+               ///
+               enum Style {
+                       ///
+                       BASIC,
+                       ///
+                       NATBIB_AY,
+                       ///
+                       NATBIB_NUM
+               };
+               ///
+               Cache() : style(BASIC) {}
+               ///
+               Style style;
+               ///
+               InsetCommandParams params;
+               ///
+               string generated_label;
+               ///
+               string screen_label;
+       };
+
+       /// This function does the donkey work of creating the pretty label
+       string const generateLabel(Buffer const *) const;
+       ///
+       Cache::Style getStyle(Buffer const * buffer) const;
+
        ///
-       EDITABLE Editable() const { return IS_EDITABLE; }
-        ///
-       void Edit(BufferView *, int, int, unsigned int);
+       mutable Cache cache;
 };
 
 #endif // INSET_CITE_H