File indexing completed on 2025-02-23 04:26:26

0001 /*
0002  * Copyright 2013 Robert Schroll <rschroll@gmail.com>
0003  * 
0004  * Permission is hereby granted, free of charge, to any person obtaining a copy
0005  * of this software and associated documentation files (the "Software"), to
0006  * deal in the Software without restriction, including without limitation the
0007  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
0008  * sell copies of the Software, and to permit persons to whom the Software is
0009  * furnished to do so, subject to the following conditions:
0010  * 
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  * 
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0020  * IN THE SOFTWARE. 
0021  */
0022 
0023 #include "httpserverplugin.h"
0024 #include "fileserver.h"
0025 #include "qhttpserver.h"
0026 #include "qhttprequest.h"
0027 #include "qhttpresponse.h"
0028 #include <qqml.h>
0029 
0030 void HttpServerPlugin::registerTypes(const char *uri)
0031 {
0032     qmlRegisterType<QHttpServer>(uri, 1, 0, "HttpServer");
0033     qmlRegisterType<FileServer>(uri, 1, 0, "FileServer");
0034     qmlRegisterUncreatableType<QHttpRequest>(uri, 1, 0, "HttpRequest", "Do not create HttpRequest directly");
0035     qmlRegisterUncreatableType<QHttpResponse>(uri, 1, 0, "HttpResponse", "Do not create HttpResponse directly");
0036 }