stlab.adobe.com Adobe Systems Incorporated

platform_slider.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /****************************************************************************************************/
00008 
00009 #ifndef ADOBE_WIDGET_SLIDER_HPP
00010 #define ADOBE_WIDGET_SLIDER_HPP
00011 
00012 /****************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <adobe/dictionary.hpp>
00017 #include <adobe/extents.hpp>
00018 #include <adobe/future/macintosh_events.hpp>
00019 #include <adobe/future/widgets/headers/macintosh_metric_extractor.hpp>
00020 #include <adobe/future/widgets/headers/slider_helper.hpp>
00021 #include <adobe/future/widgets/headers/widget_utils.hpp>
00022 #include <adobe/macintosh_carbon_safe.hpp>
00023 #include <adobe/memory.hpp>
00024 #include <adobe/name.hpp>
00025 
00026 #include <boost/static_assert.hpp>
00027 
00028 /****************************************************************************************************/
00029 
00030 namespace adobe {
00031 
00032 /****************************************************************************************************/
00033 #ifndef ADOBE_NO_DOCUMENTATION
00034 typedef boost::function<void (const long&)> slider_setter_type;
00035 #endif
00036 /****************************************************************************************************/
00037 
00043 struct slider_t
00044 {
00046     typedef long model_type;
00047 
00049     typedef boost::function<void (const model_type&)> setter_type;
00050 
00051 #ifndef ADOBE_NO_DOCUMENTATION
00052     BOOST_STATIC_ASSERT((boost::is_same<setter_type, slider_setter_type>::value));
00053 #endif
00054 
00063     slider_t(const std::string&          alt_text,
00064              bool                        is_vertical,
00065              slider_style_t              style,
00066              std::size_t                 num_ticks,
00067              const value_range_format_t& format,
00068              theme_t                     theme);
00069 
00076     void measure(extents_t& result);
00077 
00078     void place(const place_data_t& place_data);
00080 
00087     void display(const model_type& value);
00089 
00096     void monitor(const setter_type& proc);
00097 
00098     void enable(bool make_enabled);
00100 
00101 #ifndef ADOBE_NO_DOCUMENTATION
00102     ::ControlRef               control_m;
00103     mutable metric_extractor_t metrics_m;
00104     std::string                alt_text_m;
00105     bool                       is_vertical_m;
00106     slider_style_t             style_m;
00107     std::size_t                num_ticks_m;
00108     value_range_format_t       format_m;
00109     theme_t                    theme_m;
00110     setter_type                value_proc_m;
00111     long                       last_m; // debounce
00112     long                       value_m;
00113 #endif
00114 };
00115 
00116 /****************************************************************************************************/
00117 
00118 } // namespace adobe
00119 
00120 /****************************************************************************************************/
00121 
00122 #endif
00123 
00124 /****************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google