edbee - Qt Editor Library
Public Member Functions | List of all members
edbee::KeyMapParser Class Reference

This emthod method can be used to load text-editor keymaps. More...

#include <keymapparser.h>

+ Collaboration diagram for edbee::KeyMapParser:

Public Member Functions

 KeyMapParser ()
 constructs the keymapparser More...
 
virtual ~KeyMapParser ()
 destructs the keymapparser More...
 
bool parse (const QString &filename, TextEditorKeyMap *keyMap)
 loads the given keymap file returns true on success More...
 
bool parse (QIODevice *device, TextEditorKeyMap *keyMap)
 
bool parse (const QByteArray &bytes, TextEditorKeyMap *keyMap)
 
bool parse (const QVariant &variant, TextEditorKeyMap *keyMap)
 Parsers the variant map so the keymapManager is filled. More...
 
QString errorMessage () const
 Returns the error message. More...
 

Detailed Description

This emthod method can be used to load text-editor keymaps.

The json file has got the following format

[ { "context": { "name": "texteditor", // the part of the appliction these bindigns used for. ... }, "defaults": { "context": [ { // the context defined here is coppied to alle keybindings {"key": "scope", "value": "source.php"}, ... }] }, "bindings": [ { "keys": "Ctrl+M,U", "command": "display_undo_stack" }, // todo, add scopes to keybindings .... ] }, ... ]

Context is still not completely thought over but it is used to make certain keybindings context specific. Think for example of keybindings only used for given language

Constructor & Destructor Documentation

◆ KeyMapParser()

edbee::KeyMapParser::KeyMapParser ( )

constructs the keymapparser

◆ ~KeyMapParser()

edbee::KeyMapParser::~KeyMapParser ( )
virtual

destructs the keymapparser

Member Function Documentation

◆ errorMessage()

QString edbee::KeyMapParser::errorMessage ( ) const

Returns the error message.

◆ parse() [1/4]

bool edbee::KeyMapParser::parse ( const QString &  filename,
TextEditorKeyMap keyMap 
)

loads the given keymap file returns true on success

Parameters
filenamethe file to parse
keyMapthe keymapfile to put the results in
Returns
true on success

◆ parse() [2/4]

bool edbee::KeyMapParser::parse ( QIODevice *  device,
TextEditorKeyMap keyMap 
)

◆ parse() [3/4]

bool edbee::KeyMapParser::parse ( const QByteArray &  bytes,
TextEditorKeyMap keyMap 
)

◆ parse() [4/4]

bool edbee::KeyMapParser::parse ( const QVariant &  variant,
TextEditorKeyMap keyMap 
)

Parsers the variant map so the keymapManager is filled.

Parameters
variantthe variant to parse
managerthe manager to parse
managerthe keymap manager

The documentation for this class was generated from the following files: