30 lines
1.1 KiB
C++
30 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
// Hint mode ("f"): JavaScript that labels the clickable elements in the
|
|
// viewport and narrows them down as the user types. All of it runs in
|
|
// QWebEngineScript::ApplicationWorld, so the page's own scripts can neither see
|
|
// nor tamper with the hint state; only the DOM is shared.
|
|
//
|
|
// Every script evaluates to a result map with a "state" key:
|
|
// "shown" - hints are on screen; "count" says how many
|
|
// "partial" - more than one hint still matches what was typed
|
|
// "nomatch" - the key matched nothing and was ignored
|
|
// "follow" - one hint left; "x"/"y" is the point to click, in CSS pixels
|
|
// relative to the viewport, and "editable" says whether it is a
|
|
// text field
|
|
// "gone" - the chosen element disappeared from the page
|
|
// "none" - there is no hint session to act on
|
|
namespace hints {
|
|
|
|
// The characters labels are built from - qutebrowser's home-row default.
|
|
QString chars();
|
|
|
|
QString showScript();
|
|
QString keyScript(QChar key);
|
|
QString backspaceScript();
|
|
QString clearScript();
|
|
|
|
} // namespace hints
|