stlab.adobe.com Adobe Systems Incorporated

cmd_system.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_COMMAND_SYSTEM_HPP
00010 #define ADOBE_COMMAND_SYSTEM_HPP
00011 
00012 /*************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <adobe/name.hpp>
00017 
00018 #include <boost/signals.hpp>
00019 #include <boost/function.hpp>
00020 #include <boost/noncopyable.hpp>
00021 
00022 #ifndef NDEBUG
00023     #include <iostream>
00024 #endif
00025 
00026 /****************************************************************************************************/
00027 
00028 namespace adobe {
00029 
00030 /****************************************************************************************************/
00031 
00032 class command_system_t : boost::noncopyable
00033 {
00034 public:
00035     typedef boost::function<void ()>        command_proc_t;
00036     typedef boost::function<void (bool)>    command_enabled_callback_t;
00037     typedef boost::signals::connection      connection_t;
00038 
00039     command_system_t();
00040     ~command_system_t();
00041 
00042     void insert_command(name_t name, const command_proc_t& proc);
00043     void remove_command(name_t name);
00044     void enable_command(name_t name, bool enabled);
00045     void do_command(name_t name);
00046 
00047     connection_t monitor_enabled(name_t name, const command_enabled_callback_t& callback);
00048 
00049 private:
00050     struct implementation_t;
00051 
00052     implementation_t* object_m;
00053 };
00054 
00055 /****************************************************************************************************/
00056 
00057 } // namespace adobe
00058 
00059 /****************************************************************************************************/
00060 
00061 #endif
00062 
00063 /****************************************************************************************************/

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