00001
00002
00003 #ifndef _GTKSOURCEVIEWMM_SOURCEBUFFER_H
00004 #define _GTKSOURCEVIEWMM_SOURCEBUFFER_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00033
00034 #include <gtkmm/textbuffer.h>
00035 #include <gtksourceviewmm/sourcelanguage.h>
00036 #include <gtksourceviewmm/sourcemark.h>
00037
00038
00039 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00040 typedef struct _GtkSourceBuffer GtkSourceBuffer;
00041 typedef struct _GtkSourceBufferClass GtkSourceBufferClass;
00042 #endif
00043
00044
00045 namespace gtksourceview
00046 { class SourceBuffer_Class; }
00047 namespace gtksourceview
00048 {
00049
00063
00064 class SourceBuffer : public Gtk::TextBuffer
00065 {
00066
00067 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00068
00069 public:
00070 typedef SourceBuffer CppObjectType;
00071 typedef SourceBuffer_Class CppClassType;
00072 typedef GtkSourceBuffer BaseObjectType;
00073 typedef GtkSourceBufferClass BaseClassType;
00074
00075 private: friend class SourceBuffer_Class;
00076 static CppClassType sourcebuffer_class_;
00077
00078 private:
00079
00080 SourceBuffer(const SourceBuffer&);
00081 SourceBuffer& operator=(const SourceBuffer&);
00082
00083 protected:
00084 explicit SourceBuffer(const Glib::ConstructParams& construct_params);
00085 explicit SourceBuffer(GtkSourceBuffer* castitem);
00086
00087 #endif
00088
00089 public:
00090 virtual ~SourceBuffer();
00091
00092 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00093 static GType get_type() G_GNUC_CONST;
00094 static GType get_base_type() G_GNUC_CONST;
00095 #endif
00096
00098 GtkSourceBuffer* gobj() { return reinterpret_cast<GtkSourceBuffer*>(gobject_); }
00099
00101 const GtkSourceBuffer* gobj() const { return reinterpret_cast<GtkSourceBuffer*>(gobject_); }
00102
00104 GtkSourceBuffer* gobj_copy();
00105
00106 private:
00107
00108
00109 protected:
00110 SourceBuffer();
00111
00112
00113 explicit SourceBuffer(const Glib::RefPtr<Gtk::TextTagTable>& tagtable);
00114 explicit SourceBuffer (const Glib::RefPtr<SourceLanguage> &language) ;
00115
00116 public:
00117
00122
00123 static Glib::RefPtr<SourceBuffer> create(const Glib::RefPtr<Gtk::TextTagTable>& tagtable);
00124
00125
00130
00131 static Glib::RefPtr<SourceBuffer> create(const Glib::RefPtr<SourceLanguage>& language);
00132
00133
00137
00143 bool get_highlight_matching_brackets() const;
00144
00151
00160 void set_highlight_matching_brackets(bool highlight=true);
00161
00165
00170 bool get_highlight_syntax() const;
00171
00184
00193 void set_highlight_syntax(bool highlight = true);
00194
00198
00204 int get_max_undo_levels() const;
00205
00218
00233 void set_max_undo_levels(int max_undo_levels);
00234
00238
00242 Glib::RefPtr<SourceLanguage> get_language();
00243
00247
00251 Glib::RefPtr<const SourceLanguage> get_language() const;
00252
00253
00262
00272 void set_language(const Glib::RefPtr<SourceLanguage>& language);
00273
00277
00278
00287
00288
00291
00295 bool can_undo() const;
00296
00301
00306 bool can_redo() const;
00307
00317
00327 void undo();
00328
00333
00337 void redo();
00338
00344
00353 void begin_not_undoable_action();
00354
00359
00365 void end_not_undoable_action();
00366
00367
00368 bool backward_iter_to_source_mark(Gtk::TextIter& iter, const Glib::ustring& category);
00369
00370 bool backward_iter_to_source_mark(Gtk::TextIter& iter);
00371
00372
00373 bool forward_iter_to_source_mark(Gtk::TextIter& iter, const Glib::ustring& category);
00374
00375 bool forward_iter_to_source_mark(Gtk::TextIter& iter);
00376
00377
00390 void ensure_highlight(const Gtk::TextIter& start, const Gtk::TextIter& end);
00391
00395 void set_style_scheme(const Glib::RefPtr<SourceStyleScheme>& scheme);
00396
00401 Glib::RefPtr<SourceStyleScheme> get_style_scheme();
00402
00407 Glib::RefPtr<const SourceStyleScheme> get_style_scheme() const;
00408
00409 Glib::RefPtr<SourceMark> create_source_mark(const Glib::ustring& name, const Glib::ustring& category, const Gtk::TextIter& where);
00410
00411
00412 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_line(int line, const Glib::ustring& category) const;
00413
00414
00415 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_line(int line) const;
00416
00417 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter, const Glib::ustring& category) const;
00418
00419 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter) const;
00420
00421
00422
00423
00426
00430
00431
00435
00436
00443
00449 Glib::SignalProxy2< void,Gtk::TextIter&,Gtk::TextIter& > signal_highlight_updated();
00450
00451
00457
00459
00460
00461 public:
00462
00463 public:
00464
00465 #ifdef GLIBMM_VFUNCS_ENABLED
00466 #endif //GLIBMM_VFUNCS_ENABLED
00467
00468 protected:
00469
00470 #ifdef GLIBMM_VFUNCS_ENABLED
00471 #endif //GLIBMM_VFUNCS_ENABLED
00472
00473
00474 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00475 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00476
00477
00478 };
00479
00480 }
00481
00482
00483 namespace Glib
00484 {
00493 Glib::RefPtr<gtksourceview::SourceBuffer> wrap(GtkSourceBuffer* object, bool take_copy = false);
00494 }
00495
00496
00497 #endif
00498