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
00502 #ifdef GLIBMM_PROPERTIES_ENABLED
00503
00509 Glib::PropertyProxy<bool> property_highlight_syntax() ;
00510 #endif //#GLIBMM_PROPERTIES_ENABLED
00511
00512 #ifdef GLIBMM_PROPERTIES_ENABLED
00513
00519 Glib::PropertyProxy_ReadOnly<bool> property_highlight_syntax() const;
00520 #endif //#GLIBMM_PROPERTIES_ENABLED
00521
00522 #ifdef GLIBMM_PROPERTIES_ENABLED
00523
00529 Glib::PropertyProxy<bool> property_highlight_matching_brackets() ;
00530 #endif //#GLIBMM_PROPERTIES_ENABLED
00531
00532 #ifdef GLIBMM_PROPERTIES_ENABLED
00533
00539 Glib::PropertyProxy_ReadOnly<bool> property_highlight_matching_brackets() const;
00540 #endif //#GLIBMM_PROPERTIES_ENABLED
00541
00542 #ifdef GLIBMM_PROPERTIES_ENABLED
00543
00549 Glib::PropertyProxy<int> property_max_undo_levels() ;
00550 #endif //#GLIBMM_PROPERTIES_ENABLED
00551
00552 #ifdef GLIBMM_PROPERTIES_ENABLED
00553
00559 Glib::PropertyProxy_ReadOnly<int> property_max_undo_levels() const;
00560 #endif //#GLIBMM_PROPERTIES_ENABLED
00561
00562 #ifdef GLIBMM_PROPERTIES_ENABLED
00563
00569 Glib::PropertyProxy< Glib::RefPtr<SourceLanguage> > property_language() ;
00570 #endif //#GLIBMM_PROPERTIES_ENABLED
00571
00572 #ifdef GLIBMM_PROPERTIES_ENABLED
00573
00579 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SourceLanguage> > property_language() const;
00580 #endif //#GLIBMM_PROPERTIES_ENABLED
00581
00582 #ifdef GLIBMM_PROPERTIES_ENABLED
00583
00589 Glib::PropertyProxy_ReadOnly<bool> property_can_undo() const;
00590 #endif //#GLIBMM_PROPERTIES_ENABLED
00591
00592
00593 #ifdef GLIBMM_PROPERTIES_ENABLED
00594
00600 Glib::PropertyProxy_ReadOnly<bool> property_can_redo() const;
00601 #endif //#GLIBMM_PROPERTIES_ENABLED
00602
00603
00604 #ifdef GLIBMM_PROPERTIES_ENABLED
00605
00611 Glib::PropertyProxy< Glib::RefPtr<SourceStyleScheme> > property_style_scheme() ;
00612 #endif //#GLIBMM_PROPERTIES_ENABLED
00613
00614 #ifdef GLIBMM_PROPERTIES_ENABLED
00615
00621 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SourceStyleScheme> > property_style_scheme() const;
00622 #endif //#GLIBMM_PROPERTIES_ENABLED
00623
00624
00627
00634
00640 Glib::SignalProxy2< void,Gtk::TextIter&,Gtk::TextIter& > signal_highlight_updated();
00641
00642
00648
00654 Glib::SignalProxy1< void,const Glib::RefPtr<SourceMark>& > signal_source_mark_updated();
00655
00657
00658
00659 public:
00660
00661 public:
00662
00663 #ifdef GLIBMM_VFUNCS_ENABLED
00664 #endif //GLIBMM_VFUNCS_ENABLED
00665
00666 protected:
00667
00668 #ifdef GLIBMM_VFUNCS_ENABLED
00669 #endif //GLIBMM_VFUNCS_ENABLED
00670
00671
00672 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00673 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00674
00675
00676 };
00677
00678 }
00679
00680
00681 namespace Glib
00682 {
00691 Glib::RefPtr<gtksourceview::SourceBuffer> wrap(GtkSourceBuffer* object, bool take_copy = false);
00692 }
00693
00694
00695 #endif
00696