spectrumview.h

00001 /* 
00002  * Gnome Chemisty Utils
00003  * spectrumview.h
00004  *
00005  * Copyright (C) 2007-2008 Jean Bréfort <jean.brefort@normalesup.org>
00006  *
00007  * This program is free software; you can redistribute it and/or 
00008  * modify it under the terms of the GNU General Public License as 
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00020  * USA
00021  */
00022 
00023 #ifndef GCU_SPECTRUM_VIEW_H
00024 #define GCU_SPECTRUM_VIEW_H
00025 
00026 #include <goffice/graph/gog-series.h>
00027 #include <gtk/gtkwidget.h>
00028 
00029 namespace gcu
00030 {
00031 
00032 class SpectrumDocument;
00033 
00034 class SpectrumView
00035 {
00036 public:
00038 
00043         SpectrumView (SpectrumDocument *pDoc);
00044 
00046 
00049         virtual ~SpectrumView ();
00050 
00053         void SetAxisBounds (GogAxisType target, double min, double max, bool inverted);
00054 
00057         void SetAxisLabel (GogAxisType target, char const *unit);
00058 
00061         void ShowAxis (GogAxisType target, bool show);
00062 
00065         void Render (cairo_t *cr, double width, double height);
00066 
00069         void OnMinChanged ();
00070 
00073         void OnMaxChanged ();
00074 
00077         void OnXRangeChanged ();
00078 
00081         GogSeries *NewSeries (bool new_plot);
00082                         
00092         void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const;
00093 
00094 private:
00095         GtkSpinButton *xminbtn, *xmaxbtn;
00096         GtkRange *xrange;
00097         gulong minsgn, maxsgn, xrangesgn;
00098         double xmin, xmax, xstep;
00099 
00103 GCU_RO_PROP (SpectrumDocument *, Doc)
00104 GCU_RO_PROP (GtkWidget *, Widget)
00105 GCU_RO_PROP (GtkWidget *, OptionBox)
00106 GCU_RO_PROP (GogSeries *, Series)
00107 };
00108 
00109 }
00110 
00111 #endif  //      GCU_SPECTRUM_VIEW_H

Generated on Sun Jun 22 13:26:05 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6