stlab.adobe.com Adobe Systems Incorporated

platform_display_number.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_DISPLAY_NUMBER_HPP
00010 #define ADOBE_WIDGET_DISPLAY_NUMBER_HPP
00011 
00012 /**************************************************************************************************/
00013 
00014 #include <adobe/eve.hpp>
00015 #include <adobe/future/widgets/headers/macintosh_metric_extractor.hpp>
00016 #include <adobe/future/widgets/headers/number_unit.hpp>
00017 #include <adobe/future/widgets/headers/widget_utils.hpp>
00018 #include <adobe/macintosh_carbon_safe.hpp>
00019 
00020 /**************************************************************************************************/
00021 
00022 namespace adobe {
00023 
00024 /**************************************************************************************************/
00047 struct display_number_t : boost::noncopyable
00048 {
00050     typedef double model_type;
00051 
00052     typedef std::vector<unit_t> unit_set_t;
00053 
00054     template <class ForwardIterator>
00055     display_number_t(const std::string& name,
00056                      const std::string& alt_text,
00057                      ForwardIterator    first,
00058                      ForwardIterator    last, 
00059                      theme_t            theme,
00060                      int                characters);
00061 
00062 #ifndef ADOBE_NO_DOCUMENTATION
00063     auto_control_t             control_m;
00064     mutable metric_extractor_t metrics_m;
00065     std::string                name_m;
00066     std::string                alt_text_m;
00067     unit_set_t                 unit_set_m;
00068     theme_t                    theme_m;
00069     std::string::size_type     label_chars_m;
00070     int                        characters_m;
00071 #endif
00072 };
00073 
00074 /**************************************************************************************************/
00075 
00090 template <typename ForwardIterator>
00091 display_number_t::display_number_t(const std::string& name,
00092                                    const std::string& alt_text,
00093                                    ForwardIterator    first,
00094                                    ForwardIterator    last, 
00095                                    theme_t            theme,
00096                                    int                characters) :
00097     name_m(name),
00098     alt_text_m(alt_text),
00099     unit_set_m(first, last),
00100     theme_m(theme),
00101     label_chars_m(0),
00102     characters_m(characters)
00103 { }
00104     
00105 /**************************************************************************************************/
00106 
00115 void measure(display_number_t& value, extents_t& result);
00116     
00117 void measure_vertical(display_number_t&   value,
00118                       extents_t&          calculated_horizontal, 
00119                       const place_data_t& placed_horizontal);
00120 
00121 void place(display_number_t& value, const place_data_t& place_data);
00123 
00132 void display(display_number_t& value, const display_number_t::model_type&);
00134 
00135 /**************************************************************************************************/
00136 
00137 } // namespace adobe
00138 
00139 /**************************************************************************************************/
00140 
00141 #endif
00142 
00143 /**************************************************************************************************/

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