![]() |
LeechCraft Azoth
0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
|
Interface for chat style resource loaders and handlers. More...
#include "ichatstyleresourcesource.h"
Public Member Functions | |
~IChatStyleResourceSource () override=default | |
virtual QUrl | GetBaseURL (const QString &style) const =0 |
Returns the base URL for the given style. More... | |
virtual QString | GetHTMLTemplate (const QString &style, const QString &variant, QObject *entry, QWebEnginePage *page) const =0 |
Returns the base HTML template for the given style. More... | |
virtual bool | AppendMessage (QWebEnginePage *page, QObject *message, const ChatMsgAppendInfo &info)=0 |
Appends a new message to the chat view. More... | |
virtual void | FrameFocused (QWebEnginePage *page)=0 |
Notifies about a frame obtaining user input focus. More... | |
virtual QStringList | GetVariantsForPack (const QString &style)=0 |
Returns the list of variants for the style pack. More... | |
![]() | |
virtual | ~IResourceSource () |
virtual QAbstractItemModel * | GetOptionsModel () const =0 |
Returns the model with the options for resource. More... | |
Interface for chat style resource loaders and handlers.
This interface should be implemented by resource sources that are willing to provide chat styles for Azoth.
The basic HTML template to be installed into the chat window whenever a new chat window is created is returned by GetHTMLTemplate. AppendMessage is used to append a message into a chat window with an HTML template already set. FrameFocused is called whenever user focuses on the given chat window.
Definition at line 54 of file ichatstyleresourcesource.h.
|
overridedefault |
|
pure virtual |
Appends a new message to the chat view.
This function is called whenever a new message should be appended to the chat view located in the given frame.
[in] | frame | The chat view frame. |
[in] | message | The message to be appended. |
[in] | info | Additional chat message info structure. |
|
pure virtual |
Notifies about a frame obtaining user input focus.
This function is called whenever a given frame receives user input focus.
It may be used, for example, to visually separate already read messages from new ones since the user last focused on the given chat session.
[in] | frame | The frame that received focus. |
|
pure virtual |
Returns the base URL for the given style.
The returned URL would be passed as base URL to the QWebView::setHtml() method.
Return a proper value if your theme may contain elements with relative URIs for them to be loaded properly. Though, if your theme is known to not have such elements, it's safe to return a default-constructed QUrl object.
[in] | style | The style name for which to return the base URL. |
|
pure virtual |
Returns the base HTML template for the given style.
This function is called whenever a new chat window is being opened and its chat view is being initialized. The string returned by this function is then passed to the chat view (to the QWebView::setHtml() method, to be exact).
The style parameter indicates the exact style name for which the template should be returned. The style is the one from the model returned by IResourceSource::GetOptionsModel().
The entry parameter defines the entry for which the chat window is being created. Of course, the entry implements at least the ICLEntry interface.
[in] | style | The style name for which to return the template. |
[in] | variant | The style variant for which to return the template, an element of the list returned by GetVariantsForPack(). |
[in] | entry | The entry object for which the chat window is being set up. |
[in] | frame | The frame that's being set up. |
|
pure virtual |
Returns the list of variants for the style pack.
Values from the returned list will be passed to the GetHTMLTemplate() function. If the style plugin does not support style variants, an empty list may be returned.