]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.h
d30319586a1bd6139a5b80d600904d2f3f5c9e1a
[lyx.git] / src / insets / insetindex.h
1 // -*- C++ -*-
2 /**
3  * \file insetindex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_INDEX_H
13 #define INSET_INDEX_H
14
15
16 #include "insetcommand.h"
17
18 struct LaTeXFeatures;
19
20 /** Used to insert index labels
21   */
22 class InsetIndex : public InsetCommand {
23 public:
24         ///
25         InsetIndex(InsetCommandParams const &);
26         ///
27         ~InsetIndex();
28         ///
29         virtual std::auto_ptr<InsetBase> clone() const {
30                 return std::auto_ptr<InsetBase>(new InsetIndex(params()));
31         }
32         ///
33         std::string const getScreenLabel(Buffer const &) const;
34         ///
35         EDITABLE editable() const { return IS_EDITABLE; }
36         ///
37         InsetOld::Code lyxCode() const;
38         ///
39         int docbook(Buffer const &, std::ostream &, bool mixcont) const;
40 protected:
41         ///
42         virtual
43         DispatchResult
44         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
45 };
46
47
48 class InsetPrintIndex : public InsetCommand {
49 public:
50         ///
51         InsetPrintIndex(InsetCommandParams const &);
52         ///
53         ~InsetPrintIndex();
54         ///
55         virtual std::auto_ptr<InsetBase> clone() const {
56                 return std::auto_ptr<InsetBase>(new InsetPrintIndex(params()));
57         }
58         /// Updates needed features for this inset.
59         void validate(LaTeXFeatures & features) const;
60         ///
61         EDITABLE editable() const { return NOT_EDITABLE; }
62         ///
63         InsetOld::Code lyxCode() const;
64         ///
65         bool display() const { return true; }
66         ///
67         std::string const getScreenLabel(Buffer const &) const;
68         ///
69         void metrics(MetricsInfo &, Dimension &) const;
70         ///
71         void draw(PainterInfo & pi, int x, int y) const;
72 private:
73         ///
74         mutable unsigned int center_indent_;
75 };
76
77 #endif