]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiListings.cpp
8341e99419fbfa42722d8322d0d8f347631e8c63
[lyx.git] / src / frontends / qt4 / GuiListings.cpp
1 /**
2  * \file GuiListings.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Bo Peng
7  * \author Jürgen Spitzmüller
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "GuiListings.h"
15
16 #include "qt_helpers.h"
17 #include "FuncRequest.h"
18 #include "insets/InsetListings.h"
19 #include "insets/InsetListingsParams.h"
20 #include "support/debug.h"
21
22 #include "support/lstrings.h"
23
24 #include <QLineEdit>
25 #include <QCloseEvent>
26 #include <QPushButton>
27 #include <QValidator>
28 #include <QRegExpValidator>
29
30 using namespace std;
31
32 namespace lyx {
33
34 using support::findToken;
35 using support::getVectorFromString;
36 using support::getStringFromVector;
37 using support::prefixIs;
38 using support::suffixIs;
39 using support::contains;
40
41 namespace frontend {
42
43
44 /////////////////////////////////////////////////////////////////////
45 //
46 // GuiListings
47 //
48 /////////////////////////////////////////////////////////////////////
49
50
51 char const * languages[] =
52 { "no language", "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic", "C",
53   "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
54   "Eiffel", "Elan", "erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
55   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
56   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
57   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
58   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
59   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
60   "VRML", "XML", "XSLT", "" };
61
62
63 char const * languages_gui[] =
64 { N_("No language"), "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic",
65   "C", "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
66   "Eiffel", "Elan", "Erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
67   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
68   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
69   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
70   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
71   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
72   "VRML", "XML", "XSLT", "" };
73
74
75 struct dialect_info {
76         /// the dialect
77         char const * dialect;
78         /// the associated language
79         char const * language;
80         /// representation of the dialect in the gui
81         char const * gui;
82         /// is this the default dialect?
83         bool is_default;
84 };
85
86
87 dialect_info const dialects[] = {
88         { "R/2 4.3", "ABAP", "R/2 4.3", false },
89         { "R/2 5.0", "ABAP", "R/2 5.0", false },
90         { "R/3 3.1", "ABAP", "R/3 3.1", false },
91         { "R/3 4.6C", "ABAP", "R/3 4.6C", false },
92         { "R/3 6.10", "ABAP", "R/3 6.10", true },
93         { "2005", "Ada", "2005", true },
94         { "83", "Ada", "83", false },
95         { "95", "Ada", "95", false },
96         { "60", "Algol", "60", false },
97         { "68", "Algol", "68", true },
98         { "Motorola68k", "Assembler", "Motorola 68xxx", false },
99         { "x86masm", "Assembler", "x86 (MASM)", false },
100         { "gnu", "Awk", "gnu", true },
101         { "POSIX", "Awk", "POSIX", false },
102         { "Visual", "Basic", "Visual", false },
103         { "ANSI", "C", "ANSI", true },
104         { "Handel", "C", "Handel", false },
105         { "Objective", "C", "Objective", false },
106         { "Sharp", "C", "Sharp", false },
107         { "ANSI", "C++", "ANSI", false },
108         { "GNU", "C++", "GNU", false },
109         { "ISO", "C++", "ISO", true },
110         { "Visual", "C++", "Visual", false },
111         { "light", "Caml", "light", true },
112         { "Objective", "Caml", "Objective", false },
113         { "1974", "Cobol", "1974", false },
114         { "1985", "Cobol", "1985", true },
115         { "ibm", "Cobol", "IBM", false },
116         { "WinXP", "command.com", "Windows XP", true },
117         { "77", "Fortran", "77", false },
118         { "90", "Fortran", "90", false },
119         { "95", "Fortran", "95", true },
120         { "CORBA", "IDL", "CORBA", false },
121         { "AspectJ", "Java", "Aspect J", false },
122         { "Auto", "Lisp", "Auto", false },
123         { "gnu", "make", "gnu", false },
124         { "1.0", "Mathematica", "1.0", false },
125         { "3.0", "Mathematica", "3.0", false },
126         { "5.2", "Mathematica", "5.2", true },
127         { "decorative", "OCL", "decorative", false },
128         { "OMG", "OCL", "OMG", true },
129         { "Borland6", "Pascal", "Borland 6", false },
130         { "Standard", "Pascal", "Standard", true },
131         { "XSC", "Pascal", "XSC", false },
132         { "PLUS", "S", "PLUS", false },
133         { "67", "Simula", "67", true },
134         { "CII", "Simula", "CII", false },
135         { "DEC", "Simula", "DEC", false },
136         { "IBM", "Simula", "IBM", false },
137         { "tk", "tcl", "tk", false },
138         { "AlLaTeX", "TeX", "AlLaTeX", false },
139         { "common", "TeX", "common", false },
140         { "LaTeX", "TeX", "LaTeX", false },
141         { "plain", "TeX", "plain", true },
142         { "primitive", "TeX", "primitive", false },
143         { "AMS", "VHDL", "AMS", false },
144         { "97", "VRML", "97", true }
145 };
146
147
148 size_t const nr_dialects = sizeof(dialects) / sizeof(dialect_info);
149
150
151 char const * font_sizes[] =
152 { "default", "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
153   "Large", "" };
154
155 char const * font_sizes_gui[] =
156 { N_("Default"), N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"),
157   N_("Large"), N_("Larger"), "" };
158
159 char const * font_styles[] =
160 { "default", "rmfamily", "ttfamily", "sffamily", "" };
161
162 char const * font_styles_gui[] =
163 { N_("Default"), N_("Roman"), N_("Typewriter"), N_("Sans Serif"), "" };
164
165
166
167 GuiListings::GuiListings(GuiView & lv)
168         : GuiDialog(lv, "listings")
169 {
170         setupUi(this);
171         setViewTitle(_("Program Listing Settings"));
172
173         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
174         connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
175         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
176
177         connect(languageCO, SIGNAL(currentIndexChanged(int)),
178                 this, SLOT(change_adaptor()));
179         connect(dialectCO, SIGNAL(currentIndexChanged(int)),
180                 this, SLOT(change_adaptor()));
181         connect(inlineCB, SIGNAL(clicked()),
182                 this, SLOT(change_adaptor()));
183         connect(floatCB, SIGNAL(clicked()),
184                 this, SLOT(change_adaptor()));
185         connect(placementLE, SIGNAL(textChanged(QString)),
186                 this, SLOT(change_adaptor()));
187         connect(numberSideCO, SIGNAL(currentIndexChanged(int)),
188                 this, SLOT(change_adaptor()));
189         connect(numberStepLE, SIGNAL(textChanged(QString)),
190                 this, SLOT(change_adaptor()));
191         connect(numberFontSizeCO, SIGNAL(currentIndexChanged(int)),
192                 this, SLOT(change_adaptor()));
193         connect(firstlineLE, SIGNAL(textChanged(QString)),
194                 this, SLOT(change_adaptor()));
195         connect(lastlineLE, SIGNAL(textChanged(QString)),
196                 this, SLOT(change_adaptor()));
197         connect(fontsizeCO, SIGNAL(currentIndexChanged(int)),
198                 this, SLOT(change_adaptor()));
199         connect(fontstyleCO, SIGNAL(currentIndexChanged(int)),
200                 this, SLOT(change_adaptor()));
201         connect(breaklinesCB, SIGNAL(clicked()),
202                 this, SLOT(change_adaptor()));
203         connect(spaceCB, SIGNAL(clicked()),
204                 this, SLOT(change_adaptor()));
205         connect(spaceInStringCB, SIGNAL(clicked()),
206                 this, SLOT(change_adaptor()));
207         connect(extendedcharsCB, SIGNAL(clicked()),
208                 this, SLOT(change_adaptor()));
209
210         connect(listingsED,  SIGNAL(textChanged()),
211                 this, SLOT(change_adaptor()));
212         connect(listingsED,  SIGNAL(textChanged()),
213                 this, SLOT(set_listings_msg()));
214         connect(bypassCB, SIGNAL(clicked()),
215                 this, SLOT(change_adaptor()));
216         connect(bypassCB, SIGNAL(clicked()),
217                 this, SLOT(set_listings_msg()));
218
219         for (int n = 0; languages[n][0]; ++n)
220                 languageCO->addItem(qt_(languages_gui[n]));
221
222         for (int n = 0; font_styles[n][0]; ++n)
223                 fontstyleCO->addItem(qt_(font_styles_gui[n]));
224
225         for (int n = 0; font_sizes[n][0]; ++n) {
226                 QString font = qt_(font_sizes_gui[n]);
227                 fontsizeCO->addItem(font);
228                 numberFontSizeCO->addItem(font);
229         }
230
231         // set validators
232         numberStepLE->setValidator(new QIntValidator(0, 1000000, this));
233         firstlineLE->setValidator(new QIntValidator(0, 1000000, this));
234         lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
235         placementLE->setValidator(new QRegExpValidator(QRegExp("[\\*tbph]*"), this));
236
237         bc().setOK(okPB);
238         bc().setApply(applyPB);
239         bc().setCancel(closePB);
240         listingsTB->setPlainText(
241                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
242
243         updateContents();
244
245 }
246
247
248 void GuiListings::closeEvent(QCloseEvent * e)
249 {
250         slotClose();
251         e->accept();
252 }
253
254
255 void GuiListings::change_adaptor()
256 {
257         changed();
258 }
259
260
261 string GuiListings::construct_params()
262 {
263         string language = languages[languageCO->currentIndex()];
264         string dialect;
265         string const dialect_gui = fromqstr(dialectCO->currentText());
266         if (dialectCO->currentIndex() > 0) {
267                 for (size_t i = 0; i != nr_dialects; ++i) {
268                         if (dialect_gui == dialects[i].gui
269                         && dialects[i].language == language
270                         && !dialects[i].is_default) {
271                                 dialect = dialects[i].dialect;
272                                 break;
273                         }
274                 }
275         }
276
277         bool float_ = floatCB->isChecked();
278         string placement;
279         if (placementLE->isEnabled())
280                 placement = fromqstr(placementLE->text());
281
282         string numberSide;
283         switch (numberSideCO->currentIndex()) {
284         case 0:
285                 numberSide = "none";
286                 break;
287         case 1:
288                 numberSide = "left";
289                 break;
290         case 2:
291                 numberSide = "right";
292                 break;
293         default:
294                 numberSide = "none";
295                 break;
296         }
297         string stepnumber = fromqstr(numberStepLE->text());
298         string numberfontsize = font_sizes[numberFontSizeCO->currentIndex()];
299         string firstline = fromqstr(firstlineLE->text());
300         string lastline = fromqstr(lastlineLE->text());
301
302         string fontsize = font_sizes[fontsizeCO->currentIndex()];
303         string fontstyle = font_styles[fontstyleCO->currentIndex()];
304         string basicstyle;
305         if (fontsize != "default")
306                 basicstyle = "\\" + fontsize;
307         if (fontstyle != "default")
308                 basicstyle += "\\" + fontstyle;
309         bool breakline = breaklinesCB->isChecked();
310         bool space = spaceCB->isChecked();
311         bool spaceInString = spaceInStringCB->isChecked();
312         bool extendedchars = extendedcharsCB->isChecked();
313         string extra = fromqstr(listingsED->toPlainText());
314
315         // compose a string
316         InsetListingsParams par;
317         if (language != "no language" && !contains(extra, "language=")) {
318                 if (dialect.empty())
319                         par.addParam("language", language);
320                 else
321                         par.addParam("language", "{[" + dialect + "]" + language + "}");
322         }
323         // this dialog uses float=placement instead of float,floatplacement=placement
324         // because float accepts *tbph and floatplacement accepts bph.
325         // our placement textedit is actually for the float parameter
326         if (float_)
327                 par.addParam("float", placement);
328         if (numberSide != "none")
329                 par.addParam("numbers", numberSide);
330         if (numberfontsize != "default" && numberSide != "none")
331                 par.addParam("numberstyle", "\\" + numberfontsize);
332         if (!stepnumber.empty() && numberSide != "none")
333                 par.addParam("stepnumber", stepnumber);
334         if (!firstline.empty())
335                 par.addParam("firstline", firstline);
336         if (!lastline.empty())
337                 par.addParam("lastline", lastline);
338         if (!basicstyle.empty())
339                 par.addParam("basicstyle", basicstyle);
340         if (breakline)
341                 par.addParam("breaklines", "true");
342         if (space)
343                 par.addParam("showspaces", "true");
344         if (!spaceInString)
345                 par.addParam("showstringspaces", "false");
346         if (extendedchars)
347                 par.addParam("extendedchars", "true");
348         par.addParams(extra);
349         return par.params();
350 }
351
352
353 docstring GuiListings::validate_listings_params()
354 {
355         // use a cache here to avoid repeated validation
356         // of the same parameters
357         static string param_cache;
358         static docstring msg_cache;
359         
360         if (bypassCB->isChecked())
361                 return docstring();
362
363         string params = construct_params();
364         if (params != param_cache) {
365                 param_cache = params;
366                 msg_cache = InsetListingsParams(params).validate();
367         }
368         return msg_cache;
369 }
370
371
372 void GuiListings::set_listings_msg()
373 {
374         static bool isOK = true;
375         docstring msg = validate_listings_params();
376         if (msg.empty()) {
377                 if (isOK)
378                         return;
379                 isOK = true;
380                 listingsTB->setPlainText(
381                         qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
382         } else {
383                 isOK = false;
384                 listingsTB->setPlainText(toqstr(msg));
385         }
386 }
387
388
389 void GuiListings::on_floatCB_stateChanged(int state)
390 {
391         if (state == Qt::Checked) {
392                 inlineCB->setChecked(false);
393                 placementLE->setEnabled(true);
394         } else
395                 placementLE->setEnabled(false);
396 }
397
398
399 void GuiListings::on_inlineCB_stateChanged(int state)
400 {
401         if (state == Qt::Checked) {
402                 floatCB->setChecked(false);
403                 placementLE->setEnabled(false);
404         }
405 }
406
407
408 void GuiListings::on_numberSideCO_currentIndexChanged(int index)
409 {
410         numberStepLE->setEnabled(index > 0);
411         numberFontSizeCO->setEnabled(index > 0);
412 }
413
414
415 void GuiListings::on_languageCO_currentIndexChanged(int index)
416 {
417         dialectCO->clear();
418         // 0 is "no dialect"
419         int default_dialect = 0;
420         dialectCO->addItem(qt_("No dialect"));
421         string const language = languages[index];
422
423         for (size_t i = 0; i != nr_dialects; ++i) {
424                 if (language == dialects[i].language) {
425                         dialectCO->addItem(qt_(dialects[i].gui));
426                         if (dialects[i].is_default)
427                                 default_dialect =
428                                         dialectCO->findText(qt_(dialects[i].gui));
429                 }
430         }
431         dialectCO->setCurrentIndex(default_dialect);
432         dialectCO->setEnabled(dialectCO->count() > 1);
433 }
434
435
436 void GuiListings::applyView()
437 {
438         params_.setInline(inlineCB->isChecked());
439         params_.setParams(construct_params());
440 }
441
442
443 static string plainParam(std::string const & par)
444 {
445         // remove enclosing braces
446         if (prefixIs(par, "{") && suffixIs(par, "}"))
447                 return par.substr(1, par.size() - 2);
448         return par;
449 }
450
451
452 void GuiListings::updateContents()
453 {
454         // set default values
455         listingsTB->setPlainText(
456                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
457         languageCO->setCurrentIndex(findToken(languages, "no language"));
458         dialectCO->setCurrentIndex(0);
459         floatCB->setChecked(false);
460         placementLE->clear();
461         numberSideCO->setCurrentIndex(0);
462         numberStepLE->clear();
463         numberFontSizeCO->setCurrentIndex(findToken(font_sizes, "default"));
464         firstlineLE->clear();
465         lastlineLE->clear();
466         fontstyleCO->setCurrentIndex(findToken(font_styles, "default"));
467         fontsizeCO->setCurrentIndex(findToken(font_sizes, "default"));
468         breaklinesCB->setChecked(false);
469         spaceCB->setChecked(false);
470         spaceInStringCB->setChecked(true);
471         extendedcharsCB->setChecked(false);
472
473         // set values from param string
474         inlineCB->setChecked(params_.isInline());
475         if (params_.isInline()) {
476                 floatCB->setChecked(false);
477                 placementLE->setEnabled(false);
478         }
479         // break other parameters and set values
480         vector<string> pars = getVectorFromString(params_.separatedParams(), "\n");
481         // process each of them
482         for (vector<string>::iterator it = pars.begin();
483             it != pars.end(); ++it) {
484                 if (prefixIs(*it, "language=")) {
485                         string arg = plainParam(it->substr(9));
486                         // has dialect?
487                         string language;
488                         string dialect;
489                         bool in_gui = false;
490                         if (prefixIs(arg, "[") && contains(arg, "]")) {
491                                 size_t end_dialect = arg.find("]");
492                                 dialect = arg.substr(1, end_dialect - 1);
493                                 language = arg.substr(end_dialect + 1);
494                         } else {
495                                 language = arg;
496                         }
497                         int n = findToken(languages, language);
498                         if (n >= 0) {
499                                 languageCO->setCurrentIndex(n);
500                                 in_gui = true;
501                         }
502                         // on_languageCO_currentIndexChanged should have set dialects
503                         if (!dialect.empty()) {
504                                 string dialect_gui;
505                                 for (size_t i = 0; i != nr_dialects; ++i) {
506                                         if (dialect == dialects[i].dialect
507                                             && dialects[i].language == language) {
508                                                 dialect_gui = dialects[i].gui;
509                                                 break;
510                                         }
511                                 }
512                                 n = dialectCO->findText(qt_(dialect_gui));
513                                 if (n >= 0)
514                                         dialectCO->setCurrentIndex(n);
515                                 else
516                                         in_gui = false;
517                         }
518                         if (in_gui)
519                                 *it = "";
520                         languageCO->setEnabled(in_gui);
521                         dialectCO->setEnabled(
522                                 in_gui && dialectCO->count() > 1);
523                 } else if (prefixIs(*it, "float")) {
524                         floatCB->setChecked(true);
525                         inlineCB->setChecked(false);
526                         placementLE->setEnabled(true);
527                         if (prefixIs(*it, "float="))
528                                 placementLE->setText(
529                                         toqstr(plainParam(it->substr(6))));
530                         *it = "";
531                 } else if (prefixIs(*it, "numbers=")) {
532                         string s = plainParam(it->substr(8));
533                         int n = 0;
534                         if (s == "left")
535                                 n = 1;
536                         else if (s == "right")
537                                 n = 2;
538                         numberSideCO->setCurrentIndex(n);
539                         *it = "";
540                 } else if (prefixIs(*it, "stepnumber=")) {
541                         numberStepLE->setText(
542                                 toqstr(plainParam(it->substr(11))));
543                         *it = "";
544                 } else if (prefixIs(*it, "numberstyle=")) {
545                         string par = plainParam(it->substr(12));
546                         int n = findToken(font_sizes, par.substr(1));
547                         if (n >= 0)
548                                 numberFontSizeCO->setCurrentIndex(n);
549                         *it = "";
550                 } else if (prefixIs(*it, "firstline=")) {
551                         firstlineLE->setText(
552                                 toqstr(plainParam(it->substr(10))));
553                         *it = "";
554                 } else if (prefixIs(*it, "lastline=")) {
555                         lastlineLE->setText(
556                                 toqstr(plainParam(it->substr(9))));
557                         *it = "";
558                 } else if (prefixIs(*it, "basicstyle=")) {
559                         string style;
560                         string size;
561                         for (int n = 0; font_styles[n][0]; ++n) {
562                                 string const s = font_styles[n];
563                                 if (contains(*it, "\\" + s)) {
564                                         style = "\\" + s;
565                                         break;
566                                 }
567                         }
568                         for (int n = 0; font_sizes[n][0]; ++n) {
569                                 string const s = font_sizes[n];
570                                 if (contains(*it, "\\" + s)) {
571                                         size = "\\" + s;
572                                         break;
573                                 }
574                         }
575                         if (plainParam(it->substr(11)) == style + size
576                             || plainParam(it->substr(11)) == size + style) {
577                                 if (!style.empty()) {
578                                         int n = findToken(font_styles, style.substr(1));
579                                         if (n >= 0)
580                                                 fontstyleCO->setCurrentIndex(n);
581                                 }
582                                 if (!size.empty()) {
583                                         int n = findToken(font_sizes, size.substr(1));
584                                         if (n >= 0)
585                                                 fontsizeCO->setCurrentIndex(n);
586                                 }
587                                 *it = "";
588                         }
589                 } else if (prefixIs(*it, "breaklines=")) {
590                         breaklinesCB->setChecked(contains(*it, "true"));
591                         *it = "";
592                 } else if (prefixIs(*it, "showspaces=")) {
593                         spaceCB->setChecked(contains(*it, "true"));
594                         *it = "";
595                 } else if (prefixIs(*it, "showstringspaces=")) {
596                         spaceInStringCB->setChecked(contains(*it, "true"));
597                         *it = "";
598                 } else if (prefixIs(*it, "extendedchars=")) {
599                         extendedcharsCB->setChecked(contains(*it, "true"));
600                         *it = "";
601                 }
602         }
603
604         numberStepLE->setEnabled(numberSideCO->currentIndex() > 0);
605         numberFontSizeCO->setEnabled(numberSideCO->currentIndex() > 0);
606         // parameters that can be handled by widgets are cleared
607         // the rest is put to the extra edit box.
608         string extra = getStringFromVector(pars);
609         listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
610 }
611
612
613 bool GuiListings::isValid()
614 {
615         return validate_listings_params().empty();
616 }
617
618
619 bool GuiListings::initialiseParams(string const & data)
620 {
621         InsetListingsMailer::string2params(data, params_);
622         return true;
623 }
624
625
626 void GuiListings::clearParams()
627 {
628         params_.clear();
629 }
630
631
632 void GuiListings::dispatchParams()
633 {
634         string const lfun = InsetListingsMailer::params2string(params_);
635         dispatch(FuncRequest(getLfun(), lfun));
636 }
637
638
639 void GuiListings::setParams(InsetListingsParams const & params)
640 {
641         params_ = params;
642 }
643
644
645 Dialog * createGuiListings(GuiView & lv) { return new GuiListings(lv); }
646
647
648 } // namespace frontend
649 } // namespace lyx
650
651
652 #include "GuiListings_moc.cpp"