stlab.adobe.com Adobe Systems Incorporated

platform_tab_group.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_TAB_GROUP_HPP
00010 #define ADOBE_TAB_GROUP_HPP
00011 
00012 /****************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <vector>
00017 
00018 #include <boost/utility.hpp>
00019 #include <boost/function.hpp>
00020 
00021 #include <adobe/any_regular.hpp>
00022 #include <adobe/extents.hpp>
00023 #include <adobe/layout_attributes.hpp>
00024 #include <adobe/widget_attributes.hpp>
00025 #include <adobe/future/widgets/headers/widget_utils.hpp>
00026 
00027 /****************************************************************************************************/
00028 
00029 namespace adobe {
00030 
00031 /****************************************************************************************************/
00032 #ifndef ADOBE_NO_DOCUMENTATION
00033 typedef boost::function<void (const any_regular_t&)> tab_group_value_proc_t;
00034  
00035 struct tab_group_t; 
00036 struct tab_group_value_handler_t
00037 {
00038     explicit tab_group_value_handler_t(tab_group_t& widget) :
00039         widget_m(widget)
00040     {
00041         handler_m.insert(kEventClassControl, kEventControlValueFieldChanged);
00042 
00043         handler_m.monitor_proc_m = boost::bind(&tab_group_value_handler_t::handle_event,
00044                                                boost::ref(*this), _1, _2);
00045     }
00046 
00047     ::OSStatus handle_event(::EventHandlerCallRef next,
00048                             ::EventRef            event);
00049 
00050     event_handler_t        handler_m;
00051     tab_group_value_proc_t setter_m;
00052     tab_group_t&           widget_m;
00053 };
00054 #endif
00055 /****************************************************************************************************/
00061 struct tab_group_t : boost::noncopyable
00062 {
00064     typedef any_regular_t model_type;
00065 
00067     typedef tab_group_t  widget_type_t;
00068 
00070     struct tab_t
00071     {
00073         std::string name_m;
00075         any_regular_t value_m;
00076     };
00077 
00079     tab_group_t(const tab_t* first, const tab_t* last, theme_t theme);
00080 
00087     void measure(extents_t& result);
00088 
00089     void place(const place_data_t& place_data);
00091 
00098     void display(const any_regular_t& new_value);
00100 
00107     void monitor(const tab_group_value_proc_t& proc);
00108 
00109     void enable(bool make_active)
00110         { implementation::set_active(control_m, make_active); }
00112 
00113 #ifndef ADOBE_NO_DOCUMENTATION
00114     typedef std::vector<tab_t> tab_set_t;
00115 
00116     ::ControlRef                control_m;
00117     theme_t                     theme_m;
00118     mutable metric_extractor_t  metrics_m;
00119     tab_set_t                   items_m;
00120     tab_group_value_handler_t   value_handler_m;
00121     bool                        debounce_m;
00122 #endif
00123 };
00124 
00125 /****************************************************************************************************/
00126 
00127 } //namespace adobe
00128 
00129 /****************************************************************************************************/
00130 
00131 #endif 
00132 
00133 /****************************************************************************************************/

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