]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Qt2BC.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / Qt2BC.h
1 // -*- C++ -*-
2 /**
3  * \file Qt2BC.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Allan Rae
8  * \author Angus Leeming
9  * \author Baruch Even
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef QT2BC_H
15 #define QT2BC_H
16
17 #include "BCView.h"
18 #include "gettext.h"
19
20 class QWidget;
21 class QPushButton;
22
23 namespace lyx {
24 namespace frontend {
25
26 /** General purpose button controller for up to four buttons.
27     Controls the activation of the OK, Apply and Cancel buttons.
28     Actually supports 4 buttons in all and it's up to the user to decide on
29     the activation policy and which buttons correspond to which output of the
30     state machine.
31 */
32 class Qt2BC : public GuiBC<QPushButton, QWidget> {
33 public:
34         ///
35         Qt2BC(ButtonController const &,
36               std::string const & = lyx::to_utf8(_("Cancel")),
37               std::string const & = lyx::to_utf8(_("Close")));
38 private:
39         /// Updates the button sensitivity (enabled/disabled)
40         void setButtonEnabled(QPushButton *, bool enabled) const;
41
42         /// Updates the widget sensitivity (enabled/disabled)
43         void setWidgetEnabled(QWidget *, bool enabled) const;
44
45         /// Set the label on the button
46         void setButtonLabel(QPushButton *, std::string const & label) const;
47 };
48
49 } // namespace frontend
50 } // namespace lyx
51
52 #endif // QT2BC_H