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/sourcemarker.h>
00037 #include <gtksourceviewmm/sourcetagstyle.h>
00038 #include <gtksourceviewmm/sourcetagtable.h>
00039
00040
00041 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00042 typedef struct _GtkSourceBuffer GtkSourceBuffer;
00043 typedef struct _GtkSourceBufferClass GtkSourceBufferClass;
00044 #endif
00045
00046
00047 namespace gtksourceview
00048 { class SourceBuffer_Class; }
00049 namespace gtksourceview
00050 {
00051
00065
00066 class SourceBuffer : public Gtk::TextBuffer
00067 {
00068
00069 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00070
00071 public:
00072 typedef SourceBuffer CppObjectType;
00073 typedef SourceBuffer_Class CppClassType;
00074 typedef GtkSourceBuffer BaseObjectType;
00075 typedef GtkSourceBufferClass BaseClassType;
00076
00077 private: friend class SourceBuffer_Class;
00078 static CppClassType sourcebuffer_class_;
00079
00080 private:
00081
00082 SourceBuffer(const SourceBuffer&);
00083 SourceBuffer& operator=(const SourceBuffer&);
00084
00085 protected:
00086 explicit SourceBuffer(const Glib::ConstructParams& construct_params);
00087 explicit SourceBuffer(GtkSourceBuffer* castitem);
00088
00089 #endif
00090
00091 public:
00092 virtual ~SourceBuffer();
00093
00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00095 static GType get_type() G_GNUC_CONST;
00096 static GType get_base_type() G_GNUC_CONST;
00097 #endif
00098
00100 GtkSourceBuffer* gobj() { return reinterpret_cast<GtkSourceBuffer*>(gobject_); }
00101
00103 const GtkSourceBuffer* gobj() const { return reinterpret_cast<GtkSourceBuffer*>(gobject_); }
00104
00106 GtkSourceBuffer* gobj_copy();
00107
00108 private:
00109
00110
00111 protected:
00112 SourceBuffer();
00113 explicit SourceBuffer(Glib::RefPtr<SourceTagTable> &tagtable);
00114 explicit SourceBuffer (Glib::RefPtr<SourceLanguage> &language) ;
00115
00116 public:
00117
00122
00123 static Glib::RefPtr<SourceBuffer> create(Glib::RefPtr<SourceTagTable> & tagtable);
00124
00125
00130
00131 static Glib::RefPtr<SourceBuffer> create(Glib::RefPtr<SourceLanguage> & language);
00132
00133
00137
00138 bool get_check_brackets() const;
00139
00146
00147 void set_check_brackets(bool check_brackets=true);
00148
00152
00153 void set_bracket_match_style(const SourceTagStyle& style);
00154
00158
00159 bool get_highlight() const;
00160
00173
00174 void set_highlight(bool highlight=true);
00175
00179
00180 int get_max_undo_levels() const;
00181
00194
00195 void set_max_undo_levels(int max_undo_levels);
00196
00200
00201 Glib::RefPtr<SourceLanguage> get_language();
00202
00206
00207 Glib::RefPtr<const SourceLanguage> get_language() const;
00208
00209
00218
00219 void set_language(Glib::RefPtr<SourceLanguage> language);
00220
00224
00225 gunichar get_escape_char() const;
00226
00235
00236 void set_escape_char(gunichar escape_char);
00237
00240
00241 bool can_undo() const;
00242
00247
00248 bool can_redo() const;
00249
00259
00260 void undo();
00261
00266
00267 void redo();
00268
00274
00275 void begin_not_undoable_action();
00276
00281
00282 void end_not_undoable_action();
00283
00305
00306 Glib::RefPtr<SourceMarker> create_marker(const Glib::ustring& name, const Glib::ustring& type, const Gtk::TextIter& where);
00307
00311
00312 void move_marker(Glib::RefPtr<SourceMarker> &marker, const Gtk::TextIter& where);
00313
00319
00320 void delete_marker(Glib::RefPtr<SourceMarker> &marker);
00321
00325
00326 Glib::RefPtr<SourceMarker> get_marker(const Glib::ustring& name);
00327
00331
00332 Glib::RefPtr<const SourceMarker> get_marker(const Glib::ustring& name) const;
00333
00338
00339 Glib::SListHandle<Glib::RefPtr<SourceMarker> > get_markers_in_region(const Gtk::TextIter& begin, const Gtk::TextIter& end);
00340
00345
00346
00350
00351 Glib::RefPtr<SourceMarker> get_first_marker();
00352
00356
00357 Glib::RefPtr<const SourceMarker> get_first_marker() const;
00358
00362
00363 Glib::RefPtr<SourceMarker> get_last_marker();
00364
00368
00369 Glib::RefPtr<const SourceMarker> get_last_marker() const;
00370
00375 Gtk::TextIter get_iter_at_marker(const Glib::RefPtr<SourceMarker>& marker);
00376
00377
00386
00387 Glib::RefPtr<SourceMarker> get_next_marker(Gtk::TextIter& iter);
00388
00397
00398 Glib::RefPtr<const SourceMarker> get_next_marker(Gtk::TextIter& iter) const;
00399
00408
00409 Glib::RefPtr<SourceMarker> get_prev_marker(Gtk::TextIter& iter);
00410
00419
00420 Glib::RefPtr<const SourceMarker> get_prev_marker(Gtk::TextIter& iter) const;
00421
00424
00428
00429
00430 Glib::SignalProxy1< void,bool > signal_can_redo();
00431
00432
00436
00437
00438 Glib::SignalProxy1< void,bool > signal_can_undo();
00439
00440
00447
00448
00449 Glib::SignalProxy2< void,Gtk::TextIter &,Gtk::TextIter & > signal_highlight_updated();
00450
00451
00457
00458
00459 Glib::SignalProxy1< void,Gtk::TextIter & > signal_marker_updated();
00460
00462
00463
00464 public:
00465
00466 public:
00467
00468 #ifdef GLIBMM_VFUNCS_ENABLED
00469 #endif //GLIBMM_VFUNCS_ENABLED
00470
00471 protected:
00472
00473 #ifdef GLIBMM_VFUNCS_ENABLED
00474 #endif //GLIBMM_VFUNCS_ENABLED
00475
00476
00477 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00478 virtual void on_can_redo(bool can_redo);
00479 virtual void on_can_undo(bool can_redo);
00480 virtual void on_highlight_updated(Gtk::TextIter & start, Gtk::TextIter & end);
00481 virtual void on_marker_updated(Gtk::TextIter & where);
00482 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00483
00484
00485 };
00486
00487 }
00488
00489
00490 namespace Glib
00491 {
00497 Glib::RefPtr<gtksourceview::SourceBuffer> wrap(GtkSourceBuffer* object, bool take_copy = false);
00498 }
00499
00500
00501 #endif
00502