1=head1 NAME
2
3UI::Dialog::Backend::KDialog - backend for the KDE dialog variant.
4
5=head1 SYNOPSIS
6
7  use UI::Dialog::Backend::KDialog;
8  my $d = new UI::Dialog::Backend::KDialog ( backtitle => 'Demo',
9                                             title => 'Default' );
10
11  $d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );
12
13=head1 ABSTRACT
14
15UI::Dialog::Backend::KDialog is the UI::Dialog backend for the KDE dialog
16variant. While this module is used through UI::Dialog or any other loader
17module only the compatible methods are ever accessible. However, when using
18this module directly in your application (as in the SYNOPSIS example) you are
19given access to all the options and features of the real kdialog(1) application.
20
21=head1 DESCRIPTION
22
23Although this dialog variant doesn't have any progress meters, it does have the
24benefits of many different file/uri/directory widgets. It's a shame that this is
25the only dialog variant for KDE.
26
27=head1 EXPORT
28
29=over 2
30
31None
32
33=back
34
35=head1 INHERITS
36
37=over 2
38
39UI::Dialog::Backend
40
41=back
42
43=head1 CONSTRUCTOR
44
45=head2 new( @options )
46
47=over 4
48
49=item EXAMPLE
50
51=over 6
52
53 my $d = new( title => 'Default Title', backtitle => 'Backtitle',
54              width => 65, height => 20, listheight => 5 );
55
56=back
57
58=item DESCRIPTION
59
60=over 6
61
62This is the Class Constructor method. It accepts a list of key => value pairs
63and uses them as the defaults when interacting with the various widgets.
64
65=back
66
67=item RETURNS
68
69=over 6
70
71A blessed object reference of the UI::Dialog::Backend::KDialog class.
72
73=back
74
75=item OPTIONS
76
77The (...)'s after each option indicate the default for the option. An * denotes
78support by all the widget methods on a per-use policy defaulting to the values
79decided during object creation.
80
81=over 6
82
83=item B<debug = 0,1,2> (0)
84
85=item B<literal = 0,1> (0)
86
87=item B<backtitle = "backtitle"> ('') *
88
89=item B<title = "title"> ('') *
90
91=item B<nocancel = 0,1> (0) *
92
93=item B<defaultno = 0,1> (0) *
94
95=item B<beepbefore = 0,1> (0) *
96
97=item B<beepafter = 0,1> (0) *
98
99=item B<extrabutton = 0,1> (0) *
100
101=item B<extralabel = "extra label"> (0) *
102
103=item B<helpbutton = 0,1> (0) *
104
105=item B<helplabel = "help label"> (0) *
106
107=item B<maxinput = \d+> (0) *
108
109=back
110
111=back
112
113=head1 WIDGET METHODS
114
115=head2 yesno( ) yesnocancel( ) warningyesno( ) warningyesnocancel( )
116
117=over 4
118
119=item EXAMPLE
120
121=over 6
122
123 # if ($d->warningyesnocancel( text => 'A question?') ) {
124 # if ($d->warningyesno( text => 'A question?') ) {
125 # if ($d->yesnocancel( text => 'A question?') ) {
126 if ($d->yesno( text => 'A binary type question?') ) {
127     # user pressed yes
128 } else {
129     # user pressed no or cancel
130 }
131
132=back
133
134=item DESCRIPTION
135
136=over 6
137
138Present the end user with a message box that has two buttons, yes and no.
139
140=back
141
142=item RETURNS
143
144=over 6
145
146TRUE (1) for a response of YES or FALSE (0) for anything else.
147
148=back
149
150=back
151
152=head2 msgbox( )
153
154=over 4
155
156=item EXAMPLE
157
158=over 6
159
160 $d->msgbox( text => 'A simple message' );
161
162=back
163
164=item DESCRIPTION
165
166=over 6
167
168Pesent the end user with a message box that has an OK button.
169
170=back
171
172=item RETURNS
173
174=over 6
175
176TRUE (1) for a response of OK or FALSE (0) for anything else.
177
178=back
179
180=back
181
182=head2 password( )
183
184=over 4
185
186=item EXAMPLE
187
188=over 6
189
190 my $string = $d->password( text => 'Enter some (hidden) text.' );
191
192=back
193
194=item DESCRIPTION
195
196=over 6
197
198Present the end user with a text input field that doesn't reveal the input
199(except to the script) and a message.
200
201=back
202
203=item RETURNS
204
205=over 6
206
207a SCALAR if the response is OK and FALSE (0) for anything else.
208
209=back
210
211=back
212
213=head2 inputbox( )
214
215=over 4
216
217=item EXAMPLE
218
219=over 6
220
221 my $string = $d->inputbox( text => 'Enter some text.',
222                            entry => 'this is the input field' );
223
224=back
225
226=item DESCRIPTION
227
228=over 6
229
230Present the end user with a text input field and a message.
231
232=back
233
234=item RETURNS
235
236=over 6
237
238a SCALAR if the response is OK and FALSE (0) for anything else.
239
240=back
241
242=back
243
244=head2 textbox( )
245
246=over 4
247
248=item EXAMPLE
249
250=over 6
251
252 $d->textbox( path => '/path/to/a/text/file' );
253
254=back
255
256=item DESCRIPTION
257
258=over 6
259
260Present the end user with a simple scrolling box containing the contents
261of the given text file.
262
263=back
264
265=item RETURNS
266
267=over 6
268
269TRUE (1) if the response is OK and FALSE (0) for anything else.
270
271=back
272
273=back
274
275=head2 menu( )
276
277=over 4
278
279=item EXAMPLE
280
281=over 6
282
283 my $selection1 = $d->menu( text => 'Select one:',
284                            list => [ 'tag1', 'item1',
285                                      'tag2', 'item2',
286                                      'tag3', 'item3' ]
287                          );
288
289=back
290
291=item DESCRIPTION
292
293=over 6
294
295Present the user with a selectable list.
296
297=back
298
299=item RETURNS
300
301=over 6
302
303a SCALAR of the chosen tag if the response is OK and FALSE (0) for
304anything else.
305
306=back
307
308=back
309
310=head2 checklist( )
311
312=over 4
313
314=item EXAMPLE
315
316=over 6
317
318 my @selection = $d->checklist( text => 'Select one:',
319                                list => [ 'tag1', [ 'item1', 0 ],
320                                          'tag2', [ 'item2', 1 ],
321                                          'tag3', [ 'item3', 1 ] ]
322                              );
323
324=back
325
326=item DESCRIPTION
327
328=over 6
329
330Present the user with a selectable checklist.
331
332=back
333
334=item RETURNS
335
336=over 6
337
338an ARRAY of the chosen tags if the response is OK and FALSE (0) for
339anything else.
340
341=back
342
343=back
344
345=head2 radiolist( )
346
347=over 4
348
349=item EXAMPLE
350
351=over 6
352
353 my $selection = $d->radiolist( text => 'Select one:',
354                                list => [ 'tag1', [ 'item1', 0 ],
355                                          'tag2', [ 'item2', 1 ],
356                                          'tag3', [ 'item3', 0 ] ]
357                              );
358
359=back
360
361=item DESCRIPTION
362
363=over 6
364
365Present the user with a selectable radiolist.
366
367=back
368
369=item RETURNS
370
371=over 6
372
373a SCALAR of the chosen tag if the response is OK and FALSE (0) for
374anything else.
375
376=back
377
378=back
379
380=head2 fselect( ) getopenfilename( ) getsavefilename( ) getopenurl( ) getsaveurl( )
381
382=over 4
383
384=item EXAMPLE
385
386=over 6
387
388 # my $text = $d->getsaveurl( path => '/path/' );
389 # my $text = $d->getopenurl( path => '/path/' );
390 # my $text = $d->getsavefilename( path => '/path/' );
391 # my $text = $d->getopenfilename( path => '/path/' );
392 my $text = $d->fselect( path => '/path/to/a/file/or/directory' );
393
394=back
395
396=item DESCRIPTION
397
398=over 6
399
400Present the user with a file selection widget preset with the given path.
401
402=back
403
404=item RETURNS
405
406=over 6
407
408a SCALAR if the response is OK and FALSE (0) for anything else.
409
410=back
411
412=back
413
414=head2 dselect( ) getexistingdirectory( )
415
416=over 4
417
418=item EXAMPLE
419
420=over 6
421
422 # my $text = $d->getexistingdirectory( path => '/path/to/a/dir' );
423 my $text = $d->dselect( path => '/path/to/a/directory' );
424
425=back
426
427=item DESCRIPTION
428
429=over 6
430
431Present the user with a file selection widget preset with the given path.
432Unlike fselect() this widget will only return a directory selection.
433
434=back
435
436=item RETURNS
437
438=over 6
439
440a SCALAR if the response is OK and FALSE (0) for anything else.
441
442=back
443
444=back
445
446=head1 SEE ALSO
447
448=over 2
449
450=item PERLDOC
451
452 UI::Dialog
453 UI::Dialog::KDE
454 UI::Dialog::Backend
455 UI::Dialog::Backend::XOSD
456
457=back
458
459=over 2
460
461=item MAN FILES
462
463None. Use `kdialog --help` from a command line.
464
465=back
466
467=head1 BUGS
468
469Please email the author with any bug reports. Include the name of the
470module in the subject line.
471
472=head1 AUTHOR
473
474Kevin C. Krinke, E<lt>kevin@krinke.caE<gt>
475
476=head1 COPYRIGHT AND LICENSE
477
478 Copyright (C) 2004-2016  Kevin C. Krinke <kevin@krinke.ca>
479
480 This library is free software; you can redistribute it and/or
481 modify it under the terms of the GNU Lesser General Public
482 License as published by the Free Software Foundation; either
483 version 2.1 of the License, or (at your option) any later version.
484
485 This library is distributed in the hope that it will be useful,
486 but WITHOUT ANY WARRANTY; without even the implied warranty of
487 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
488 Lesser General Public License for more details.
489
490 You should have received a copy of the GNU Lesser General Public
491 License along with this library; if not, write to the Free Software
492 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
493
494=cut
495