platform_presets.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_PRESETS_HPP 00010 #define ADOBE_WIDGET_PRESETS_HPP 00011 00012 /****************************************************************************************************/ 00013 00014 #include <adobe/future/widgets/headers/platform_popup.hpp> 00015 00016 #include <adobe/array.hpp> 00017 #include <adobe/dictionary.hpp> 00018 #include <adobe/widget_attributes.hpp> 00019 00020 #include <boost/function.hpp> 00021 #include <boost/filesystem/path.hpp> 00022 00023 /****************************************************************************************************/ 00024 00025 namespace adobe { 00026 00027 /****************************************************************************************************/ 00028 00029 struct presets_t; 00030 00031 /****************************************************************************************************/ 00032 00033 typedef boost::function<dictionary_t ()> model_snapshot_proc_t; 00034 00035 /****************************************************************************************************/ 00036 00047 struct presets_t : boost::noncopyable 00048 { 00049 typedef dictionary_t model_type; 00050 typedef popup_t::setter_type setter_type; 00051 00066 presets_t(const std::string& name, 00067 const std::string& domain, 00068 const std::string& alt_text, 00069 const array_t& bind_set, 00070 const dictionary_t& localization_set, 00071 theme_t theme); 00072 00073 00077 void measure(extents_t& result); 00078 00082 void place(const place_data_t& place_data); 00083 00087 void display(const model_type& value); 00088 00092 void display_additional_preset_set(const array_t& value); 00093 00097 void monitor(const setter_type& proc) 00098 { proc_m = proc; } 00099 00103 void snapshot_callback(const model_snapshot_proc_t& proc) 00104 { snapshot_proc_m = proc; } 00105 00106 HWND control_m; 00107 dictionary_t localization_set_m; 00108 popup_t category_popup_m; // the category popup 00109 popup_t popup_m; // the actual preset popup 00110 theme_t theme_m; 00111 array_t bind_set_m; // the set of parameters to be stored in the preset 00112 std::string name_m; 00113 std::string domain_m; 00114 std::string alt_text_m; 00115 bool selected_m; 00116 long popup_height_m; 00117 model_snapshot_proc_t snapshot_proc_m; 00118 dictionary_t last_m; 00119 bool type_2_debounce_m; 00120 setter_type proc_m; 00121 bool custom_m; 00122 00123 // these store the various preset sources as arrays 00124 array_t dynamic_preset_set_m; 00125 array_t default_preset_set_m; 00126 array_t user_preset_set_m; 00127 array_t composite_m; 00128 00129 void do_imbue(const popup_t::model_type& value); 00130 00131 private: 00132 void display_custom(); 00133 }; 00134 00135 /****************************************************************************************************/ 00136 00141 void enable(presets_t& value, bool make_enabled); 00142 00143 /****************************************************************************************************/ 00144 00145 } // namespace adobe 00146 00147 /****************************************************************************************************/ 00148 00149 #endif 00150 00151 /****************************************************************************************************/ |