00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _GTKSOURCEVIEWMM_SOURCEVIEW_H 00004 #define _GTKSOURCEVIEWMM_SOURCEVIEW_H 00005 00006 00007 #include <glibmm.h> 00008 00009 /* sourceview.hg 00010 * 00011 * Copyright (C) 2004-2005 Jae Jang 00012 * Copyright (C) 2005-2006 Rob Page 00013 * Copyright (C) 2005-2006 Dodji Seketeli 00014 * 00015 * This library is free software; you can redistribute it and/or 00016 * modify it under the terms of the GNU Library General Public 00017 * License as published by the Free Software Foundation; either 00018 * version 2 of the License, or (at your option) any later version. 00019 * 00020 * This library is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 * Library General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU Library General Public 00026 * License along with this library; if not, write to the Free 00027 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00028 */ 00029 00032 00033 #include <gtkmm/textview.h> 00034 #include <gtksourceviewmm/sourcebuffer.h> 00035 00036 00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00038 typedef struct _GtkSourceView GtkSourceView; 00039 typedef struct _GtkSourceViewClass GtkSourceViewClass; 00040 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00041 00042 00043 namespace gtksourceview 00044 { class SourceView_Class; } // namespace gtksourceview 00045 namespace gtksourceview 00046 { 00047 00053 enum SourceSmartHomeEndType 00054 { 00055 SOURCE_SMART_HOME_END_DISABLED, 00056 SOURCE_SMART_HOME_END_BEFORE, 00057 SOURCE_SMART_HOME_END_AFTER, 00058 SOURCE_SMART_HOME_END_ALWAYS 00059 }; 00060 00061 } // namespace gtksourceview 00062 00063 00064 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00065 namespace Glib 00066 { 00067 00068 template <> 00069 class Value<gtksourceview::SourceSmartHomeEndType> : public Glib::Value_Enum<gtksourceview::SourceSmartHomeEndType> 00070 { 00071 public: 00072 static GType value_type() G_GNUC_CONST; 00073 }; 00074 00075 } // namespace Glib 00076 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00077 00078 00079 namespace gtksourceview 00080 { 00081 00082 00086 00087 class SourceView : public Gtk::TextView 00088 { 00089 public: 00090 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00091 typedef SourceView CppObjectType; 00092 typedef SourceView_Class CppClassType; 00093 typedef GtkSourceView BaseObjectType; 00094 typedef GtkSourceViewClass BaseClassType; 00095 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00096 00097 virtual ~SourceView(); 00098 00099 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00100 00101 private: 00102 friend class SourceView_Class; 00103 static CppClassType sourceview_class_; 00104 00105 // noncopyable 00106 SourceView(const SourceView&); 00107 SourceView& operator=(const SourceView&); 00108 00109 protected: 00110 explicit SourceView(const Glib::ConstructParams& construct_params); 00111 explicit SourceView(GtkSourceView* castitem); 00112 00113 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00114 00115 public: 00116 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00117 static GType get_type() G_GNUC_CONST; 00118 static GType get_base_type() G_GNUC_CONST; 00119 #endif 00120 00122 GtkSourceView* gobj() { return reinterpret_cast<GtkSourceView*>(gobject_); } 00123 00125 const GtkSourceView* gobj() const { return reinterpret_cast<GtkSourceView*>(gobject_); } 00126 00127 00128 public: 00129 //C++ methods used to invoke GTK+ virtual functions: 00130 #ifdef GLIBMM_VFUNCS_ENABLED 00131 #endif //GLIBMM_VFUNCS_ENABLED 00132 00133 protected: 00134 //GTK+ Virtual Functions (override these to change behaviour): 00135 #ifdef GLIBMM_VFUNCS_ENABLED 00136 #endif //GLIBMM_VFUNCS_ENABLED 00137 00138 //Default Signal Handlers:: 00139 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00140 virtual void on_redo(); 00141 virtual void on_undo(); 00142 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 00143 00144 00145 private: 00146 00147 00148 public: 00149 //_CTOR_DEFAULT(gtk_source_view_new_val) ; 00150 //_WRAP_CTOR (SourceView (const Glib::RefPtr<SourceBuffer> &buffer), gtk_source_view_new_with_buffer) 00151 00153 explicit SourceView () ; 00154 00159 explicit SourceView (const Glib::RefPtr<SourceBuffer> &buffer) ; 00160 00161 00162 static Glib::RefPtr<SourceView> create(); 00163 00164 00165 static Glib::RefPtr<SourceView> create(const Glib::RefPtr<SourceBuffer> & buffer); 00166 00167 00171 Glib::RefPtr<const SourceBuffer> get_source_buffer () const ; 00172 00176 Glib::RefPtr<SourceBuffer> get_source_buffer () ; 00177 00181 void set_source_buffer (const Glib::RefPtr<SourceBuffer> &source_buffer) ; 00182 00186 00187 void set_show_line_numbers(bool show=true); 00188 00192 00193 bool get_show_line_numbers() const; 00194 00198 00199 void set_tab_width(guint width); 00200 00204 00205 guint get_tab_width() const; 00206 00210 00211 void set_auto_indent(bool enable=true); 00212 00216 00217 bool get_auto_indent() const; 00218 00222 00223 void set_insert_spaces_instead_of_tabs(bool enable=true); 00224 00228 00229 bool get_insert_spaces_instead_of_tabs() const; 00230 00234 00235 void set_show_right_margin(bool show = true); 00236 00240 00241 bool get_show_right_margin() const; 00242 00246 00247 void set_highlight_current_line(bool highlight=true); 00248 00252 00253 bool get_highlight_current_line() const; 00254 00258 00259 void set_right_margin_position(guint margin); 00260 00264 00265 guint get_right_margin_position() const; 00266 00270 00271 void set_smart_home_end(SourceSmartHomeEndType smart_he); 00272 00276 00277 SourceSmartHomeEndType get_smart_home_end() const; 00278 00279 00285 Glib::SignalProxy0< void > signal_redo(); 00286 00287 00293 Glib::SignalProxy0< void > signal_undo(); 00294 00295 00296 //TODO: Properties. 00297 00298 00299 }; 00300 00301 } /* namespace gtksourceview */ 00302 00303 00304 namespace Glib 00305 { 00314 gtksourceview::SourceView* wrap(GtkSourceView* object, bool take_copy = false); 00315 } //namespace Glib 00316 00317 00318 #endif /* _GTKSOURCEVIEWMM_SOURCEVIEW_H */ 00319