]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/formrefdialog.h
Angus's FormInset work; Dekel's languages patch; my reworking of Angus's stuff +...
[lyx.git] / src / frontends / kde / formrefdialog.h
1 /*
2  * formrefdialog.h
3  * (C) 2000 LyX Team
4  * John Levon, moz@compsoc.man.ac.uk
5  */
6
7 /***************************************************************************
8  *                                                                         *
9  *   This program is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU General Public License as published by  *
11  *   the Free Software Foundation; either version 2 of the License, or     *
12  *   (at your option) any later version.                                   *
13  *                                                                         *
14  ***************************************************************************/
15
16 #ifndef FORMREFDIALOG_H
17 #define FORMREFDIALOG_H
18
19 #include <config.h>
20 #include <gettext.h>
21
22 #include "FormRef.h"
23
24 #include <qdialog.h>
25 #include <qlayout.h>
26 #include <qcombobox.h> 
27 #include <qcheckbox.h>
28 #include <qlistbox.h>
29 #include <qlabel.h>
30 #include <qtooltip.h>
31 #include <qlineedit.h>
32 #include <qpushbutton.h>
33
34 class FormRefDialog : public QDialog  {
35    Q_OBJECT
36 public:
37         FormRefDialog(FormRef *form, QWidget *parent=0, const char *name=0,
38                             bool modal=false, WFlags f=0);
39         ~FormRefDialog();
40
41         // widgets
42  
43         QListBox *refs;
44         QLabel *labelrefs;
45         QLineEdit *refname;
46         QLineEdit *reference;
47         QLabel *labelrefname;
48         QLabel *labelreference;
49         QCheckBox *sort;
50         QComboBox *type; 
51         QLabel *labeltype; 
52         QPushButton *buttonGoto;
53         QPushButton *buttonUpdate;
54         QPushButton *buttonOk;
55         QPushButton *buttonCancel;
56  
57 protected:
58         void closeEvent(QCloseEvent *e);
59  
60 private:
61         FormRef *form_;
62
63         // layouts
64  
65         QHBoxLayout *topLayout;
66         QVBoxLayout *layout;
67         QHBoxLayout *upperLayout;
68         QVBoxLayout *browserLayout;
69         QVBoxLayout *rightLayout;
70         QHBoxLayout *nameLayout;
71         QHBoxLayout *referenceLayout; 
72         QHBoxLayout *buttonLayout;
73
74 private slots:
75         /// adaptor to FormRef::select
76         void select_adaptor(const char *sel) {
77                 form_->select(sel);
78         }
79
80         /// adaptor to FormRef::highlight
81         void highlight_adaptor(const char *sel) {
82                 form_->highlight(sel); 
83         }
84
85         /// adaptor to FormRef::set_sort
86         void sort_adaptor(bool sort) {
87                 form_->set_sort(sort);
88         } 
89
90         /// adaptor to FormRef::gotoRef
91         void goto_adaptor(void) {
92                 form_->goto_ref();
93         }
94  
95         /// adaptor to FormRef::update
96         void update_adaptor(void) {
97                 form_->do_ref_update();
98         }
99  
100         /// adaptor to FormRef::apply
101         void apply_adaptor(void) {
102                 form_->apply();
103                 form_->close();
104                 hide();
105         }
106
107         /// adaptor to FormRef::close
108         void close_adaptor(void) {
109                 form_->close();
110                 hide();
111         }
112 };
113
114 #endif