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
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
00138
00145
00146
00150
00151
00164
00165
00169
00170 int get_max_undo_levels() const;
00171
00184
00185 void set_max_undo_levels(int max_undo_levels);
00186
00190
00191 Glib::RefPtr<SourceLanguage> get_language();
00192
00196
00197 Glib::RefPtr<const SourceLanguage> get_language() const;
00198
00199
00208
00209 void set_language(const Glib::RefPtr<SourceLanguage>& language);
00210
00214
00215
00224
00225
00228
00229 bool can_undo() const;
00230
00235
00236 bool can_redo() const;
00237
00247
00248 void undo();
00249
00254
00255 void redo();
00256
00262
00263 void begin_not_undoable_action();
00264
00269
00270 void end_not_undoable_action();
00271
00293
00294 Glib::RefPtr<SourceMarker> create_marker(const Glib::ustring& name, const Glib::ustring& type, const Gtk::TextIter& where);
00295
00299
00300 void move_marker(const Glib::RefPtr<SourceMarker> &marker, const Gtk::TextIter& where);
00301
00307
00308 void delete_marker(const Glib::RefPtr<SourceMarker> &marker);
00309
00313
00314 Glib::RefPtr<SourceMarker> get_marker(const Glib::ustring& name);
00315
00319
00320 Glib::RefPtr<const SourceMarker> get_marker(const Glib::ustring& name) const;
00321
00326
00327 Glib::SListHandle<Glib::RefPtr<SourceMarker> > get_markers_in_region(const Gtk::TextIter& begin, const Gtk::TextIter& end);
00328
00333
00334
00338
00339 Glib::RefPtr<SourceMarker> get_first_marker();
00340
00344
00345 Glib::RefPtr<const SourceMarker> get_first_marker() const;
00346
00350
00351 Glib::RefPtr<SourceMarker> get_last_marker();
00352
00356
00357 Glib::RefPtr<const SourceMarker> get_last_marker() const;
00358
00363 Gtk::TextIter get_iter_at_marker(const Glib::RefPtr<SourceMarker>& marker);
00364
00365
00374
00375 Glib::RefPtr<SourceMarker> get_next_marker(Gtk::TextIter& iter);
00376
00385
00386 Glib::RefPtr<const SourceMarker> get_next_marker(Gtk::TextIter& iter) const;
00387
00396
00397 Glib::RefPtr<SourceMarker> get_prev_marker(Gtk::TextIter& iter);
00398
00407
00408 Glib::RefPtr<const SourceMarker> get_prev_marker(Gtk::TextIter& iter) const;
00409
00412
00416
00417
00421
00422
00429
00435 Glib::SignalProxy2< void,Gtk::TextIter &,Gtk::TextIter & > signal_highlight_updated();
00436
00437
00443
00449 Glib::SignalProxy1< void,Gtk::TextIter & > signal_marker_updated();
00450
00452
00453
00454 public:
00455
00456 public:
00457
00458 #ifdef GLIBMM_VFUNCS_ENABLED
00459 #endif //GLIBMM_VFUNCS_ENABLED
00460
00461 protected:
00462
00463 #ifdef GLIBMM_VFUNCS_ENABLED
00464 #endif //GLIBMM_VFUNCS_ENABLED
00465
00466
00467 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00468 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00469
00470
00471 };
00472
00473 }
00474
00475
00476 namespace Glib
00477 {
00486 Glib::RefPtr<gtksourceview::SourceBuffer> wrap(GtkSourceBuffer* object, bool take_copy = false);
00487 }
00488
00489
00490 #endif
00491