]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiListings.h
Camelize another slot
[lyx.git] / src / frontends / qt4 / GuiListings.h
1 // -*- C++ -*-
2 /**
3  * \file GuiListings.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Bo Peng
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUILISTINGS_H
13 #define GUILISTINGS_H
14
15 #include "GuiDialog.h"
16 #include "ui_ListingsUi.h"
17 #include "insets/InsetListingsParams.h"
18
19 namespace lyx {
20 namespace frontend {
21
22 class GuiListings : public GuiDialog, public Ui::ListingsUi
23 {
24         Q_OBJECT
25 public:
26         GuiListings(GuiView & lv);
27         /// get values from all the widgets and form a string
28         std::string construct_params();
29         /// validate listings parameters and return an error message, if any
30         docstring validate_listings_params();
31 private Q_SLOTS:
32         void change_adaptor();
33         /// AFAIK, QValidator only works for QLineEdit so
34         /// I have to validate listingsED (QTextEdit) manually.
35         /// This function displays a hint or error message returned by
36         /// validate_listings_params
37         void setListingsMsg();
38         /// turn off inline when float is clicked
39         void on_floatCB_stateChanged(int state);
40         /// turn off float when inline is clicked
41         void on_inlineCB_stateChanged(int state);
42         /// turn off numbering options when none is selected
43         void on_numberSideCO_currentIndexChanged(int);
44         /// show dialect when language is chosen
45         void on_languageCO_currentIndexChanged(int);
46 private:
47         /// return false if validate_listings_params returns error
48         bool isValid();
49         /// Apply changes
50         void applyView();
51         /// update
52         void updateContents();
53         ///
54         bool initialiseParams(std::string const & data);
55         /// clean-up on hide.
56         void clearParams();
57         /// clean-up on hide.
58         void dispatchParams();
59         ///
60         bool isBufferDependent() const { return true; }
61         ///
62         void setParams(InsetListingsParams const &);
63
64         ///
65         InsetListingsParams params_;
66 };
67
68 } // namespace frontend
69 } // namespace lyx
70
71 #endif // GUILISTINGS_H