2017-03-08 04:25:33 +01:00
|
|
|
/*
|
|
|
|
|
CMD-ACCESSOR.hpp - interface to access command invocation services within the UI
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2017, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2017-04-08 16:24:36 +02:00
|
|
|
/** @file cmd-access.hpp
|
2017-03-08 04:25:33 +01:00
|
|
|
** Abstraction: access to command invocation for UI-Elements.
|
2017-04-08 16:24:36 +02:00
|
|
|
** The interact::CmdAccess front-end is used by any UI element about to invoke and dispatch
|
2017-03-08 04:25:33 +01:00
|
|
|
** commands into the session via ProcDispatcher. To invoke a command, typically it is necessary
|
|
|
|
|
** to prepare a _command instance_ and to pick up and bind _command arguments._ This can be achieved
|
2017-04-08 16:24:36 +02:00
|
|
|
** with the help of an intermediary, known as ["interaction state manager"](\ref InteractionState).
|
|
|
|
|
** Thus, the command accessor allows to discover a specific InteractionState instance, which
|
2017-03-08 04:25:33 +01:00
|
|
|
** - is responsible for the specific command to be invoked
|
|
|
|
|
** - can handle context information related to a specific _control system_ (e.g mouse, keyboard,
|
|
|
|
|
** hardware controller, pen)
|
|
|
|
|
** - might handle changing contextual state and thus decide if a command can be invoked
|
2017-04-17 18:21:52 +02:00
|
|
|
** From the InteractionState instance, it is possible to retrieve a notification when a specific,
|
|
|
|
|
** context-bound command becomes executable by picking up suitable parameter values from this context.
|
2017-03-08 04:25:33 +01:00
|
|
|
**
|
|
|
|
|
** @todo as of 3/2017 this is a early design draft and WIP-WIP-WIP
|
|
|
|
|
**
|
2017-04-08 16:24:36 +02:00
|
|
|
** @see TODO___cmd-access-test.cpp
|
2017-03-08 04:25:33 +01:00
|
|
|
** @see ////TODO_test usage example
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2017-04-08 16:24:36 +02:00
|
|
|
#ifndef GUI_INTERACT_CMD_ACCESS_H
|
|
|
|
|
#define GUI_INTERACT_CMD_ACCESS_H
|
2017-03-08 04:25:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "lib/error.hpp"
|
|
|
|
|
//#include "gui/ctrl/bus-term.hpp"
|
|
|
|
|
//#include "lib/idi/entry-id.hpp"
|
2017-04-14 03:22:08 +02:00
|
|
|
#include "lib/symbol.hpp"
|
2017-03-08 04:25:33 +01:00
|
|
|
//#include "lib/util.hpp"
|
|
|
|
|
|
|
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace gui {
|
|
|
|
|
namespace interact {
|
|
|
|
|
|
|
|
|
|
// using lib::HashVal;
|
2017-04-14 03:22:08 +02:00
|
|
|
using lib::Symbol;
|
2017-03-08 04:25:33 +01:00
|
|
|
// using util::isnil;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Abstract foundation of UI state tracking components.
|
|
|
|
|
* @todo write type comment...
|
|
|
|
|
*/
|
2017-04-08 16:24:36 +02:00
|
|
|
class CmdAccess
|
2017-03-08 04:25:33 +01:00
|
|
|
: boost::noncopyable
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
2017-04-14 03:22:08 +02:00
|
|
|
~CmdAccess(); ///< @todo do we need a VTable / virtual dtor?
|
2017-03-08 04:25:33 +01:00
|
|
|
|
2017-04-14 03:22:08 +02:00
|
|
|
/* === access front-end === */
|
|
|
|
|
static Symbol to (Symbol cmdID, string ctxID);
|
|
|
|
|
|
|
|
|
|
friend CmdAccess&
|
|
|
|
|
cmdAccess (Symbol instanceID)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("cmd access front-end");
|
|
|
|
|
}
|
|
|
|
|
protected:
|
2017-03-08 04:25:33 +01:00
|
|
|
private:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace gui::interact
|
2017-04-08 16:24:36 +02:00
|
|
|
#endif /*GUI_INTERACT_CMD_ACCESS_H*/
|