~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to include/gtkmm-2.4/gtkmm/filechooser.h

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GTKMM_FILECHOOSER_H
 
4
#define _GTKMM_FILECHOOSER_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: filechooser.hg,v 1.23 2006/04/18 13:28:56 murrayc Exp $ */
 
10
 
 
11
/* Copyright (C) 2003 The gtkmm Development Team
 
12
 *
 
13
 * This library is free software; you can redistribute it and/or
 
14
 * modify it under the terms of the GNU Lesser General Public
 
15
 * License as published by the Free Software Foundation; either
 
16
 * version 2.1 of the License, or (at your option) any later version.
 
17
 *
 
18
 * This library is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
21
 * Lesser General Public License for more details.
 
22
 *
 
23
 * You should have received a copy of the GNU Lesser General Public
 
24
 * License along with this library; if not, write to the Free
 
25
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
26
 */
 
27
 
 
28
#include <gtkmm/widget.h>
 
29
#include <gtkmm/filefilter.h>
 
30
#include <glibmm/interface.h>
 
31
#include <giomm/file.h>
 
32
 
 
33
 
 
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
35
typedef struct _GtkFileChooser GtkFileChooser;
 
36
typedef struct _GtkFileChooserClass GtkFileChooserClass;
 
37
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
38
 
 
39
 
 
40
namespace Gtk
 
41
{ class FileChooser_Class; } // namespace Gtk
 
42
namespace Gtk
 
43
{
 
44
 
 
45
/** @addtogroup gtkmmEnums gtkmm Enums and Flags */
 
46
 
 
47
/**
 
48
 * @ingroup gtkmmEnums
 
49
 */
 
50
enum FileChooserAction
 
51
{
 
52
  FILE_CHOOSER_ACTION_OPEN,
 
53
  FILE_CHOOSER_ACTION_SAVE,
 
54
  FILE_CHOOSER_ACTION_SELECT_FOLDER,
 
55
  FILE_CHOOSER_ACTION_CREATE_FOLDER
 
56
};
 
57
 
 
58
} // namespace Gtk
 
59
 
 
60
 
 
61
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
62
namespace Glib
 
63
{
 
64
 
 
65
template <>
 
66
class Value<Gtk::FileChooserAction> : public Glib::Value_Enum<Gtk::FileChooserAction>
 
67
{
 
68
public:
 
69
  static GType value_type() G_GNUC_CONST;
 
70
};
 
71
 
 
72
} // namespace Glib
 
73
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
74
 
 
75
 
 
76
namespace Gtk
 
77
{
 
78
 
 
79
/**
 
80
 * @ingroup gtkmmEnums
 
81
 */
 
82
enum FileChooserConfirmation
 
83
{
 
84
  FILE_CHOOSER_CONFIRMATION_CONFIRM,
 
85
  FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME,
 
86
  FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
 
87
};
 
88
 
 
89
} // namespace Gtk
 
90
 
 
91
 
 
92
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
93
namespace Glib
 
94
{
 
95
 
 
96
template <>
 
97
class Value<Gtk::FileChooserConfirmation> : public Glib::Value_Enum<Gtk::FileChooserConfirmation>
 
98
{
 
99
public:
 
100
  static GType value_type() G_GNUC_CONST;
 
101
};
 
102
 
 
103
} // namespace Glib
 
104
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
105
 
 
106
 
 
107
namespace Gtk
 
108
{
 
109
 
 
110
 
 
111
//Note that GTK_FILE_SYSTEM_ERROR is not currently public GTK+ API and should
 
112
//never be instantiated by the GTK+ C API.
 
113
 
 
114
/** Exception class for Gdk::FileChooser errors.
 
115
 */
 
116
class FileChooserError : public Glib::Error
 
117
{
 
118
public:
 
119
  enum Code
 
120
  {
 
121
    NONEXISTENT,
 
122
    BAD_FILENAME,
 
123
    ALREADY_EXISTS,
 
124
    INCOMPLETE_HOSTNAME
 
125
  };
 
126
 
 
127
  FileChooserError(Code error_code, const Glib::ustring& error_message);
 
128
  explicit FileChooserError(GError* gobject);
 
129
  Code code() const;
 
130
 
 
131
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
132
private:
 
133
 
 
134
  static void throw_func(GError* gobject);
 
135
 
 
136
  friend void wrap_init(); // uses throw_func()
 
137
 
 
138
  #endif //DOXYGEN_SHOULD_SKIP_THIS
 
139
};
 
140
 
 
141
} // namespace Gtk
 
142
 
 
143
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
144
namespace Glib
 
145
{
 
146
 
 
147
template <>
 
148
class Value<Gtk::FileChooserError::Code> : public Glib::Value_Enum<Gtk::FileChooserError::Code>
 
149
{
 
150
public:
 
151
  static GType value_type() G_GNUC_CONST;
 
152
};
 
153
 
 
154
} // namespace Glib
 
155
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
156
 
 
157
 
 
158
namespace Gtk
 
