summaryrefslogtreecommitdiff
path: root/gio/src/filenamecompleter.hg
blob: 839e380ffd6251f28eb6e3d7b6bab738d4fee489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Copyright (C) 2007 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(giommconfig.h)

//#include <giomm/file.h>
#include <glibmm/object.h>

_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
_PINCLUDE(gio/gio.h)

namespace Gio
{

class GIOMM_API File;

/** 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.
 *
 * @newin{2,16}
 */
class GIOMM_API FilenameCompleter : public Glib::Object
{
  _CLASS_GOBJECT(FilenameCompleter, GFilenameCompleter, G_FILENAME_COMPLETER, Glib::Object, GObject, , , GIOMM_API)
protected:
  _CTOR_DEFAULT
  _IGNORE(g_filename_completer_new)
public:
  _WRAP_CREATE()

  _WRAP_METHOD(std::string get_completion_suffix(const std::string& initial_text) const, g_filename_completer_get_completion_suffix)

  #m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
  _WRAP_METHOD(std::vector<Glib::ustring> get_completions(const std::string& initial_text) const, g_filename_completer_get_completions)
  _WRAP_METHOD(void set_dirs_only(bool dirs_only = true), g_filename_completer_set_dirs_only)

  _WRAP_SIGNAL(void got_completion_data(), got_completion_data)
};

} // namespace Gio