]> git.lyx.org Git - lyx.git/blob - src/insets/insetindex.h
a5a2ac906800d5d45fb3c971e2706190c222c2d2
[lyx.git] / src / insets / insetindex.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1996-2000 the LyX Team.
9  * 
10  * ====================================================== */
11
12 #ifndef INSET_INDEX_H
13 #define INSET_INDEX_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "insetcommand.h"
20
21 class Buffer;
22 struct LaTeXFeatures;
23 struct FD_index_form;
24
25 // Created by Lgb 970227
26
27
28 /** Used to insert index labels  
29   */
30 class InsetIndex: public InsetCommand {
31 public:
32         ///
33         InsetIndex() : InsetCommand("index") {}
34         ///
35         explicit
36         InsetIndex(string const & key);
37         ///
38         ~InsetIndex();
39         ///
40         Inset * Clone() const { return new InsetIndex(getContents());}
41         ///
42         void Edit(BufferView *, int, int, unsigned int);
43         ///
44         EDITABLE Editable() const
45         {
46                 return IS_EDITABLE;
47         }
48         ///
49         string getScreenLabel() const;
50         ///
51         void callback( FD_index_form *, long );
52         ///
53         struct Holder {
54                 InsetIndex * inset;
55                 BufferView * view;
56         };
57  private:
58         ///
59         Holder holder;
60 };
61
62
63 class InsetPrintIndex : public InsetCommand {
64 public:
65         ///
66         InsetPrintIndex();
67         ///
68         InsetPrintIndex(Buffer *);
69         ///
70         ~InsetPrintIndex();
71         /// Updates needed features for this inset.
72         void Validate(LaTeXFeatures & features) const;
73         ///
74         void Edit(BufferView *, int, int, unsigned int) {}
75         ///
76         EDITABLE Editable() const{
77                 return IS_EDITABLE;
78         }
79         /// WHY is clone missing? (Lgb)
80         ///
81         bool display() const { return true; }
82         ///
83         Inset::Code LyxCode() const;
84         ///
85         string getScreenLabel() const;
86 private:
87         ///
88         Buffer * owner;
89 };
90
91 // this was shifted here rather than a separate
92 // file because its little and only need by
93 // insetindex.C and lyx_gui_misc.C ARRae 981020
94 struct FD_index_form {
95         FL_FORM * index_form;
96         FL_OBJECT * key;
97 };
98
99 extern FD_index_form * index_form;
100 #endif