]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiListings.cpp
pimpl not needed here
[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 "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
31 using std::string;
32 using std::vector;
33 using lyx::support::findToken;
34 using lyx::support::getVectorFromString;
35 using lyx::support::getStringFromVector;
36 using lyx::support::prefixIs;
37 using lyx::support::suffixIs;
38 using lyx::support::contains;
39
40
41 namespace lyx {
42 namespace frontend {
43
44
45 /////////////////////////////////////////////////////////////////////
46 //
47 // GuiListings
48 //
49 /////////////////////////////////////////////////////////////////////
50
51
52 char const * languages[] =
53 { "no language", "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic", "C",
54   "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
55   "Eiffel", "Elan", "erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
56   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
57   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
58   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
59   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
60   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
61   "VRML", "XML", "XSLT", "" };
62
63
64 char const * languages_gui[] =
65 { N_("No language"), "ABAP", "ACSL", "Ada", "ALGOL", "Assembler", "Awk", "bash", "Basic",
66   "C", "C++", "Caml", "Clean", "Cobol", "Comal 80", "command.com", "Comsol", "csh", "Delphi",
67   "Eiffel", "Elan", "Erlang", "Euphoria", "Fortran", "Gnuplot", "Haskell", "HTML", "IDL", "inform",
68   "Java", "JVMIS", "ksh", "Lingo", "Lisp", "Logo", "make", "Mathematica", "Matlab", "Mercury",
69   "MetaPost", "Miranda", "ML", "Modula-2", "MuPAD", "NASTRAN", "Oberon-2", "OCL", "Octave",
70   "Oz", "Pascal", "Perl", "PHP", "PL/I", "Plasm", "PostScript", "POV", "Prolog", "Promela",
71   "PSTricks", "Python", "R", "Reduce", "Rexx", "RSL", "Ruby", "S", "SAS", "Scilab", "sh",
72   "SHELXL", "Simula", "tcl", "SPARQL", "SQL", "tcl", "TeX", "VBScript", "Verilog", "VHDL",
73   "VRML", "XML", "XSLT", "" };
74
75
76 struct dialect_info {
77         /// the dialect
78         char const * dialect;
79         /// the associated language
80         char const * language;
81         /// representation of the dialect in the gui
82         char const * gui;
83         /// is this the default dialect?
84         bool is_default;
85 };
86
87
88 dialect_info const dialects[] = {
89         { "R/2 4.3", "ABAP", "R/2 4.3", false },
90         { "R/2 5.0", "ABAP", "R/2 5.0", false },
91         { "R/3 3.1", "ABAP", "R/3 3.1", false },
92         { "R/3 4.6C", "ABAP", "R/3 4.6C", false },
93         { "R/3 6.10", "ABAP", "R/3 6.10", true },
94         { "2005", "Ada", "2005", true },
95         { "83", "Ada", "83", false },
96         { "95", "Ada", "95", false },
97         { "60", "Algol", "60", false },
98         { "68", "Algol", "68", true },
99         { "Motorola68k", "Assembler", "Motorola 68xxx", false },
100         { "x86masm", "Assembler", "x86 (MASM)", false },
101         { "gnu", "Awk", "gnu", true },
102         { "POSIX", "Awk", "POSIX", false },
103         { "Visual", "Basic", "Visual", false },
104         { "ANSI", "C", "ANSI", true },
105         { "Handel", "C", "Handel", false },
106         { "Objective", "C", "Objective", false },
107         { "Sharp", "C", "Sharp", false },
108         { "ANSI", "C++", "ANSI", false },
109         { "GNU", "C++", "GNU", false },
110         { "ISO", "C++", "ISO", true },
111         { "Visual", "C++", "Visual", false },
112         { "light", "Caml", "light", true },
113         { "Objective", "Caml", "Objective", false },
114         { "1974", "Cobol", "1974", false },
115         { "1985", "Cobol", "1985", true },
116         { "ibm", "Cobol", "IBM", false },
117         { "WinXP", "command.com", "Windows XP", true },
118         { "77", "Fortran", "77", false },
119         { "90", "Fortran", "90", false },
120         { "95", "Fortran", "95", true },
121         { "CORBA", "IDL", "CORBA", false },
122         { "AspectJ", "Java", "Aspect J", false },
123         { "Auto", "Lisp", "Auto", false },
124         { "gnu", "make", "gnu", false },
125         { "1.0", "Mathematica", "1.0", false },
126         { "3.0", "Mathematica", "3.0", false },
127         { "5.2", "Mathematica", "5.2", true },
128         { "decorative", "OCL", "decorative", false },
129         { "OMG", "OCL", "OMG", true },
130         { "Borland6", "Pascal", "Borland 6", false },
131         { "Standard", "Pascal", "Standard", true },
132         { "XSC", "Pascal", "XSC", false },
133         { "PLUS", "S", "PLUS", false },
134         { "67", "Simula", "67", true },
135         { "CII", "Simula", "CII", false },
136         { "DEC", "Simula", "DEC", false },
137         { "IBM", "Simula", "IBM", false },
138         { "tk", "tcl", "tk", false },
139         { "AlLaTeX", "TeX", "AlLaTeX", false },
140         { "common", "TeX", "common", false },
141         { "LaTeX", "TeX", "LaTeX", false },
142         { "plain", "TeX", "plain", true },
143         { "primitive", "TeX", "primitive", false },
144         { "AMS", "VHDL", "AMS", false },
145         { "97", "VRML", "97", true }
146 };
147
148
149 size_t const nr_dialects = sizeof(dialects) / sizeof(dialect_info);
150
151
152 char const * font_sizes[] =
153 { "default", "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
154   "Large", "" };
155
156 char const * font_sizes_gui[] =
157 { N_("Default"), N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"),
158   N_("Large"), N_("Larger"), "" };
159
160 char const * font_styles[] =
161 { "default", "rmfamily", "ttfamily", "sffamily", "" };
162
163 char const * font_styles_gui[] =
164 { N_("Default"), N_("Roman"), N_("Typewriter"), N_("Sans Serif"), "" };
165
166
167
168 GuiListings::GuiListings(LyXView & lv)
169         : GuiDialog(lv, "listings")
170 {
171         setupUi(this);
172         setViewTitle(_("Program Listing Settings"));
173
174         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
175         connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
176         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
177
178         connect(languageCO, SIGNAL(currentIndexChanged(int)),
179                 this, SLOT(change_adaptor()));
180         connect(dialectCO, SIGNAL(currentIndexChanged(int)),
181                 this, SLOT(change_adaptor()));
182         connect(inlineCB, SIGNAL(clicked()),
183                 this, SLOT(change_adaptor()));
184         connect(floatCB, SIGNAL(clicked()),
185                 this, SLOT(change_adaptor()));
186         connect(placementLE, SIGNAL(textChanged(QString)),
187                 this, SLOT(change_adaptor()));
188         connect(numberSideCO, SIGNAL(currentIndexChanged(int)),
189                 this, SLOT(change_adaptor()));
190         connect(numberStepLE, SIGNAL(textChanged(QString)),
191                 this, SLOT(change_adaptor()));
192         connect(numberFontSizeCO, SIGNAL(currentIndexChanged(int)),
193                 this, SLOT(change_adaptor()));
194         connect(firstlineLE, SIGNAL(textChanged(QString)),
195                 this, SLOT(change_adaptor()));
196         connect(lastlineLE, SIGNAL(textChanged(QString)),
197                 this, SLOT(change_adaptor()));
198         connect(fontsizeCO, SIGNAL(currentIndexChanged(int)),
199                 this, SLOT(change_adaptor()));
200         connect(fontstyleCO, SIGNAL(currentIndexChanged(int)),
201                 this, SLOT(change_adaptor()));
202         connect(breaklinesCB, SIGNAL(clicked()),
203                 this, SLOT(change_adaptor()));
204         connect(spaceCB, SIGNAL(clicked()),
205                 this, SLOT(change_adaptor()));
206         connect(spaceInStringCB, SIGNAL(clicked()),
207                 this, SLOT(change_adaptor()));
208         connect(extendedcharsCB, SIGNAL(clicked()),
209                 this, SLOT(change_adaptor()));
210
211         connect(listingsED,  SIGNAL(textChanged()),
212                 this, SLOT(change_adaptor()));
213         connect(listingsED,  SIGNAL(textChanged()),
214                 this, SLOT(set_listings_msg()));
215         connect(bypassCB, SIGNAL(clicked()),
216                 this, SLOT(change_adaptor()));
217         connect(bypassCB, SIGNAL(clicked()),
218                 this, SLOT(set_listings_msg()));
219
220         for (int n = 0; languages[n][0]; ++n)
221                 languageCO->addItem(qt_(languages_gui[n]));
222
223         for (int n = 0; font_styles[n][0]; ++n)
224                 fontstyleCO->addItem(qt_(font_styles_gui[n]));
225
226         for (int n = 0; font_sizes[n][0]; ++n) {
227                 QString font = qt_(font_sizes_gui[n]);
228                 fontsizeCO->addItem(font);
229                 numberFontSizeCO->addItem(font);
230         }
231
232         // set validators
233         numberStepLE->setValidator(new QIntValidator(0, 1000000, this));
234         firstlineLE->setValidator(new QIntValidator(0, 1000000, this));
235         lastlineLE->setValidator(new QIntValidator(0, 1000000, this));
236         placementLE->setValidator(new QRegExpValidator(QRegExp("[\\*tbph]*"), this));
237
238         bc().setOK(okPB);
239         bc().setApply(applyPB);
240         bc().setCancel(closePB);
241         listingsTB->setPlainText(
242                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
243
244         updateContents();
245
246 }
247
248
249 void GuiListings::closeEvent(QCloseEvent * e)
250 {
251         slotClose();
252         e->accept();
253 }
254
255
256 void GuiListings::change_adaptor()
257 {
258         changed();
259 }
260
261
262 string GuiListings::construct_params()
263 {
264         string language = languages[languageCO->currentIndex()];
265         string dialect;
266         string const dialect_gui = fromqstr(dialectCO->currentText());
267         if (dialectCO->currentIndex() > 0) {
268                 for (size_t i = 0; i != nr_dialects; ++i) {
269                         if (dialect_gui == dialects[i].gui
270                         && dialects[i].language == language
271                         && !dialects[i].is_default) {
272                                 dialect = dialects[i].dialect;
273                                 break;
274                         }
275                 }
276         }
277
278         bool float_ = floatCB->isChecked();
279         string placement;
280         if (placementLE->isEnabled())
281                 placement = fromqstr(placementLE->text());
282
283         string numberSide;
284         switch (numberSideCO->currentIndex()) {
285         case 0:
286                 numberSide = "none";
287                 break;
288         case 1:
289                 numberSide = "left";
290                 break;
291         case 2:
292                 numberSide = "right";
293                 break;
294         default:
295                 numberSide = "none";
296                 break;
297         }
298         string stepnumber = fromqstr(numberStepLE->text());
299         string numberfontsize = font_sizes[numberFontSizeCO->currentIndex()];
300         string firstline = fromqstr(firstlineLE->text());
301         string lastline = fromqstr(lastlineLE->text());
302
303         string fontsize = font_sizes[fontsizeCO->currentIndex()];
304         string fontstyle = font_styles[fontstyleCO->currentIndex()];
305         string basicstyle;
306         if (fontsize != "default")
307                 basicstyle = "\\" + fontsize;
308         if (fontstyle != "default")
309                 basicstyle += "\\" + fontstyle;
310         bool breakline = breaklinesCB->isChecked();
311         bool space = spaceCB->isChecked();
312         bool spaceInString = spaceInStringCB->isChecked();
313         bool extendedchars = extendedcharsCB->isChecked();
314         string extra = fromqstr(listingsED->toPlainText());
315
316         // compose a string
317         InsetListingsParams par;
318         if (language != "no language" && !contains(extra, "language=")) {
319                 if (dialect.empty())
320                         par.addParam("language", language);
321                 else
322                         par.addParam("language", "{[" + dialect + "]" + language + "}");
323         }
324         // this dialog uses float=placement instead of float,floatplacement=placement
325         // because float accepts *tbph and floatplacement accepts bph.
326         // our placement textedit is actually for the float parameter
327         if (float_)
328                 par.addParam("float", placement);
329         if (numberSide != "none")
330                 par.addParam("numbers", numberSide);
331         if (numberfontsize != "default" && numberSide != "none")
332                 par.addParam("numberstyle", "\\" + numberfontsize);
333         if (!stepnumber.empty() && numberSide != "none")
334                 par.addParam("stepnumber", stepnumber);
335         if (!firstline.empty())
336                 par.addParam("firstline", firstline);
337         if (!lastline.empty())
338                 par.addParam("lastline", lastline);
339         if (!basicstyle.empty())
340                 par.addParam("basicstyle", basicstyle);
341         if (breakline)
342                 par.addParam("breaklines", "true");
343         if (space)
344                 par.addParam("showspaces", "true");
345         if (!spaceInString)
346                 par.addParam("showstringspaces", "false");
347         if (extendedchars)
348                 par.addParam("extendedchars", "true");
349         par.addParams(extra);
350         return par.params();
351 }
352
353
354 docstring GuiListings::validate_listings_params()
355 {
356         // use a cache here to avoid repeated validation
357         // of the same parameters
358         static string param_cache;
359         static docstring msg_cache;
360         
361         if (bypassCB->isChecked())
362                 return docstring();
363
364         string params = construct_params();
365         if (params != param_cache) {
366                 param_cache = params;
367                 msg_cache = InsetListingsParams(params).validate();
368         }
369         return msg_cache;
370 }
371
372
373 void GuiListings::set_listings_msg()
374 {
375         static bool isOK = true;
376         docstring msg = validate_listings_params();
377         if (msg.empty()) {
378                 if (isOK)
379                         return;
380                 isOK = true;
381                 listingsTB->setPlainText(
382                         qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
383         } else {
384                 isOK = false;
385                 listingsTB->setPlainText(toqstr(msg));
386         }
387 }
388
389
390 void GuiListings::on_floatCB_stateChanged(int state)
391 {
392         if (state == Qt::Checked) {
393                 inlineCB->setChecked(false);
394                 placementLE->setEnabled(true);
395         } else
396                 placementLE->setEnabled(false);
397 }
398
399
400 void GuiListings::on_inlineCB_stateChanged(int state)
401 {
402         if (state == Qt::Checked) {
403                 floatCB->setChecked(false);
404                 placementLE->setEnabled(false);
405         }
406 }
407
408
409 void GuiListings::on_numberSideCO_currentIndexChanged(int index)
410 {
411         numberStepLE->setEnabled(index > 0);
412         numberFontSizeCO->setEnabled(index > 0);
413 }
414
415
416 void GuiListings::on_languageCO_currentIndexChanged(int index)
417 {
418         dialectCO->clear();
419         // 0 is "no dialect"
420         int default_dialect = 0;
421         dialectCO->addItem(qt_("No dialect"));
422         string const language = languages[index];
423
424         for (size_t i = 0; i != nr_dialects; ++i) {
425                 if (language == dialects[i].language) {
426                         dialectCO->addItem(qt_(dialects[i].gui));
427                         if (dialects[i].is_default)
428                                 default_dialect =
429                                         dialectCO->findText(qt_(dialects[i].gui));
430                 }
431         }
432         dialectCO->setCurrentIndex(default_dialect);
433         dialectCO->setEnabled(dialectCO->count() > 1);
434 }
435
436
437 void GuiListings::applyView()
438 {
439         params_.setInline(inlineCB->isChecked());
440         params_.setParams(construct_params());
441 }
442
443
444 static string plainParam(std::string const & par)
445 {
446         // remove enclosing braces
447         if (prefixIs(par, "{") && suffixIs(par, "}"))
448                 return par.substr(1, par.size() - 2);
449         return par;
450 }
451
452
453 void GuiListings::updateContents()
454 {
455         // set default values
456         listingsTB->setPlainText(
457                 qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
458         languageCO->setCurrentIndex(findToken(languages, "no language"));
459         dialectCO->setCurrentIndex(0);
460         floatCB->setChecked(false);
461         placementLE->clear();
462         numberSideCO->setCurrentIndex(0);
463         numberStepLE->clear();
464         numberFontSizeCO->setCurrentIndex(findToken(font_sizes, "default"));
465         firstlineLE->clear();
466         lastlineLE->clear();
467         fontstyleCO->setCurrentIndex(findToken(font_styles, "default"));
468         fontsizeCO->setCurrentIndex(findToken(font_sizes, "default"));
469         breaklinesCB->setChecked(false);
470         spaceCB->setChecked(false);
471         spaceInStringCB->setChecked(true);
472         extendedcharsCB->setChecked(false);
473
474         // set values from param string
475         inlineCB->setChecked(params_.isInline());
476         if (params_.isInline()) {
477                 floatCB->setChecked(false);
478                 placementLE->setEnabled(false);
479         }
480         // break other parameters and set values
481         vector<string> pars = getVectorFromString(params_.separatedParams(), "\n");
482         // process each of them
483         for (vector<string>::iterator it = pars.begin();
484             it != pars.end(); ++it) {
485                 if (prefixIs(*it, "language=")) {
486                         string arg = plainParam(it->substr(9));
487                         // has dialect?
488                         string language;
489                         string dialect;
490                         bool in_gui = false;
491                         if (prefixIs(arg, "[") && contains(arg, "]")) {
492                                 string::size_type end_dialect = arg.find("]");
493                                 dialect = arg.substr(1, end_dialect - 1);
494                                 language = arg.substr(end_dialect + 1);
495                         } else
496                                 language = arg;
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(LyXView & lv) { return new GuiListings(lv); }
646
647
648 } // namespace frontend
649 } // namespace lyx
650
651
652 #include "GuiListings_moc.cpp"