]> git.lyx.org Git - lyx.git/blob - src/insets/inseturl.h
some using changes small changes in lyxfont and some other things, read the Changelog
[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 using std::ostream;
23
24 struct LaTeXFeatures;
25
26 /** The url inset  
27  */
28 class InsetUrl : public InsetCommand {
29 public:
30         ///
31         enum Url_Flags {
32                 ///
33                 URL,
34                 ///
35                 HTML_URL
36         };
37         
38         ///
39         InsetUrl() : InsetCommand("url"), fd_form_url(0) {
40                 flag = InsetUrl::URL;
41         }
42         ///
43         InsetUrl(string const &);
44         ///
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         const char * EditMessage() const {return _("Opened Url");}
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(ostream &, signed char fragile, bool free_spc) const;
76         ///
77         int Linuxdoc(ostream &) const;
78         ///
79         int DocBook(ostream &) const;
80         ///
81         static void CloseUrlCB(FL_OBJECT *, long data);
82 private:
83         ///
84         struct Holder {
85                 InsetUrl * inset;
86                 BufferView * view;
87         };
88         ///
89         Holder holder;
90         
91         ///
92         Url_Flags flag;
93         ///
94         FD_form_url * fd_form_url;
95 };
96
97 #endif