Go to the documentation of this file.
10 #include <QCoreApplication>
14 #include <QTextStream>
17 #include "libmythbase/mythconfig.h"
34 :
Eventing(
"MythFEXML",
"MYTHTV_Event", sSharePath)
82 LOG(VB_UPNP, LOG_INFO, QString(
"MythFEXML::ProcessRequest: %1 : %2")
118 int nWidth = pRequest->
m_mapParams[
"width" ].toInt();
119 int nHeight = pRequest->
m_mapParams[
"height" ].toInt();
120 QString sFormat = pRequest->
m_mapParams[
"format" ];
122 if (sFormat.isEmpty())
125 if (sFormat !=
"jpg" && sFormat !=
"png")
127 LOG(VB_GENERAL, LOG_ERR,
"Invalid screen shot format: " + sFormat);
131 LOG(VB_GENERAL, LOG_INFO,
132 QString(
"Screen shot requested (%1x%2), format %3")
133 .arg(nWidth).arg(nHeight).arg(sFormat));
135 QString sFileName = QString(
"/%1/myth-screenshot-XML.%2")
145 " <script type =\"text/javascript\">\n"
146 " function postaction(action) {\n"
147 " var myForm = document.createElement(\"form\");\n"
148 " myForm.method =\"Post\";\n"
149 " myForm.action =\"../Frontend/SendAction?\";\n"
150 " myForm.target =\"post_target\";\n"
151 " var myInput = document.createElement(\"input\");\n"
152 " myInput.setAttribute(\"name\", \"Action\");\n"
153 " myInput.setAttribute(\"value\", action);\n"
154 " myForm.appendChild(myInput);\n"
155 " document.body.appendChild(myForm);\n"
156 " myForm.submit();\n"
157 " document.body.removeChild(myForm);\n"
162 " <iframe id=\"hidden_target\" name=\"post_target\" src=\"\""
163 " style=\"width:0;height:0;border:0px solid #fff;\"></iframe>\n";
170 pRequest->
m_mapRespHeaders[
"Cache-Control" ] =
"no-cache=\"Ext\", max-age = 5000";
179 while (contexts.hasNext())
182 QStringList actions = contexts.value();
183 for (
const QString &
action : qAsConst(actions))
185 QStringList split =
action.split(
",");
186 if (split.size() == 2)
189 QString(
" <div>%1 <input type=\"button\" value=\"%2\" onClick=\"postaction('%2');\"></input> %3</div>\n")
190 .arg(contexts.key(), split[0], split[1]);
203 return QString(
" <input class=\"bigb\" type=\"button\" value=\"%1\" onClick=\"postaction('%2');\"></input>\r\n").arg(
action, desc);
209 pRequest->
m_mapRespHeaders[
"Cache-Control" ] =
"no-cache=\"Ext\", max-age = 5000";
215 " <style type=\"text/css\" title=\"Default\" media=\"all\">\r\n"
219 " width : 310px;\r\n"
223 " width : 100px;\r\n"
226 " text-align: center;\r\n"
229 " <title>MythFrontend Control</title>\r\n" <<
bool ProcessRequest(HTTPRequest *pRequest) override
QStringList GetBasePaths() override
static void GetScreenShot(HTTPRequest *pRequest)
static const QString PROCESS_ACTION
Main header for keybinding classes.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static void FormatErrorResponse(HTTPRequest *pRequest, UPnPResultCode eCode, const QString &sMsg="")
QStringMap m_mapRespHeaders
static MythFEXMLMethod GetMethod(const QString &sURI)
void RegisterService(UPnpDevice *device)
Creates a UPnpService and adds it to the UPnpDevice's list of services.
QStringList GetBasePaths() override
QString m_sServiceDescFileName
void RemoteScreenShot(QString Filename, int Width, int Height)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
@ UPnPResult_InvalidAction
static void GetActionListTest(HTTPRequest *pRequest)
static const QString HIDDEN_IFRAME
QString GetValue(const QString &setting)
void FormatFileResponse(const QString &sFileName)
HttpResponseType m_eResponseType
static QHash< QString, QStringList > gActionDescriptions
MythMainWindow * GetMythMainWindow(void)
MythFEXML(UPnpDevice *pDevice, const QString &sSharePath)
static QString BUTTON(const char *action, const char *desc)
static void InitialiseActions(void)
static void GetRemote(HTTPRequest *pRequest)
@ MFEXML_GetServiceDescription
QString GetSetting(const QString &key, const QString &defaultval="")