edbee - Qt Editor Library
keymapparser.h
Go to the documentation of this file.
1 
6 #include <QHash>
7 #include <QString>
8 #include <QVariant>
9 
10 class QIODevice;
11 
12 namespace edbee {
13 
14 class JsonParser;
15 class TextEditorKeyMap;
16 
45 {
46 public:
47  KeyMapParser();
48  virtual ~KeyMapParser();
49 
50  bool parse(const QString& filename, TextEditorKeyMap* keyMap );
51  bool parse( QIODevice* device, TextEditorKeyMap* keyMap );
52  bool parse( const QByteArray& bytes, TextEditorKeyMap* keyMap );
53  bool parse( const QVariant& variant, TextEditorKeyMap* keyMap );
54 
55  QString errorMessage() const;
56 
57 
58 private:
59 
60  void buildErrorMessageFromParser();
61 
62  bool parseBindingBlock(const QVariantMap &valueObject, TextEditorKeyMap* keyMap );
63 
64  QString errorMessage_;
65  JsonParser* parser_;
66 };
67 
68 } // edbee
KeyMapParser()
constructs the keymapparser
Definition: keymapparser.cpp:23
virtual ~KeyMapParser()
destructs the keymapparser
Definition: keymapparser.cpp:31
This emthod method can be used to load text-editor keymaps.
Definition: keymapparser.h:44
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
QString errorMessage() const
Returns the error message.
Definition: keymapparser.cpp:100
A text editor key map This key map, maps key-sequences to action-names.
Definition: texteditorkeymap.h:39
bool parse(const QString &filename, TextEditorKeyMap *keyMap)
loads the given keymap file returns true on success
Definition: keymapparser.cpp:41
A Json Parser that supports strings in json sources! standard json doesn&#39;t support comments...
Definition: jsonparser.h:17