summaryrefslogtreecommitdiff
path: root/gio/src/filenamecompleter.hg
blob: 3910856265b64f1772508c295c4070645a9c9a34 (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
56
57
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-

/* 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

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

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

namespace Gio
{

class 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 FilenameCompleter : public Glib::Object
{
  _CLASS_GOBJECT(FilenameCompleter, GFilenameCompleter, G_FILENAME_COMPLETER, Glib::Object, GObject)
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**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
  _WRAP_METHOD(Glib::StringArrayHandle 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