159
{
 
160
 
 
161
 
 
162
/**
 
163
 * Gtk::FileChooser is an interface that can be implemented by file selection
 
164
 * widgets. In gtkmm, the main objects that implement this interface are
 
165
 * FileChooserWidget and FileChooserDialog. You do not need to write an
 
166
 * object that implements the FileChooser interface unless you are trying to
 
167
 * adapt an existing file selector to expose a standard programming interface.
 
168
 *
 
169
 * @par File Names and Encodings
 
170
 * When the user is finished selecting files in a FileChooser, your program
 
171
 * can get the selected names either as filenames or as URIs. For URIs, the
 
172
 * normal escaping rules are applied if the URI contains non-ASCII characters.
 
173
 * However, filenames are always returned in the character set specified by the
 
174
 * G_FILENAME_ENCODING environment variable. Please see the Glib documentation
 
175
 * for more details about this variable.
 
176
 *
 
177
 * @par Important
 
178
 * This means that while you can pass the result of FileChooser::get_filename()
 
179
 * to <tt>open(2)</tt> or <tt>fopen(3)</tt>, you may not be able to directly
 
180
 * set it as the text of a Gtk::Label widget unless you convert it first to
 
181
 * UTF-8, which all gtkmm widgets expect. You should use
 
182
 * Glib::filename_to_utf8() to convert filenames into strings that can be
 
183
 * passed to gtkmm widgets.
 
184
 *
 
185
 * @note
 
186
 * The gtkmm FileChooser API is broken in that methods return Glib::ustring
 
187
 * even though the returned string is not necessarily UTF-8 encoded.  Any
 
188
 * FileChooser method that takes or returns a filename (not a URI) should
 
189
 * have std::string as parameter or return type.  Fortunately this mistake
 
190
 * doesn't prevent you from handling filenames correctly in your application.
 
191
 * Just pretend that the API uses std::string and call Glib::filename_to_utf8()
 
192
 * or Glib::filename_from_utf8() as appropriate.
 
193
 *
 
194
 * See http://bugzilla.gnome.org/show_bug.cgi?id=142138 for more information.
 
195
 */
 
196
 
 
197
class FileChooser : public Glib::Interface
 
198
{
 
199
  
 
200
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
201
 
 
202
public:
 
203
  typedef FileChooser CppObjectType;
 
204
  typedef FileChooser_Class CppClassType;
 
205
  typedef GtkFileChooser BaseObjectType;
 
206
  typedef GtkFileChooserClass BaseClassType;
 
207
 
 
208
private:
 
209
  friend class FileChooser_Class;
 
210
  static CppClassType filechooser_class_;
 
211
 
 
212
  // noncopyable
 
213
  FileChooser(const FileChooser&);
 
214
  FileChooser& operator=(const FileChooser&);
 
215
 
 
216
protected:
 
217
  FileChooser(); // you must derive from this class
 
218
 
 
219
  /** Called by constructors of derived classes. Provide the result of 
 
220
   * the Class init() function to ensure that it is properly 
 
221
   * initialized.
 
222
   * 
 
223
   * @param interface_class The Class object for the derived type.
 
224
   */
 
225
  explicit FileChooser(const Glib::Interface_Class& interface_class);
 
226
 
 
227
public:
 
228
  // This is public so that C++ wrapper instances can be
 
229
  // created for C instances of unwrapped types.
 
230
  // For instance, if an unexpected C type implements the C interface. 
 
231
  explicit FileChooser(GtkFileChooser* castitem);
 
232
 
 
233
protected:
 
234
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
235
 
 
236
public:
 
237
  virtual ~FileChooser();
 
238
 
 
239
  static void add_interface(GType gtype_implementer);
 
240
 
 
241
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
242
  static GType get_type()      G_GNUC_CONST;
 
243
  static GType get_base_type() G_GNUC_CONST;
 
244
#endif
 
245
 
 
246
  ///Provides access to the underlying C GObject.
 
247
  GtkFileChooser*       gobj()       { return reinterpret_cast<GtkFileChooser*>(gobject_); }
 
248
 
 
249
  ///Provides access to the underlying C GObject.
 
250
  const GtkFileChooser* gobj() const { return reinterpret_cast<GtkFileChooser*>(gobject_); }
 
251
 
 
252
private:
 
253
 
 
254
public:
 
255
 
 
256
  
 
257
  /** Sets the type of operation that the chooser is performing; the
 
258
   * user interface is adapted to suit the selected action. For example,
 
259
   * an option to create a new folder might be shown if the action is
 
260
   * Gtk::FILE_CHOOSER_ACTION_SAVE but not if the action is
 
261
   * Gtk::FILE_CHOOSER_ACTION_OPEN.
 
262
   * 
 
263
   * @newin{2,4}
 
264
   * @param action The action that the file selector is performing.
 
265
   */
 
266
  void set_action(FileChooserAction action);
 
267
  
 
268
  /** Gets the type of operation that the file chooser is performing; see
 
269
   * set_action().
 
270
   * 
 
271
   * @newin{2,4}
 
272
   * @return The action that the file selector is performing.
 
273
   */
 
274
  FileChooserAction get_action() const;
 
275
  
 
276
  /** Sets whether only local files can be selected in the
 
277
   * file selector. If @a local_only is <tt>true</tt> (the default),
 
278
   * then the selected file are files are guaranteed to be
 
279
   * accessible through the operating systems native file
 
280
   * file system and therefore the application only
 
281
   * needs to worry about the filename functions in
 
282
   * Gtk::FileChooser, like get_filename(),
 
283
   * rather than the URI functions like
 
284
   * get_uri(),
 
285
   * 
 
286
   * @newin{2,4}
 
287
   * @param local_only <tt>true</tt> if only local files can be selected.
 
288
   */
 
289
  void set_local_only(bool local_only =  true);
 
290
  
 
291
  /** Gets whether only local files can be selected in the
 
292
   * file selector. See set_local_only()
 
293
   * 
 
294
   * @newin{2,4}
 
295
   * @return <tt>true</tt> if only local files can be selected.
 
296
   */
 
297
  bool get_local_only() const;
 
298
  
 
299
  /** Sets whether multiple files can be selected in the file selector.  This is
 
300
   * only relevant if the action is set to be Gtk::FILE_CHOOSER_ACTION_OPEN or
 
301
   * Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER.
 
302
   * 
 
303
   * @newin{2,4}
 
304
   * @param select_multiple <tt>true</tt> if multiple files can be selected.
 
305
   */
 
306
  void set_select_multiple(bool select_multiple =  true);
 
307
  
 
308
  /** Gets whether multiple files can be selected in the file
 
309
   * selector. See set_select_multiple().
 
310
   * 
 
311
   * @newin{2,4}
 
312
   * @return <tt>true</tt> if multiple files can be selected.
 
313
   */
 
314
  bool get_select_multiple() const;
 
315
 
 
316
  
 
317
  /** Sets whether hidden files and folders are displayed in the file selector.  
 
318
   * 
 
319
   * @newin{2,6}
 
320
   * @param show_hidden <tt>true</tt> if hidden files and folders should be displayed.
 
321
   */
 
322
  void set_show_hidden(bool show_hidden =  true);
 
323
  
 
324
  /** Gets whether hidden files and folders are displayed in the file selector.   
 
325
   * See set_show_hidden().
 
326
   * 
 
327
   * @newin{2,6}
 
328
   * @return <tt>true</tt> if hidden files and folders are displayed.
 
329
   */
 
330
  bool get_show_hidden() const;
 
331
 
 
332
  
 
333
  /** Sets whether a file chooser in Gtk::FILE_CHOOSER_ACTION_SAVE mode will present
 
334
   * a confirmation dialog if the user types a file name that already exists.  This
 
335
   * is <tt>false</tt> by default.
 
336
   * 
 
337
   * Regardless of this setting, the @a chooser will emit the
 
338
   * Gtk::FileChooser::confirm-overwrite signal when appropriate.
 
339
   * 
 
340
   * If all you need is the stock confirmation dialog, set this property to <tt>true</tt>.
 
341
   * You can override the way confirmation is done by actually handling the
 
342
   * Gtk::FileChooser::confirm-overwrite signal; please refer to its documentation
 
343
   * for the details.
 
344
   * 
 
345
   * @newin{2,8}
 
346
   * @param do_overwrite_confirmation Whether to confirm overwriting in save mode.
 
347
   */
 
348
  void set_do_overwrite_confirmation(bool do_overwrite_confirmation =  true);
 
349
  
 
350
  /** Queries whether a file chooser is set to confirm for overwriting when the user
 
351
   * types a file name that already exists.
 
352
   * 
 
353
   * @newin{2,8}
 
354
   * @return <tt>true</tt> if the file chooser will present a confirmation dialog;
 
355
   * <tt>false</tt> otherwise.
 
356
   */
 
357
  bool get_do_overwrite_confirmation() const;
 
358
 
 
359
  
 
360
  /** Sets whether file choser will offer to create new folders.
 
361
   * This is only relevant if the action is not set to be 
 
362
   * Gtk::FILE_CHOOSER_ACTION_OPEN.
 
363
   * 
 
364
   * @newin{2,18}
 
365
   * @param create_folders <tt>true</tt> if the New Folder button should be displayed.
 
366
   */
 
367
  void set_create_folders(bool create_folders =  true);
 
368
  
 
369
  /** Gets whether file choser will offer to create new folders.
 
370
   * See set_create_folders().
 
371
   * 
 
372
   * @newin{2,18}
 
373
   * @return <tt>true</tt> if the New Folder button should be displayed.
 
374
   */
 
375
  bool get_create_folders() const;
 
376
 
 
377
  
 
378
  /** Sets the current name in the file selector, as if entered
 
379
   * by the user. Note that the name passed in here is a UTF-8
 
380
   * string rather than a filename. This function is meant for
 
381
   * such uses as a suggested name in a "Save As..." dialog.
 
382
   * 
 
383
   * If you want to preselect a particular existing file, you should use
 
384
   * set_filename() or set_uri() instead.
 
385
   * Please see the documentation for those functions for an example of using
 
386
   * set_current_name() as well.
 
387
   * 
 
388
   * @newin{2,4}
 
389
   * @param name The filename to use, as a UTF-8 string.
 
390
   */
 
391
  void set_current_name(const Glib::ustring& name);
 
392
  
 
393
  /** Gets the filename for the currently selected file in
 
394
   * the file selector. If multiple files are selected,
 
395
   * one of the filenames will be returned at random.
 
396
   * 
 
397
   * If the file chooser is in folder mode, this function returns the selected
 
398
   * folder.
 
399
   * 
 
400
   * @newin{2,4}
 
401
   * @return The currently selected filename, or an empty string
 
402
   * if no file is selected, or the selected file can't
 
403
   * be represented with a local filename.
 
404
   */
 
405
  Glib::ustring get_filename() const;
 
406
  
 
407
  /** Sets @a filename as the current filename for the file chooser, by changing
 
408
   * to the file's parent folder and actually selecting the file in list.  If
 
409
   * the @a chooser is in Gtk::FILE_CHOOSER_ACTION_SAVE mode, the file's base name
 
410
   * will also appear in the dialog's file name entry.
 
411
   * 
 
412
   * If the file name isn't in the current folder of @a chooser, then the current
 
413
   * folder of @a chooser will be changed to the folder containing @a filename. This
 
414
   * is equivalent to a sequence of unselect_all() followed by
 
415
   * select_filename().
 
416
   * 
 
417
   * Note that the file must exist, or nothing will be done except
 
418
   * for the directory change.
 
419
   * 
 
420
   * If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
 
421
   * you should use this function if you already have a file name to which the 
 
422
   * user may save; for example, when the user opens an existing file and then 
 
423
   * does <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have 
 
424
   * a file name already — for example, if the user just created a new 
 
425
   * file and is saving it for the first time, do not call this function.  
 
426
   * Instead, use something similar to this:
 
427
   * |[
 
428
   * if (document_is_new)
 
429
   * {
 
430
   * / * the user just created a new document * /
 
431
   * gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
 
432
   * gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
433
   * }
 
434
   * else
 
435
   * {
 
436
   * / * the user edited an existing document * / 
 
437
   * gtk_file_chooser_set_filename (chooser, existing_filename);
 
438
   * }
 
439
   * ]|
 
440
   * 
 
441
   * @newin{2,4}
 
442
   * @param filename The filename to set as current.
 
443
   * @return <tt>true</tt> if both the folder could be changed and the file was
 
444
   * selected successfully, <tt>false</tt> otherwise.
 
445
   */
 
446
  bool set_filename(const Glib::ustring& filename);
 
447
  
 
448
  /** Selects a filename. If the file name isn't in the current
 
449
   * folder of @a chooser, then the current folder of @a chooser will
 
450
   * be changed to the folder containing @a filename.
 
451
   * 
 
452
   * @newin{2,4}
 
453
   * @param filename The filename to select.
 
454
   * @return <tt>true</tt> if both the folder could be changed and the file was
 
455
   * selected successfully, <tt>false</tt> otherwise.
 
456
   */
 
457
  bool select_filename(const Glib::ustring& filename);
 
458
  
 
459
  /** Unselects a currently selected filename. If the filename
 
460
   * is not in the current directory, does not exist, or
 
461
   * is otherwise not currently selected, does nothing.
 
462
   * 
 
463
   * @newin{2,4}
 
464
   * @param filename The filename to unselect.
 
465
   */
 
466
  void unselect_filename(const Glib::ustring& filename);
 
467
  
 
468
  /** Selects all the files in the current folder of a file chooser.
 
469
   * 
 
470
   * @newin{2,4}
 
471
   */
 
472
  void select_all();
 
473
  
 
474
  /** Unselects all the files in the current folder of a file chooser.
 
475
   * 
 
476
   * @newin{2,4}
 
477
   */
 
478
  void unselect_all();
 
479
  
 
480
  /** Lists all the selected files and subfolders in the current folder of
 
481
   *  @a chooser. The returned names are full absolute paths. If files in the current
 
482
   * folder cannot be represented as local filenames they will be ignored. (See
 
483
   * get_uris())
 
484
   * @return A list containing the filenames of all selected
 
485
   * files and subfolders in the current folder.
 
486
   * 
 
487
   * @newin{2,4}.
 
488
   */
 
489
  Glib::SListHandle<Glib::ustring> get_filenames() const;
 
490
  
 
491
  /** Sets the current folder for @a chooser from a local filename.
 
492
   * The user will be shown the full contents of the current folder,
 
493
   * plus user interface elements for navigating to other folders.
 
494
   * 
 
495
   * @newin{2,4}
 
496
   * @param filename The full path of the new current folder.
 
497
   * @return <tt>true</tt> if the folder could be changed successfully, <tt>false</tt>
 
498
   * otherwise.
 
499
   */
 
500
  bool set_current_folder(const Glib::ustring& filename);
 
501
  
 
502
  /** Gets the current folder of @a chooser as a local filename.
 
503
   * See set_current_folder().
 
504
   * @return The full path of the current folder, possibly empty if the current
 
505
   * path cannot be represented as a local filename.  This function may also return
 
506
   * and empty string if the file chooser was unable to load the last folder that was
 
507
   * requested from it; for example, as would be for calling
 
508
   * set_current_folder() on a nonexistent folder.
 
509
   * 
 
510
   * @newin{2,4}.
 
511
   */
 
512
  Glib::ustring get_current_folder() const;
 
513
 
 
514
 
 
515
/* URI manipulation
 
516
 */
 
517
  
 
518
  /** Gets the URI for the currently selected file in
 
519
   * the file selector. If multiple files are selected,
 
520
   * one of the filenames will be returned at random.
 
521
   * 
 
522
   * If the file chooser is in folder mode, this function returns the selected
 
523
   * folder.
 
524
   * 
 
525
   * @newin{2,4}
 
526
   * @return The currently selected URI, or an empty string
 
527
   * if no file is selected.
 
528
   */
 
529
  Glib::ustring get_uri() const;
 
530
  
 
531
  /** Sets the file referred to by @a uri as the current file for the file chooser,
 
532
   * by changing to the URI's parent folder and actually selecting the URI in the
 
533
   * list.  If the @a chooser is Gtk::FILE_CHOOSER_ACTION_SAVE mode, the URI's base
 
534
   * name will also appear in the dialog's file name entry.
 
535
   * 
 
536
   * If the URI isn't in the current folder of @a chooser, then the current folder
 
537
   * of @a chooser will be changed to the folder containing @a uri. This is equivalent
 
538
   * to a sequence of unselect_all() followed by
 
539
   * select_uri().
 
540
   * 
 
541
   * Note that the URI must exist, or nothing will be done except for the 
 
542
   * directory change.
 
543
   * If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
 
544
   * you should use this function if you already have a file name to which the 
 
545
   * user may save; for example, when the user opens an existing file and then 
 
546
   * does <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have 
 
547
   * a file name already — for example, if the user just created a new 
 
548
   * file and is saving it for the first time, do not call this function.  
 
549
   * Instead, use something similar to this:
 
550
   * |[
 
551
   * if (document_is_new)
 
552
   * {
 
553
   * / * the user just created a new document * /
 
554
   * gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
 
555
   * gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
556
   * }
 
557
   * else
 
558
   * {
 
559
   * / * the user edited an existing document * / 
 
560
   * gtk_file_chooser_set_uri (chooser, existing_uri);
 
561
   * }
 
562
   * ]|
 
563
   * 
 
564
   * @newin{2,4}
 
565
   * @param uri The URI to set as current.
 
566
   * @return <tt>true</tt> if both the folder could be changed and the URI was
 
567
   * selected successfully, <tt>false</tt> otherwise.
 
568
   */
 
569
  bool set_uri(const Glib::ustring& uri);
 
570
  
 
571
  /** Selects the file to by @a uri. If the URI doesn't refer to a
 
572
   * file in the current folder of @a chooser, then the current folder of
 
573
   *  @a chooser will be changed to the folder containing @a filename.
 
574
   * 
 
575
   * @newin{2,4}
 
576
   * @param uri The URI to select.
 
577
   * @return <tt>true</tt> if both the folder could be changed and the URI was
 
578
   * selected successfully, <tt>false</tt> otherwise.
 
579
   */
 
580
  bool select_uri(const Glib::ustring& uri);
 
581
  
 
582
  /** Unselects the file referred to by @a uri. If the file
 
583
   * is not in the current directory, does not exist, or
 
584
   * is otherwise not currently selected, does nothing.
 
585
   * 
 
586
   * @newin{2,4}
 
587
   * @param uri The URI to unselect.
 
588
   */
 
589
  void unselect_uri(const Glib::ustring& uri);
 
590
  
 
591
  /** Lists all the selected files and subfolders in the current folder of
 
592
   *  @a chooser. The returned names are full absolute URIs.
 
593
   * @return A list containing the URIs of all selected
 
594
   * files and subfolders in the current folder.
 
595
   * 
 
596
   * @newin{2,4}.
 
597
   */
 
598
  Glib::SListHandle<Glib::ustring> get_uris() const;
 
599
 
 
600
  
 
601
  /** Sets the current folder for @a chooser from an URI.
 
602
   * The user will be shown the full contents of the current folder,
 
603
   * plus user interface elements for navigating to other folders.
 
604
   * 
 
605
   * @newin{2,4}
 
606
   * @param uri The URI for the new current folder.
 
607
   * @return <tt>true</tt> if the folder could be changed successfully, <tt>false</tt>
 
608
   * otherwise.
 
609
   */
 
610
  bool set_current_folder_uri(const Glib::ustring& uri);
 
611
  
 
612
  /** Gets the current folder of @a chooser as an URI.
 
613
   * See set_current_folder_uri().
 
614
   * 
 
615
   * Note that this is the folder that the file chooser is currently displaying
 
616
   * (e.g. "file:///home/username/Documents"), which is <em>not the same</em>
 
617
   * as the currently-selected folder if the chooser is in
 
618
   * Gtk::FILE_CHOOSER_SELECT_FOLDER mode
 
619
   * (e.g. "file:///home/username/Documents/selected-folder/".  To get the
 
620
   * currently-selected folder in that mode, use get_uri() as the
 
621
   * usual way to get the selection.
 
622
   * 
 
623
   * @newin{2,4}
 
624
   * @return The URI for the current folder.
 
625
   */
 
626
  Glib::ustring get_current_folder_uri() const;
 
627
 
 
628
  
 
629
  /** Sets @a file as the current filename for the file chooser, by changing
 
630
   * to the file's parent folder and actually selecting the file in list.  If
 
631
   * the @a chooser is in Gtk::FILE_CHOOSER_ACTION_SAVE mode, the file's base name
 
632
   * will also appear in the dialog's file name entry.
 
633
   * 
 
634
   * If the file name isn't in the current folder of @a chooser, then the current
 
635
   * folder of @a chooser will be changed to the folder containing @a filename. This
 
636
   * is equivalent to a sequence of unselect_all() followed by
 
637
   * select_filename().
 
638
   * 
 
639
   * Note that the file must exist, or nothing will be done except
 
640
   * for the directory change.
 
641
   * 
 
642
   * If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
 
643
   * you should use this function if you already have a file name to which the
 
644
   * user may save; for example, when the user opens an existing file and then
 
645
   * does <guimenuitem>File/Save As...</guimenuitem> on it.  If you don't have
 
646
   * a file name already — for example, if the user just created a new
 
647
   * file and is saving it for the first time, do not call this function.
 
648
   * Instead, use something similar to this:
 
649
   * |[
 
650
   * if (document_is_new)
 
651
   * {
 
652
   * / * the user just created a new document * /
 
653
   * gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
 
654
   * gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
655
   * }
 
656
   * else
 
657
   * {
 
658
   * / * the user edited an existing document * /
 
659
   * gtk_file_chooser_set_file (chooser, existing_file);
 
660
   * }
 
661
   * ]|
 
662
   * 
 
663
   * @newin{2,14}
 
664
   * @param file The File to set as current.
 
665
   * @return <tt>true</tt> if both the folder could be changed and the file was
 
666
   * selected successfully, <tt>false</tt> otherwise.
 
667
   */
 
668
  bool set_file(const Glib::RefPtr<const Gio::File>& uri);
 
669
 
 
670
  
 
671
  /** Selects the file referred to by @a file. An internal function. See
 
672
   * _gtk_file_chooser_select_uri().
 
673
   * 
 
674
   * @newin{2,14}
 
675
   * @param file The file to select.
 
676
   * @return <tt>true</tt> if both the folder could be changed and the path was
 
677
   * selected successfully, <tt>false</tt> otherwise.
 
678
   */
 
679
  bool select_file(const Glib::RefPtr<const Gio::File>& file);
 
680
  
 
681
  /** Unselects the file referred to by @a file. If the file is not in the current
 
682
   * directory, does not exist, or is otherwise not currently selected, does nothing.
 
683
   * 
 
684
   * @newin{2,14}
 
685
   * @param file A File.
 
686
   */
 
687
  void unselect_file(const Glib::RefPtr<const Gio::File>& file);
 
688
 
 
689
 
 
690
  /** Lists all the selected files and subfolders in the current folder of @a chooser
 
691
   * as File. An internal function, see get_uris().
 
692
   * 
 
693
   * @newin{2,14}
 
694
   * @return A SList
 
695
   * containing a File for each selected file and subfolder in the
 
696
   * current folder.  Free the returned list with Glib::slist_free(), and
 
697
   * the files with Glib::object_unref().
 
698
   */
 
699
  Glib::SListHandle< Glib::RefPtr<Gio::File> > get_files();
 
700
 
 
701
  
 
702
  /** Sets the current folder for @a chooser from a File.
 
703
   * Internal function, see set_current_folder_uri().
 
704
   * 
 
705
   * @newin{2,14}
 
706
   * @param file The File for the new folder.
 
707
   * @return <tt>true</tt> if the folder could be changed successfully, <tt>false</tt>
 
708
   * otherwise.
 
709
   */
 
710
  bool set_current_folder_file(const Glib::RefPtr<const Gio::File>& file);
 
711
 
 
712
  //No refreturn is needed here, because the C function provides a reference:
 
713
  
 
714
  /** Gets the current folder of @a chooser as File.
 
715
   * See get_current_folder_uri().
 
716
   * 
 
717
   * @newin{2,14}
 
718
   * @return The File for the current folder.
 
719
   */
 
720
  Glib::RefPtr<Gio::File> get_current_folder_file();
 
721
 
 
722
  //No refreturn is needed here, because the C function provides a reference:
 
723
  
 
724
  /** Gets the File for the currently selected file in
 
725
   * the file selector. If multiple files are selected,
 
726
   * one of the files will be returned at random.
 
727
   * 
 
728
   * If the file chooser is in folder mode, this function returns the selected
 
729
   * folder.
 
730
   * 
 
731
   * @newin{2,14}
 
732
   * @return A selected File. You own the returned file;
 
733
   * use Glib::object_unref() to release it.
 
734
   */
 
735
  Glib::RefPtr<Gio::File> get_file();
 
736
  
 
737
  /** Gets the File for the currently selected file in
 
738
   * the file selector. If multiple files are selected,
 
739
   * one of the files will be returned at random.
 
740
   * 
 
741
   * If the file chooser is in folder mode, this function returns the selected
 
742
   * folder.
 
743
   * 
 
744
   * @newin{2,14}
 
745
   * @return A selected File. You own the returned file;
 
746
   * use Glib::object_unref() to release it.
 
747
   */
 
748
  Glib::RefPtr<const Gio::File> get_file() const;
 
749
 
 
750
/* Preview widget
 
751
 */
 
752
  
 
753
  /** Sets an application-supplied widget to use to display a custom preview
 
754
   * of the currently selected file. To implement a preview, after setting the
 
755
   * preview widget, you connect to the Gtk::FileChooser::update-preview
 
756
   * signal, and call get_preview_filename() or
 
757
   * get_preview_uri() on each change. If you can
 
758
   * display a preview of the new file, update your widget and
 
759
   * set the preview active using set_preview_widget_active().
 
760
   * Otherwise, set the preview inactive.
 
761
   * 
 
762
   * When there is no application-supplied preview widget, or the
 
763
   * application-supplied preview widget is not active, the file chooser
 
764
   * may display an internally generated preview of the current file or
 
765
   * it may display no preview at all.
 
766
   * 
 
767
   * @newin{2,4}
 
768
   * @param preview_widget Widget for displaying preview.
 
769
   */
 
770
  void set_preview_widget(Gtk::Widget& preview_widget);
 
771
 
 
772
  
 
773
  /** Gets the current preview widget; see
 
774
   * set_preview_widget().
 
775
   * 
 
776
   * @newin{2,4}
 
777
   * @return The current preview widget, or <tt>0</tt>.
 
778
   */
 
779
  Gtk::Widget* get_preview_widget();
 
780
  
 
781
  /** Gets the current preview widget; see
 
782
   * set_preview_widget().
 
783
   * 
 
784
   * @newin{2,4}
 
785
   * @return The current preview widget, or <tt>0</tt>.
 
786
   */
 
787
  const Gtk::Widget* get_preview_widget() const;
 
788
 
 
789
  
 
790
  /** Sets whether the preview widget set by
 
791
   * set_preview_widget() should be shown for the
 
792
   * current filename. When @a active is set to false, the file chooser
 
793
   * may display an internally generated preview of the current file
 
794
   * or it may display no preview at all. See
 
795
   * set_preview_widget() for more details.
 
796
   * 
 
797
   * @newin{2,4}
 
798
   * @param active Whether to display the user-specified preview widget.
 
799
   */
 
800
  void set_preview_widget_active(bool active =  true);
 
801
  
 
802
  /** Gets whether the preview widget set by set_preview_widget()
 
803
   * should be shown for the current filename. See
 
804
   * set_preview_widget_active().
 
805
   * 
 
806
   * @newin{2,4}
 
807
   * @return <tt>true</tt> if the preview widget is active for the current filename.
 
808
   */
 
809
  bool get_preview_widget_active() const;
 
810
 
 
811
  
 
812
  /** Sets whether the file chooser should display a stock label with the name of
 
813
   * the file that is being previewed; the default is <tt>true</tt>.  Applications that
 
814
   * want to draw the whole preview area themselves should set this to <tt>false</tt> and
 
815
   * display the name themselves in their preview widget.
 
816
   * 
 
817
   * See also: set_preview_widget()
 
818
   * 
 
819
   * @newin{2,4}
 
820
   * @param use_label Whether to display a stock label with the name of the previewed file.
 
821
   */
 
822
  void set_use_preview_label(bool use_label =  true);
 
823
  
 
824
  /** Gets whether a stock label should be drawn with the name of the previewed
 
825
   * file.  See set_use_preview_label().
 
826
   * @return <tt>true</tt> if the file chooser is set to display a label with the
 
827
   * name of the previewed file, <tt>false</tt> otherwise.
 
828
   */
 
829
  bool get_use_preview_label() const;
 
830
 
 
831
  
 
832
  /** Gets the filename that should be previewed in a custom preview
 
833
   * widget. See set_preview_widget().
 
834
   * 
 
835
   * @newin{2,4}
 
836
   * @return The filename to preview, or an empty string if no file
 
837
   * is selected, or if the selected file cannot be represented
 
838
   * as a local filename.
 
839
   */
 
840
  Glib::ustring get_preview_filename() const;
 
841
  
 
842
  /** Gets the URI that should be previewed in a custom preview
 
843
   * widget. See set_preview_widget().
 
844
   * 
 
845
   * @newin{2,4}
 
846
   * @return The URI for the file to preview, or an empty string if no file is
 
847
   * selected.
 
848
   */
 
849
  Glib::ustring get_preview_uri() const;
 
850
 
 
851
  //No refreturn is needed here, because the C function provides a reference:
 
852
  
 
853
  /** Gets the File that should be previewed in a custom preview
 
854
   * Internal function, see get_preview_uri().
 
855
   * 
 
856
   * @newin{2,14}
 
857
   * @return The File for the file to preview,
 
858
   * or <tt>0</tt> if no file is selected. Free with Glib::object_unref().
 
859
   */
 
860
  Glib::RefPtr<Gio::File> get_preview_file();
 
861
  
 
862
  /** Gets the File that should be previewed in a custom preview
 
863
   * Internal function, see get_preview_uri().
 
864
   * 
 
865
   * @newin{2,14}
 
866
   * @return The File for the file to preview,
 
867
   * or <tt>0</tt> if no file is selected. Free with Glib::object_unref().
 
868
   */
 
869
  Glib::RefPtr<const Gio::File> get_preview_file() const;
 
870
 
 
871
/* Extra widget
 
872
 */
 
873
  
 
874
  /** Sets an application-supplied widget to provide extra options to the user.
 
875
   * 
 
876
   * @newin{2,4}
 
877
   * @param extra_widget Widget for extra options.
 
878
   */
 
879
  void set_extra_widget(Gtk::Widget& extra_widget);
 
880
  
 
881
  /** Gets the current preview widget; see
 
882
   * set_extra_widget().
 
883
   * 
 
884
   * @newin{2,4}
 
885
   * @return The current extra widget, or <tt>0</tt>.
 
886
   */
 
887
  Gtk::Widget* get_extra_widget();
 
888
  
 
889
  /** Gets the current preview widget; see
 
890
   * set_extra_widget().
 
891
   * 
 
892
   * @newin{2,4}
 
893
   * @return The current extra widget, or <tt>0</tt>.
 
894
   */
 
895
  const Gtk::Widget* get_extra_widget() const;
 
896
 
 
897
/* List of user selectable filters
 
898
 */
 
899
  
 
900
  /** Adds @a filter to the list of filters that the user can select between.
 
901
   * When a filter is selected, only files that are passed by that
 
902
   * filter are displayed. 
 
903
   * 
 
904
   * Note that the @a chooser takes ownership of the filter, so you have to 
 
905
   * ref and sink it if you want to keep a reference.
 
906
   * 
 
907
   * @newin{2,4}
 
908
   * @param filter A Gtk::FileFilter.
 
909
   */
 
910
  void add_filter(const FileFilter& filter);
 
911
  
 
912
  /** Removes @a filter from the list of filters that the user can select between.
 
913
   * 
 
914
   * @newin{2,4}
 
915
   * @param filter A Gtk::FileFilter.
 
916
   */
 
917
  void remove_filter(const FileFilter& filter);
 
918
 
 
919
  
 
920
  /** Lists the current set of user-selectable filters; see
 
921
   * add_filter(), remove_filter().
 
922
   * @return A list containing the current set of
 
923
   * user selectable filters.
 
924
   * 
 
925
   * @newin{2,4}.
 
926
   */
 
927
  Glib::SListHandle< FileFilter* > list_filters();
 
928
  
 
929
  /** Lists the current set of user-selectable filters; see
 
930
   * add_filter(), remove_filter().
 
931
   * @return A list containing the current set of
 
932
   * user selectable filters.
 
933
   * 
 
934
   * @newin{2,4}.
 
935
   */
 
936
  Glib::SListHandle< const FileFilter* > list_filters() const;
 
937
 
 
938
/* Current filter
 
939
 */
 
940
  
 
941
  /** Sets the current filter; only the files that pass the
 
942
   * filter will be displayed. If the user-selectable list of filters
 
943
   * is non-empty, then the filter should be one of the filters
 
944
   * in that list. Setting the current filter when the list of
 
945
   * filters is empty is useful if you want to restrict the displayed
 
946
   * set of files without letting the user change it.
 
947
   * 
 
948
   * @newin{2,4}
 
949
   * @param filter A Gtk::FileFilter.
 
950
   */
 
951
  void set_filter(const FileFilter& filter);
 
952
  
 
953
  /** Gets the current filter; see set_filter().
 
954
   * 
 
955
   * @newin{2,4}
 
956
   * @return The current filter, or <tt>0</tt>.
 
957
   */
 
958
  FileFilter* get_filter();
 
959
  
 
960
  /** Gets the current filter; see set_filter().
 
961
   * 
 
962
   * @newin{2,4}
 
963
   * @return The current filter, or <tt>0</tt>.
 
964
   */
 
965
  const FileFilter* get_filter() const;
 
966
 
 
967
/* Per-application shortcut folders */
 
968
 
 
969
  
 
970
  /** Adds a folder to be displayed with the shortcut folders in a file chooser.
 
971
   * Note that shortcut folders do not get saved, as they are provided by the
 
972
   * application.  For example, you can use this to add a
 
973
   * "/usr/share/mydrawprogram/Clipart" folder to the volume list.
 
974
   * 
 
975
   * @newin{2,4}
 
976
   * @param folder Filename of the folder to add.
 
977
   * @return <tt>true</tt> if the folder could be added successfully, <tt>false</tt>
 
978
   * otherwise.  In the latter case, the @a error will be set as appropriate.
 
979
   */
 
980
  bool add_shortcut_folder(const Glib::ustring& folder);
 
981
  
 
982
  /** Removes a folder from a file chooser's list of shortcut folders.
 
983
   * 
 
984
   * @newin{2,4}
 
985
   * @param folder Filename of the folder to remove.
 
986
   * @return <tt>true</tt> if the operation succeeds, <tt>false</tt> otherwise.  
 
987
   * In the latter case, the @a error will be set as appropriate.
 
988
   * 
 
989
   * See also: add_shortcut_folder().
 
990
   */
 
991
  bool remove_shortcut_folder(const Glib::ustring& folder);
 
992
  
 
993
  /** Queries the list of shortcut folders in the file chooser, as set by
 
994
   * add_shortcut_folder().
 
995
   * 
 
996
   * @newin{2,4}
 
997
   * @return A list of folder filenames, if there are any shortcut
 
998
   * folders..
 
999
   */
 
1000
  Glib::SListHandle<Glib::ustring> list_shortcut_folders() const;
 
1001
 
 
1002
  
 
1003
  /** Adds a folder URI to be displayed with the shortcut folders in a file
 
1004
   * chooser.  Note that shortcut folders do not get saved, as they are provided
 
1005
   * by the application.  For example, you can use this to add a
 
1006
   * "file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
 
1007
   * 
 
1008
   * @newin{2,4}
 
1009
   * @param uri URI of the folder to add.
 
1010
   * @return <tt>true</tt> if the folder could be added successfully, <tt>false</tt>
 
1011
   * otherwise.  In the latter case, the @a error will be set as appropriate.
 
1012
   */
 
1013
  bool add_shortcut_folder_uri(const Glib::ustring& uri);
 
1014
  
 
1015
  /** Removes a folder URI from a file chooser's list of shortcut folders.
 
1016
   * 
 
1017
   * @newin{2,4}
 
1018
   * @param uri URI of the folder to remove.
 
1019
   * @return <tt>true</tt> if the operation succeeds, <tt>false</tt> otherwise.  
 
1020
   * In the latter case, the @a error will be set as appropriate.
 
1021
   * 
 
1022
   * See also: add_shortcut_folder_uri().
 
1023
   */
 
1024
  bool remove_shortcut_folder_uri(const Glib::ustring& uri);
 
1025
  
 
1026
  /** Queries the list of shortcut folders in the file chooser, as set by
 
1027
   * add_shortcut_folder_uri().
 
1028
   * @return A list of folder URIs
 
1029
   * 
 
1030
   * @newin{2,4}.
 
1031
   */
 
1032
  Glib::SListHandle<Glib::ustring> list_shortcut_folder_uris() const;
 
1033
 
 
1034
 
 
1035
  /** This signal is emitted when the current folder in a FileChooser
 
1036
   * changes.  This can happen due to the user performing some action that
 
1037
   * changes folders, such as selecting a bookmark or visiting a folder on the
 
1038
   * file list.  It can also happen as a result of calling a function to
 
1039
   * explicitly change the current folder in a file chooser.
 
1040
   *
 
1041
   * Normally you do not need to connect to this signal, unless you need to keep
 
1042
   * track of which folder a file chooser is showing.
 
1043
   *
 
1044
   * @see set_current_folder(), get_current_folder(),
 
1045
   * set_current_folder_uri(), get_current_folder_uri().
 
1046
   *
 
1047
   * @par Prototype:
 
1048
   * <tt>void on_my_%current_folder_changed()</tt>
 
1049
   */
 
1050
 
 
1051
  Glib::SignalProxy0< void > signal_current_folder_changed();
 
1052
 
 
1053
 
 
1054
  /** This signal is emitted when there is a change in the set of selected files
 
1055
   * in a #GtkFileChooser.  This can happen when the user modifies the selection
 
1056
   * with the mouse or the keyboard, or when explicitly calling functions to
 
1057
   * change the selection.
 
1058
   *
 
1059
   * Normally you do not need to connect to this signal, as it is easier to wait
 
1060
   * for the file chooser to finish running, and then to get the list of
 
1061
   * selected files using the functions mentioned below.
 
1062
   *
 
1063
   * @see select_filename(), unselect_filename(), get_filename(),
 
1064
   * get_filenames(), select_uri(),
 
1065
   * unselect_uri(), get_uri(),
 
1066
   * get_uris().
 
1067
   *
 
1068
   * @par Prototype:
 
1069
   * <tt>void on_my_%selection_changed()</tt>
 
1070
   */
 
1071
 
 
1072
  Glib::SignalProxy0< void > signal_selection_changed();
 
1073
 
 
1074
 
 
1075
  /** This signal is emitted when the preview in a file chooser should be
 
1076
   * regenerated.  For example, this can happen when the currently selected file
 
1077
   * changes.  You should use this signal if you want your file chooser to have
 
1078
   * a preview widget.
 
1079
   *
 
1080
   * Once you have installed a preview widget with
 
1081
   * set_preview_widget(), you should update it when this
 
1082
   * signal is emitted.  You can use the functions
 
1083
   * get_preview_filename() or get_preview_uri() to get the name of the file to preview.
 
1084
   * Your widget may not be able to preview all kinds of files; your signal handler
 
1085
   * must call set_preview_wiget_active() to inform the file
 
1086
   * chooser about whether the preview was generated successfully or not.
 
1087
   *
 
1088
   * @see set_preview_widget(), set_preview_widget_active(),
 
1089
   * set_use_preview_label(), get_preview_filename(), get_preview_uri().
 
1090
   *
 
1091
   * @par Prototype:
 
1092
   * <tt>void on_my_%update_preview()</tt>
 
1093
   */
 
1094
 
 
1095
  Glib::SignalProxy0< void > signal_update_preview();
 
1096
 
 
1097
 
 
1098
  /** This signal is emitted when the user "activates" a file in the file
 
1099
   * chooser.  This can happen by double-clicking on a file in the file list, or
 
1100
   * by pressing <keycap>Enter</keycap>.
 
1101
   *
 
1102
   * Normally you do not need to connect to this signal.  It is used internally
 
1103
   * by FileChooserDialog to know when to activate the default button in the
 
1104
   * dialog.
 
1105
   *
 
1106
   * @see get_filename(), get_filenames(), get_uri(), get_uris().
 
1107
   *
 
1108
   * @par Prototype:
 
1109
   * <tt>void on_my_%file_activated()</tt>
 
1110
   */
 
1111
 
 
1112
  Glib::SignalProxy0< void > signal_file_activated();
 
1113
 
 
1114
 
 
1115
  /**
 
1116
   * @par Prototype:
 
1117
   * <tt>FileChooserConfirmation on_my_%confirm_overwrite()</tt>
 
1118
   */
 
1119
 
 
1120
  Glib::SignalProxy0< FileChooserConfirmation > signal_confirm_overwrite();
 
1121
 
 
1122
 
 
1123
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1124
/** The type of operation that the file selector is performing.
 
1125
   *
 
1126
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1127
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1128
   * the value of the property changes.
 
1129
   */
 
1130
  Glib::PropertyProxy<FileChooserAction> property_action() ;
 
1131
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1132
 
 
1133
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1134
/** The type of operation that the file selector is performing.
 
1135
   *
 
1136
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1137
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1138
   * the value of the property changes.
 
1139
   */
 
1140
  Glib::PropertyProxy_ReadOnly<FileChooserAction> property_action() const;
 
1141
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1142
 
 
1143
  //TODO: _WRAP_PROPERTY("file-system-backend", FileSystem) //FileSystem is not really public API.
 
1144
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1145
/** The current filter for selecting which files are displayed.
 
1146
   *
 
1147
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1148
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1149
   * the value of the property changes.
 
1150
   */
 
1151
  Glib::PropertyProxy<FileFilter*> property_filter() ;
 
1152
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1153
 
 
1154
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1155
/** The current filter for selecting which files are displayed.
 
1156
   *
 
1157
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1158
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1159
   * the value of the property changes.
 
1160
   */
 
1161
  Glib::PropertyProxy_ReadOnly<FileFilter*> property_filter() const;
 
1162
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1163
 
 
1164
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1165
/** Whether the selected file(s) should be limited to local file: URLs.
 
1166
   *
 
1167
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1168
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1169
   * the value of the property changes.
 
1170
   */
 
1171
  Glib::PropertyProxy<bool> property_local_only() ;
 
1172
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1173
 
 
1174
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1175
/** Whether the selected file(s) should be limited to local file: URLs.
 
1176
   *
 
1177
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1178
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1179
   * the value of the property changes.
 
1180
   */
 
1181
  Glib::PropertyProxy_ReadOnly<bool> property_local_only() const;
 
1182
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1183
 
 
1184
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1185
/** Application supplied widget for custom previews.
 
1186
   *
 
1187
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1188
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1189
   * the value of the property changes.
 
1190
   */
 
1191
  Glib::PropertyProxy<Widget*> property_preview_widget() ;
 
1192
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1193
 
 
1194
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1195
/** Application supplied widget for custom previews.
 
1196
   *
 
1197
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1198
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1199
   * the value of the property changes.
 
1200
   */
 
1201
  Glib::PropertyProxy_ReadOnly<Widget*> property_preview_widget() const;
 
1202
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1203
 
 
1204
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1205
/** Whether the application supplied widget for custom previews should be shown.
 
1206
   *
 
1207
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1208
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1209
   * the value of the property changes.
 
1210
   */
 
1211
  Glib::PropertyProxy<bool> property_preview_widget_active() ;
 
1212
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1213
 
 
1214
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1215
/** Whether the application supplied widget for custom previews should be shown.
 
1216
   *
 
1217
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1218
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1219
   * the value of the property changes.
 
1220
   */
 
1221
  Glib::PropertyProxy_ReadOnly<bool> property_preview_widget_active() const;
 
1222
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1223
 
 
1224
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1225
/** Whether to display a stock label with the name of the previewed file.
 
1226
   *
 
1227
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1228
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1229
   * the value of the property changes.
 
1230
   */
 
1231
  Glib::PropertyProxy<bool> property_use_preview_label() ;
 
1232
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1233
 
 
1234
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1235
/** Whether to display a stock label with the name of the previewed file.
 
1236
   *
 
1237
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1238
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1239
   * the value of the property changes.
 
1240
   */
 
1241
  Glib::PropertyProxy_ReadOnly<bool> property_use_preview_label() const;
 
1242
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1243
 
 
1244
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1245
/** Application supplied widget for extra options.
 
1246
   *
 
1247
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1248
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1249
   * the value of the property changes.
 
1250
   */
 
1251
  Glib::PropertyProxy<Widget*> property_extra_widget() ;
 
1252
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1253
 
 
1254
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1255
/** Application supplied widget for extra options.
 
1256
   *
 
1257
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1258
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1259
   * the value of the property changes.
 
1260
   */
 
1261
  Glib::PropertyProxy_ReadOnly<Widget*> property_extra_widget() const;
 
1262
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1263
 
 
1264
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1265
/** Whether to allow multiple files to be selected.
 
1266
   *
 
1267
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1268
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1269
   * the value of the property changes.
 
1270
   */
 
1271
  Glib::PropertyProxy<bool> property_select_multiple() ;
 
1272
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1273
 
 
1274
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1275
/** Whether to allow multiple files to be selected.
 
1276
   *
 
1277
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1278
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1279
   * the value of the property changes.
 
1280
   */
 
1281
  Glib::PropertyProxy_ReadOnly<bool> property_select_multiple() const;
 
1282
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1283
 
 
1284
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1285
/** Whether the hidden files and folders should be displayed.
 
1286
   *
 
1287
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1288
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1289
   * the value of the property changes.
 
1290
   */
 
1291
  Glib::PropertyProxy<bool> property_show_hidden() ;
 
1292
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1293
 
 
1294
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1295
/** Whether the hidden files and folders should be displayed.
 
1296
   *
 
1297
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1298
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1299
   * the value of the property changes.
 
1300
   */
 
1301
  Glib::PropertyProxy_ReadOnly<bool> property_show_hidden() const;
 
1302
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1303
 
 
1304
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1305
/** Whether a file chooser in save mode will present an overwrite confirmation dialog if necessary.
 
1306
   *
 
1307
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1308
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1309
   * the value of the property changes.
 
1310
   */
 
1311
  Glib::PropertyProxy<bool> property_do_overwrite_confirmation() ;
 
1312
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1313
 
 
1314
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1315
/** Whether a file chooser in save mode will present an overwrite confirmation dialog if necessary.
 
1316
   *
 
1317
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1318
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1319
   * the value of the property changes.
 
1320
   */
 
1321
  Glib::PropertyProxy_ReadOnly<bool> property_do_overwrite_confirmation() const;
 
1322
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1323
 
 
1324
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
1325
/** Whether a file chooser not in open mode will offer the user to create new folders.
 
1326
   *
 
1327
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1328
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1329
   * the value of the property changes.
 
1330
   */
 
1331
  Glib::PropertyProxy<bool> property_create_folders() ;
 
1332
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1333
 
 
1334
#ifdef GLIBMM_PROPERTIES_ENABLED
 
1335
/** Whether a file chooser not in open mode will offer the user to create new folders.
 
1336
   *
 
1337
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
1338
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
1339
   * the value of the property changes.
 
1340
   */
 
1341
  Glib::PropertyProxy_ReadOnly<bool> property_create_folders() const;
 
1342
#endif //#GLIBMM_PROPERTIES_ENABLED
 
1343
 
 
1344
 
 
1345
public:
 
1346
 
 
1347
public:
 
1348
  //C++ methods used to invoke GTK+ virtual functions:
 
1349
 
 
1350
protected:
 
1351
  //GTK+ Virtual Functions (override these to change behaviour):
 
1352
 
 
1353
  //Default Signal Handlers::
 
1354
 
 
1355
 
 
1356
};
 
1357
 
 
1358
} // namespace Gtk
 
1359
 
 
1360
 
 
1361
namespace Glib
 
1362
{
 
1363
  /** A Glib::wrap() method for this object.
 
1364
   * 
 
1365
   * @param object The C instance.
 
1366
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
1367
   * @result A C++ instance that wraps this C instance.
 
1368
   *
 
1369
   * @relates Gtk::FileChooser
 
1370
   */
 
1371
  Glib::RefPtr<Gtk::FileChooser> wrap(GtkFileChooser* object, bool take_copy = false);
 
1372
 
 
1373
} // namespace Glib
 
1374
 
 
1375
 
 
1376
#endif /* _GTKMM_FILECHOOSER_H */
 
1377