aseprite/src/app/ui/input_chain.h
David Capello 6377b550e3 Replace base::Signal/Observable* with obs::signal/observable
We can use the obs library directly for signal/slots and observable
objects.
2016-09-13 15:02:00 -03:00

44 lines
1018 B
C++

// Aseprite
// Copyright (C) 2001-2016 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_INPUT_CHAIN_H_INCLUDED
#define APP_INPUT_CHAIN_H_INCLUDED
#pragma once
#include <vector>
namespace app {
class Context;
class InputChainElement;
// The chain of objects (in order) that want to receive
// input/commands from the user (e.g. ColorBar, Timeline, and
// Workspace/DocumentView). When each of these elements receive the
// user focus, they call InputChain::prioritize().
class InputChain {
public:
void prioritize(InputChainElement* element);
bool canCut(Context* ctx);
bool canCopy(Context* ctx);
bool canPaste(Context* ctx);
bool canClear(Context* ctx);
void cut(Context* ctx);
void copy(Context* ctx);
void paste(Context* ctx);
void clear(Context* ctx);
void cancel(Context* ctx);
private:
std::vector<InputChainElement*> m_elements;
};
} // namespace app
#endif