1/* completionwords.h 2 * 3 * Copyright (C) 2010, 2011 Krzesimir Nowak 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the Free 17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 */ 19 20#include <glibmm/object.h> 21#include <gtksourceviewmm/completionprovider.h> 22 23_DEFS(gtksourceviewmm,gtksourceview) 24_PINCLUDE(glibmm/private/object_p.h) 25 26namespace Gsv 27{ 28// TODO: docs needed. krnowak 29/** Words completion provider. 30 * 31 * @newin{2,10} 32 */ 33class CompletionWords 34: 35 public Glib::Object, 36 public CompletionProvider 37{ 38 _CLASS_GOBJECT(CompletionWords, GtkSourceCompletionWords, GTK_SOURCE_COMPLETION_WORDS, Glib::Object, GObject) 39 _IMPLEMENTS_INTERFACE(CompletionProvider) 40protected: 41 _WRAP_CTOR(CompletionWords(const Glib::ustring& name, const Glib::RefPtr<Gdk::Pixbuf>& icon), gtk_source_completion_words_new) 42public: 43 /** Creates words provider with given name and icon. 44 * 45 * @param name Provider's name 46 * @param icon Provider's icon 47 * 48 * @return A new CompletionWords. 49 * 50 * @newin{2,10} 51 */ 52 _WRAP_CREATE(const Glib::ustring& name, const Glib::RefPtr<Gdk::Pixbuf>& icon) 53 54// TODO: think about a good method name - register is a C/C++ keyword. krnowak 55#m4 _CONVERSION(`const Glib::RefPtr<Gtk::TextBuffer>&',`GtkTextBuffer*',`Glib::unwrap($3)') 56 /** Registers this provider in given buffer. 57 * 58 * @param buffer A buffer which will use this provider. 59 * 60 * @newin{2,10} 61 */ 62 _WRAP_METHOD(void register_provider(const Glib::RefPtr<Gtk::TextBuffer>& buffer), gtk_source_completion_words_register) 63 64 /** Unregisters this provider from given buffer. 65 * 66 * @param buffer A buffer which will not use this provider anymore. 67 * 68 * @newin{2,10} 69 */ 70 _WRAP_METHOD(void unregister_provider(const Glib::RefPtr<Gtk::TextBuffer>& buffer), gtk_source_completion_words_unregister) 71 72 _WRAP_PROPERTY("name", Glib::ustring) 73 74 _WRAP_PROPERTY("icon", Glib::RefPtr<Gdk::Pixbuf>) 75 76 _WRAP_PROPERTY("proposals-batch-size", guint) 77 78 _WRAP_PROPERTY("scan-batch-size", guint) 79 80 _WRAP_PROPERTY("minimum-word-size", guint) 81 82 _WRAP_PROPERTY("interactive-delay", int) 83 84 _WRAP_PROPERTY("priority", int) 85}; 86 87} /* namespace Gsv */ 88 89