edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
 
virtual ~KeyMapParser ()
 destructs the keymapparser
 
bool parse (const QString &filename, TextEditorKeyMap *keyMap)
 loads the given keymap file returns true on success
 
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.
 
QString errorMessage () const
 Returns the error message.
 

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 QByteArray & bytes,
TextEditorKeyMap * keyMap )

◆ parse() [2/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() [3/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

◆ parse() [4/4]

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

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