KTp/Components/Chat Window/Plugin API Draft: Difference between revisions
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{:KTp/Header}} | |||
Making an API to create plugins for the chat window. | Making an API to create plugins for the chat window. | ||
These should be able to handle the following usecases: | These should be able to handle the following usecases: | ||
Line 33: | Line 34: | ||
It will consist of the following classes | It will consist of the following classes | ||
*Interface Class : ReceivingPlugin | *Interface Class : ReceivingPlugin | ||
** | |||
**virtual methods: | **virtual methods: | ||
***ProcessReceivedMessage(Message message); | |||
**methods: | |||
***PreProcessReceivedMessage(Message); maybe have method like this, which PluginManager will call, that will check that that message hasn't already been processed before calling ProcessReceivedMessage(). | ***PreProcessReceivedMessage(Message); maybe have method like this, which PluginManager will call, that will check that that message hasn't already been processed before calling ProcessReceivedMessage(). | ||
*Interface Class : SendingPlugin | *Interface Class : SendingPlugin | ||
** | |||
*Plugin Manager - Every client that wants to use the plugin system will have a single, global, static instance of this. | *Plugin Manager - Every client that wants to use the plugin system will have a single, global, static instance of this. | ||
**signal: displayMessage(bool final); | **signal: displayMessage(bool final); | ||
**slot: | **slot: processAndSendNewMessage(QString message); | ||
** | **slot: processReceivedMessage(Tp::Message message); | ||
**QList<SendingPlugin> | **QList<SendingPlugin> | ||
**QList<ReceivingPlugin> | **QList<ReceivingPlugin> | ||
** | ** |
Latest revision as of 01:14, 10 November 2012
Making an API to create plugins for the chat window. These should be able to handle the following usecases:
- Translator plugin - when messages are sent or received, it will translate them before they are displayed (or actually sent)
- Image Embed plugin - when a URL of an image is received, it will display the image under the text
- Grammar correction - a plugin that replaces "wont" with "won't" on messages to be sent
- Youtube embed - embeds a youtube video in a chat
The stakeholders (components) are as follows:
- UI - telepathy-kde-text-ui and chat-widget etc.
- Plugin Manager
- Plugin
- Core (Telepathy)
<I'll upload the diagram for how they interact later>
The interactions between the components:
- Plugin Manager and Plugin
- Process Message
- Return Message
- Initialize
- Loading
- Destroy
- Send-Message //still not sure about this
- Plugin Manager and Ui
- Display Message
- Display Final Message
- Send New Message //to be processed BEFORE being sent
- Plugin Manager and Core
- New Message Received
- Send New Message
It will consist of the following classes
- Interface Class : ReceivingPlugin
- virtual methods:
- ProcessReceivedMessage(Message message);
- methods:
- PreProcessReceivedMessage(Message); maybe have method like this, which PluginManager will call, that will check that that message hasn't already been processed before calling ProcessReceivedMessage().
- virtual methods:
- Interface Class : SendingPlugin
- Plugin Manager - Every client that wants to use the plugin system will have a single, global, static instance of this.
- signal: displayMessage(bool final);
- slot: processAndSendNewMessage(QString message);
- slot: processReceivedMessage(Tp::Message message);
- QList<SendingPlugin>
- QList<ReceivingPlugin>