]> git.lyx.org Git - lyx.git/blob - src/insets/inseturl.h
bce2121fdd60c5af2db5f1e5841ebb725eb3daef
[lyx.git] / src / insets / inseturl.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1997 LyX Team (this file was created this year)
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         InsetUrl(string const &);
42         ///
43         InsetUrl(InsetCommand const &);
44         ///
45         InsetUrl(string const &, string const &, string const &);
46         ///
47         ~InsetUrl();
48         ///
49         Inset * Clone() const { return new InsetUrl(getCommand()); }
50         ///
51         Inset::Code LyxCode() const { return Inset::URL_CODE; }
52         ///
53         void Validate(LaTeXFeatures &) const;
54         ///
55         void Edit(int, int);
56         ///
57         unsigned char Editable() const {
58                 return 1;
59         }
60         ///
61         char const * EditMessage() const {return _("Opened Url");}
62         ///
63         bool display() const { return false; }
64         ///
65         string getScreenLabel() const;
66         ///
67         InsetUrl::Url_Flags getFlag() const { return flag; }
68         ///
69         void setFlag(InsetUrl::Url_Flags f) { flag = f; }
70         ///
71         void gotoLabel();
72         ///
73         int Latex(FILE * file, signed char fragile);
74         ///
75         int Latex(string & file, signed char fragile);
76         ///
77         int Linuxdoc(string & file);
78         ///
79         int DocBook(string & file);
80         ///
81         static void CloseUrlCB(FL_OBJECT *, long data);
82 private:
83         ///
84         Url_Flags flag;
85         ///
86         FD_form_url * fd_form_url;
87 };
88
89 #endif