glibmm: Gio::FilenameCompleter Class Reference

# Gio::FilenameCompleter Class Reference

Completes partial file and directory names given a partial string by looking in the file system for clues. More...

`#include <giomm/filenamecompleter.h>`

Inheritance diagram for Gio::FilenameCompleter:
[legend]

List of all members.

## Public Member Functions

virtual | ~FilenameCompleter ()
GFilenameCompleter* | gobj ()
| Provides access to the underlying C GObject.
const GFilenameCompleter* | gobj () const
| Provides access to the underlying C GObject.
GFilenameCompleter* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
std::string | get_completion_suffix (const std::string& initial_text) const
| Obtains a completion for initial_text from completer.
Glib::StringArrayHandle | get_completions (const std::string& initial_text) const
| Gets an array of completion strings for a given initial text.
void | set_dirs_only (bool dirs_only=true)
| If dirs_only is `true`, completer will only complete directory names, and not file names.
Glib::SignalProxy0< void > | signal_got_completion_data ()

## Static Public Member Functions

static Glib::RefPtr < FilenameCompleter > | create ()

## Protected Member Functions

| FilenameCompleter ()
virtual void | on_got_completion_data ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr < Gio::FilenameCompleter > | wrap (GFilenameCompleter* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Completes partial file and directory names given a partial string by looking in the file system for clues.

Can return a list of possible completion strings for widget implementation.

Since glibmm 2.16:

## Constructor & Destructor Documentation

virtual Gio::FilenameCompleter::~FilenameCompleter | ( |  | ) | `[virtual]`

Gio::FilenameCompleter::FilenameCompleter | ( |  | ) | `[protected]`

## Member Function Documentation

static Glib::RefPtr<FilenameCompleter> Gio::FilenameCompleter::create | ( |  | ) | `[static]`

std::string Gio::FilenameCompleter::get_completion_suffix | ( | const std::string & | initial_text | ) | const

Obtains a completion for initial_text from completer.

Parameters:

  | initial_text | Text to be completed.

Returns:
  A completed string, or `0` if no completion exists. This string is not owned by GIO, so remember to Glib::free() it when finished.

Glib::StringArrayHandle Gio::FilenameCompleter::get_completions | ( | const std::string & | initial_text | ) | const

Gets an array of completion strings for a given initial text.

Parameters:

  | initial_text | Text to be completed.

Returns:
  Array of strings with possible completions for initial_text. This array must be freed by Glib::strfreev() when finished.

const GFilenameCompleter* Gio::FilenameCompleter::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GFilenameCompleter* Gio::FilenameCompleter::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GFilenameCompleter* Gio::FilenameCompleter::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

virtual void Gio::FilenameCompleter::on_got_completion_data | ( |  | ) | `[protected, virtual]`

void Gio::FilenameCompleter::set_dirs_only | ( | bool | dirs_only = `true` | ) |

If dirs_only is `true`, completer will only complete directory names, and not file names.

Parameters:

  | dirs_only | A `bool`.

Glib::SignalProxy0< void > Gio::FilenameCompleter::signal_got_completion_data | ( |  | ) |

Prototype:
  `void on_my_got_completion_data()`

## Friends And Related Function Documentation

Glib::RefPtr< Gio::FilenameCompleter > wrap | ( | GFilenameCompleter * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.