]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormUrl.h
Fixed compilation problems.
[lyx.git] / src / frontends / gnome / FormUrl.h
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995 Matthias Ettrich.
7  *          Copyright 1995-2000 The LyX Team.
8  *
9  * ================================================= 
10  *
11  * \author Baruch Even
12  * */
13
14 #ifndef FORMURL_H
15 #define FORMURL_H
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "ControlUrl.h"
22 #include "GnomeBase.h"
23
24 //#include <gnome--/dialog.h>
25 namespace Gnome {
26 class Dialog;
27 }
28
29 namespace Gtk {
30 class Button;
31 class CheckButton;
32 class Entry;
33 }
34
35 /**
36  * This class implements the dialog to insert/modify urls.
37  */
38 class FormUrl : public FormCB<ControlUrl> {
39 public:
40         ///
41         FormUrl(ControlUrl & c);
42         ///
43         ~FormUrl();
44
45         void apply();
46         void hide();
47         void show();
48         void update();
49         
50 private:
51         /// Build the dialog
52         void build();
53
54         /// Returns true if the dialog input is in a valid state.
55         bool validate() const;
56
57         /// Do the connection of signals
58         void connect_signals();
59         /// Disconnect the signals.
60         void disconnect_signals();
61
62         void OKClicked() { OKButton(); }
63         void CancelClicked() { CancelButton(); }
64         void ApplyClicked() { ApplyButton(); }
65         void RestoreClicked() { RestoreButton(); }
66         void InputChanged() { bc().valid(validate()); }
67         
68         /// Get the dialog
69         Gnome::Dialog * dialog();
70         /// The url entry
71         Gtk::Entry * url() const;
72         /// The name entry
73         Gtk::Entry * name() const;
74         /// The html type checkbutton
75         Gtk::CheckButton * html() const;
76         /// The ok button
77         Gtk::Button * ok_btn() const;
78         /// The cancel button
79         Gtk::Button * cancel_btn() const;
80         /// The apply button
81         Gtk::Button * apply_btn() const;
82         /// The restore button
83         Gtk::Button * restore_btn() const;
84
85         // Hold the dialog.
86         //boost::shared_ptr<Gnome::Dialog> dialog_;
87         Gnome::Dialog * dialog_;
88
89         /// Keeps the connection to the input validator.
90         SigC::Connection slot_url_;
91         SigC::Connection slot_name_;
92         SigC::Connection slot_html_;
93 };
94
95 #endif