|
Rapicorn - Experimental UI Toolkit - Source Code 10.08.1
|
00001 /* Rapicorn 00002 * Copyright (C) 2005 Tim Janik 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * A copy of the GNU Lesser General Public License should ship along 00015 * with this library; if not, see http://www.gnu.org/copyleft/. 00016 */ 00017 #ifndef __RAPICORN_ADJUSTMENT_HH__ 00018 #define __RAPICORN_ADJUSTMENT_HH__ 00019 00020 #include <ui/item.hh> 00021 00022 namespace Rapicorn { 00023 00024 class Adjustment : public virtual BaseObject { 00025 typedef Signal<Adjustment, void ()> SignalValueChanged; 00026 typedef Signal<Adjustment, void ()> SignalRangeChanged; 00027 protected: 00028 explicit Adjustment (); 00029 virtual ~Adjustment (); 00030 virtual void value_changed (); 00031 virtual void range_changed (); 00032 public: 00033 /* value */ 00034 virtual double value () = 0; 00035 virtual void value (double newval) = 0; 00036 double flipped_value (); 00037 void flipped_value (double newval); 00038 SignalValueChanged sig_value_changed; 00039 /* normalized (0..1) value */ 00040 double nvalue (); 00041 void nvalue (double newval); 00042 double flipped_nvalue (); 00043 void flipped_nvalue (double newval); 00044 /* range */ 00045 virtual bool frozen () const = 0; 00046 virtual void freeze () = 0; 00047 virtual double lower () const = 0; 00048 virtual void lower (double newval) = 0; 00049 virtual double upper () const = 0; 00050 virtual void upper (double newval) = 0; 00051 virtual double step_increment () const = 0; 00052 virtual void step_increment (double newval) = 0; 00053 virtual double page_increment () const = 0; 00054 virtual void page_increment (double newval) = 0; 00055 virtual double page () const = 0; 00056 virtual void page (double newval) = 0; 00057 virtual void constrain () = 0; 00058 virtual void thaw () = 0; 00059 SignalRangeChanged sig_range_changed; 00060 double abs_range (); 00061 double abs_length (); 00062 String string (); 00063 /* factory */ 00064 static Adjustment* create (double value = 0, 00065 double lower = 0, 00066 double upper = 100, 00067 double step_increment = 1, 00068 double page_increment = 10, 00069 double page_size = 0); 00070 }; 00071 00072 class AdjustmentSource : public virtual BaseObject { 00073 public: 00074 virtual Adjustment* get_adjustment (AdjustmentSourceType adj_source, 00075 const String &name = "") = 0; 00076 }; 00077 00078 } // Rapicorn 00079 00080 #endif /* __RAPICORN_ADJUSTMENT_HH__ */
1.7.4