]> git.lyx.org Git - lyx.git/blob - src/insets/inseturl.h
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / inseturl.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1997-2000 The LyX Team.
8  * 
9  * ====================================================== */
10
11 #ifndef INSET_URL_H
12 #define INSET_URL_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "insetcommand.h"
19 #include "buffer.h"
20 #include "form_url.h"
21
22 struct LaTeXFeatures;
23
24 /** The url inset  
25  */
26 class InsetUrl : public InsetCommand {
27 public:
28         ///
29         enum Url_Flags {
30                 ///
31                 URL,
32                 ///
33                 HTML_URL
34         };
35         
36         ///
37         InsetUrl() : InsetCommand("url"), fd_form_url(0) {
38                 flag = InsetUrl::URL;
39         }
40         ///
41         explicit
42         InsetUrl(string const &);
43         ///
44         explicit
45         InsetUrl(InsetCommand const &);
46         ///
47         InsetUrl(string const &, string const &, string const &);
48         ///
49         ~InsetUrl();
50         ///
51         Inset * Clone() const { return new InsetUrl(getCommand()); }
52         ///
53         Inset::Code LyxCode() const { return Inset::URL_CODE; }
54         ///
55         void Validate(LaTeXFeatures &) const;
56         ///
57         void Edit(BufferView *, int, int, unsigned int);
58         ///
59         EDITABLE Editable() const {
60                 return IS_EDITABLE;
61         }
62         ///
63         char const * EditMessage() const;
64         ///
65         bool display() const { return false; }
66         ///
67         string getScreenLabel() const;
68         ///
69         InsetUrl::Url_Flags getFlag() const { return flag; }
70         ///
71         void setFlag(InsetUrl::Url_Flags f) { flag = f; }
72         ///
73         void gotoLabel();
74         ///
75         int Latex(std::ostream &, bool fragile, bool free_spc) const;
76         ///
77         int Ascii(std::ostream &) const;
78         ///
79         int Linuxdoc(std::ostream &) const;
80         ///
81         int DocBook(std::ostream &) const;
82         ///
83         static void CloseUrlCB(FL_OBJECT *, long data);
84 private:
85         ///
86         struct Holder {
87                 InsetUrl * inset;
88                 BufferView * view;
89         };
90         ///
91         Holder holder;
92         
93         ///
94         Url_Flags flag;
95         ///
96         FD_form_url * fd_form_url;
97 };
98
99 #endif