SourceView.h

Go to the documentation of this file.
00001 #ifndef GTKUTIL_SOURCEVIEW_H_
00002 #define GTKUTIL_SOURCEVIEW_H_
00003 
00004 #include <string>
00005 #include "gtkutil/ifc/Widget.h"
00006 #include <stdexcept>
00007 
00008 typedef struct _GtkSourceBuffer GtkSourceBuffer;
00009 typedef struct _GtkSourceView GtkSourceView;
00010 typedef struct _GtkWidget GtkWidget;
00011 typedef struct _GtkSourceLanguageManager GtkSourceLanguageManager;
00012 
00013 namespace gtkutil
00014 {
00015 
00016     class SourceView: public Widget
00017     {
00018             // The top-level widget
00019             GtkWidget* _widget;
00020 
00021             GtkSourceView* _view;
00022             GtkSourceBuffer* _buffer;
00023 
00024             GtkSourceLanguageManager* _langManager;
00025 
00026         public:
00036             SourceView (const std::string& language, bool readOnly);
00037 
00038             virtual ~SourceView ();
00039 
00040             void setContents (const std::string& newContents);
00041 
00042             // Returns the contents of the source buffer
00043             std::string getContents ();
00044 
00045             // place the cursor at the given linenumber
00046             void goToLine (int lineNumber);
00047 
00048             // Clears the contents of the buffer
00049             void clear ();
00050 
00051         protected:
00052             // gtkutil::Widget implementation
00053             GtkWidget* _getWidget () const
00054             {
00055                 return _widget;
00056             }
00057     };
00058 
00059 } // namespace gtkutil
00060 
00061 #endif /* GTKUTIL_SOURCEVIEW_H_ */

Generated by  doxygen 1.6.2