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
00276
00280 bool can_undo() const;
00281
00286
00291 bool can_redo() const;
00292
00302
00312 void undo();
00313
00318
00322 void redo();
00323
00329
00338 void begin_not_undoable_action();
00339
00344
00350 void end_not_undoable_action();
00351
00361
00362 bool backward_iter_to_source_mark(Gtk::TextIter& iter, const Glib::ustring& category);
00363
00364 bool backward_iter_to_source_mark(Gtk::TextIter& iter);
00365
00374
00375 bool forward_iter_to_source_mark(Gtk::TextIter& iter, const Glib::ustring& category);
00376
00384 bool forward_iter_to_source_mark(Gtk::TextIter& iter);
00385
00391
00404 void ensure_highlight(const Gtk::TextIter& start, const Gtk::TextIter& end);
00405
00409
00413 void set_style_scheme(const Glib::RefPtr<SourceStyleScheme>& scheme);
00414
00418
00423 Glib::RefPtr<SourceStyleScheme> get_style_scheme();
00424
00428
00433 Glib::RefPtr<const SourceStyleScheme> get_style_scheme() const;
00434
00454
00455 Glib::RefPtr<SourceMark> create_source_mark(const Glib::ustring& name, const Glib::ustring& category, const Gtk::TextIter& where);
00456
00457
00466
00467 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_line(int line, const Glib::ustring& category) const;
00468
00474 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_line(int line) const;
00475
00483
00484 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter, const Glib::ustring& category) const;
00485
00489 Glib::SListHandle<Glib::RefPtr<SourceMark> > get_source_marks_at_iter(Gtk::TextIter& iter) const;
00490
00499
00500 void remove_source_marks(const Gtk::TextIter& start, const Gtk::TextIter& end, const Glib::ustring& category);
00501
00504
00511
00517 Glib::SignalProxy2< void,Gtk::TextIter&,Gtk::TextIter& > signal_highlight_updated();
00518
00519
00525
00531 Glib::SignalProxy1< void,const Glib::RefPtr<SourceMark>& > signal_source_mark_updated();
00532
00534
00535
00536 public:
00537
00538 public:
00539
00540 #ifdef GLIBMM_VFUNCS_ENABLED
00541 #endif //GLIBMM_VFUNCS_ENABLED
00542
00543 protected:
00544
00545 #ifdef GLIBMM_VFUNCS_ENABLED
00546 #endif //GLIBMM_VFUNCS_ENABLED
00547
00548
00549 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00550 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00551
00552
00553 };
00554
00555 }
00556
00557
00558 namespace Glib
00559 {
00568 Glib::RefPtr<gtksourceview::SourceBuffer> wrap(GtkSourceBuffer* object, bool take_copy = false);
00569 }
00570
00571
00572 #endif
00573