1 Star 0 Fork 0

程梦杰 / IDE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
abstractinputmode.h 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
程梦杰 提交于 2022-02-07 18:01 . first commit
#ifndef ABSTRACTINPUTMODE_H
#define ABSTRACTINPUTMODE_H
#include <QString>
#include <QSharedPointer>
#include "global.h"
class QKeyEvent;
class InputModeEditorInterface;
class InputModeStatusWidget;
class AbstractInputMode
{
public:
explicit AbstractInputMode(InputModeEditorInterface *p_interface);
virtual ~AbstractInputMode();
virtual QString name() const = 0;
virtual InputMode mode() const = 0;
virtual EditorMode editorMode() const = 0;
// Get status widget of input mode.
// Could be NULL.
// The caller should hold this pointer during the usage and explicitly
// remove the widget from QObject system at the end.
virtual QSharedPointer<InputModeStatusWidget> statusWidget() = 0;
virtual void activate() = 0;
virtual void deactivate() = 0;
virtual void focusIn() = 0;
virtual void focusOut() = 0;
// Return true if the key press is handled inside.
virtual bool handleKeyPress(QKeyEvent *p_event) = 0;
// Return true if the shortcut key event is handled inside.
// If stolen, Qt will replay this key event immediately as an ordinary KeyPress.
virtual bool stealShortcut(QKeyEvent *p_event) = 0;
// Hook that will be called before/after the default KeyPress event handle.
virtual void preKeyPressDefaultHandle(QKeyEvent *p_event) = 0;
virtual void postKeyPressDefaultHandle(QKeyEvent *p_event) = 0;
protected:
InputModeEditorInterface *m_interface = nullptr;
};
#endif // ABSTRACTINPUTMODE_H
C++
1
https://gitee.com/cheng_lib/ide.git
git@gitee.com:cheng_lib/ide.git
cheng_lib
ide
IDE
master

搜索帮助