Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jsonrpc: add Input.OnInputRequested and Input.OnInputFinished notific…

…ations
  • Loading branch information...
commit 1c9f8320c5712531065b79a9dee6a5f9ddd643db 1 parent 68e0347
@Montellese authored
View
8 xbmc/dialogs/GUIDialogKeyboard.cpp
@@ -34,6 +34,7 @@
#include "Application.h"
#include "settings/AdvancedSettings.h"
#include "guilib/LocalizeStrings.h"
+#include "interfaces/AnnouncementManager.h"
// Symbol mapping (based on MS virtual keyboard - may need improving)
static char symbol_map[37] = ")!@#$%^&*([]{}-_=+;:\'\",.<>/?\\|`~ ";
@@ -98,6 +99,11 @@ void CGUIDialogKeyboard::OnInitWindow()
{
SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
}
+
+ CVariant data;
+ data["title"] = m_strHeading;
+ data["type"] = "keyboard";
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
bool CGUIDialogKeyboard::OnAction(const CAction &action)
@@ -672,6 +678,8 @@ void CGUIDialogKeyboard::OnDeinitWindow(int nextWindowID)
CGUIDialog::OnDeinitWindow(nextWindowID);
// reset the heading (we don't always have this)
m_strHeading = "";
+
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputFinished");
}
void CGUIDialogKeyboard::MoveCursor(int iAmount)
View
19 xbmc/interfaces/IAnnouncer.h
@@ -25,16 +25,17 @@ namespace ANNOUNCEMENT
{
enum AnnouncementFlag
{
- Player = 0x1,
- GUI = 0x2,
- System = 0x4,
- VideoLibrary = 0x8,
- AudioLibrary = 0x10,
- Application = 0x20,
- Other = 0x40
+ Player = 0x01,
+ GUI = 0x02,
+ System = 0x04,
+ VideoLibrary = 0x08,
+ AudioLibrary = 0x10,
+ Application = 0x20,
+ Input = 0x40,
+ Other = 0x80
};
- #define ANNOUNCE_ALL (Player | GUI | System | VideoLibrary | AudioLibrary | Application | Other)
+ #define ANNOUNCE_ALL (Player | GUI | System | VideoLibrary | AudioLibrary | Application | Input | Other)
/*!
\brief Returns a string representation for the
@@ -58,6 +59,8 @@ namespace ANNOUNCEMENT
return "AudioLibrary";
case Application:
return "Application";
+ case Input:
+ return "Input";
case Other:
return "Other";
default:
View
23 xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -2697,6 +2697,29 @@ namespace JSONRPC
"}"
"],"
"\"returns\": null"
+ "}",
+ "\"Input.OnInputRequested\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The user is requested to provide some information.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"object\", \"required\": true,"
+ "\"properties\": {"
+ "\"type\": { \"type\": \"string\", \"enum\": [ \"keyboard\", \"time\", \"date\", \"ip\", \"password\", \"number\", \"seconds\" ], \"required\": true },"
+ "\"title\": { \"type\": \"string\" }"
+ "}"
+ "}"
+ "],"
+ "\"returns\": null"
+ "}",
+ "\"Input.OnInputFinished\": {"
+ "\"type\": \"notification\","
+ "\"description\": \"The user has provided the requested input.\","
+ "\"params\": ["
+ "{ \"name\": \"sender\", \"type\": \"string\", \"required\": true },"
+ "{ \"name\": \"data\", \"type\": \"null\", \"required\": true }"
+ "],"
+ "\"returns\": null"
"}"
};
}
View
23 xbmc/interfaces/json-rpc/notifications.json
@@ -187,5 +187,28 @@
}
],
"returns": null
+ },
+ "Input.OnInputRequested": {
+ "type": "notification",
+ "description": "The user is requested to provide some information.",
+ "params": [
+ { "name": "sender", "type": "string", "required": true },
+ { "name": "data", "type": "object", "required": true,
+ "properties": {
+ "type": { "type": "string", "enum": [ "keyboard", "time", "date", "ip", "password", "number", "seconds" ], "required": true },
+ "title": { "type": "string" }
+ }
+ }
+ ],
+ "returns": null
+ },
+ "Input.OnInputFinished": {
+ "type": "notification",
+ "description": "The user has provided the requested input.",
+ "params": [
+ { "name": "sender", "type": "string", "required": true },
+ { "name": "data", "type": "null", "required": true }
+ ],
+ "returns": null
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.