]> 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 75db049ea2e69c7b76379ccb8d67da3f5f9b86fe..43269b797b6bc422e148f28ed557a26a3b03221e 100644 (file)
@@ -1,11 +1,11 @@
 // -*- C++ -*-
 /* This file is part of*
- * ====================================================== 
+ * ======================================================
  *
  *           LyX, The Document Processor
- *      
+ *
  *           Copyright 2000-2001 The LyX Team.
- * 
+ *
  * ====================================================== */
 
 #ifndef INSET_CITE_H
@@ -17,7 +17,7 @@
 
 #include "insetcommand.h"
 
-/** Used to insert citations  
+/** Used to insert citations
  */
 class InsetCitation : public InsetCommand {
 public:
@@ -28,7 +28,7 @@ public:
                return new InsetCitation(params(), same_id);
        }
        ///
-       string const getScreenLabel() const;
+       string const getScreenLabel(Buffer const *) const;
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
@@ -39,10 +39,40 @@ public:
        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;
+
+       ///
+       mutable Cache cache;
 };
 
 #endif // INSET_CITE_H