]> 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 e3faef157923865d620dd0620d16e6699574e9f9..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
 #endif
 
 #include "insetcommand.h"
-class Dialogs;
 
-/** Used to insert citations  
+/** Used to insert citations
  */
 class InsetCitation : public InsetCommand {
 public:
        ///
-       explicit
-       InsetCitation(string const & key, string const & note = string());
-       ///
-       ~InsetCitation();
+       InsetCitation(InsetCommandParams const &, bool same_id = false);
        ///
-       Inset * Clone() const {
-               return new InsetCitation(getContents(), getOptions());
+       Inset * clone(Buffer const &, bool same_id = false) const {
+               return new InsetCitation(params(), same_id);
        }
        ///
-       string getScreenLabel() const;
+       string const getScreenLabel(Buffer const *) const;
+       ///
+       EDITABLE editable() const { return IS_EDITABLE; }
+       ///
+       Inset::Code lyxCode() const { return Inset::CITE_CODE; }
+       ///
+       void edit(BufferView *, int, int, unsigned int);
        ///
-       EDITABLE Editable() const { return IS_EDITABLE; }
-        ///
-       void Edit(BufferView *, int, int, unsigned int);
+       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;
        ///
-       //InsetCitation() : InsetCommand("cite"), dialogs_(0) {}
+       Cache::Style getStyle(Buffer const * buffer) const;
+
        ///
-       Dialogs * dialogs_;
+       mutable Cache cache;
 };
 
 #endif // INSET_CITE_H