]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiDelimiter.h
merge ButtonController and its view (Qt2BC in this case)
[lyx.git] / src / frontends / qt4 / GuiDelimiter.h
1 // -*- C++ -*-
2 /**
3  * \file GuiDelimiterDialog.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUIDELIMITERDIALOG_H
13 #define GUIDELIMITERDIALOG_H
14
15 #include "GuiDialogView.h"
16 #include "ControlMath.h"
17 #include "ui_DelimiterUi.h"
18
19 class QListWidgetItem;
20
21 namespace lyx {
22 namespace frontend {
23
24 class ControlMath;
25 class GuiDelimiter;
26
27 class GuiDelimiterDialog : public QDialog, public Ui::DelimiterUi
28 {
29         Q_OBJECT
30 public:
31         GuiDelimiterDialog(GuiDelimiter * form, QWidget * parent);
32 public Q_SLOTS:
33         void on_leftLW_itemActivated(QListWidgetItem *);
34         void on_rightLW_itemActivated(QListWidgetItem *);
35         void on_leftLW_currentRowChanged(int);
36         void on_rightLW_currentRowChanged(int);
37         void on_matchCB_stateChanged(int);
38         void on_insertPB_clicked();
39         void on_sizeCO_activated(int);
40 private:
41         ///
42         char_type doMatch(char_type const symbol) const;
43         ///
44         void updateTeXCode(int size);
45         /// owning form
46         GuiDelimiter * form_;
47         /// TeX code that will be inserted.
48         QString tex_code_;
49 };
50
51
52 class GuiDelimiter : public GuiView<GuiDelimiterDialog>
53 {
54 public:
55         friend class GuiDelimiterDialog;
56         ///
57         GuiDelimiter(GuiDialog &);
58         /// parent controller
59         ControlMath & controller()
60         { return static_cast<ControlMath &>(this->getController()); }
61         /// parent controller
62         ControlMath const & controller() const
63         { return static_cast<ControlMath const &>(this->getController()); }
64 private:
65         virtual void apply() {}
66         virtual void update_contents() {}
67         /// Build the dialog.
68         virtual void build_dialog();
69 };
70
71
72 } // namespace frontend
73 } // namespace lyx
74
75 #endif // GUIDELIMITERDIALOG_H