summaryrefslogtreecommitdiff
path: root/server/include
diff options
context:
space:
mode:
Diffstat (limited to 'server/include')
-rw-r--r--server/include/api_core.h5
-rw-r--r--server/include/api_core_events.h38
-rw-r--r--server/include/api_module_base.h2
-rw-r--r--server/include/api_module_downloader.h2
-rw-r--r--server/include/api_module_metadata_storage.h2
-rw-r--r--server/include/client.h2
-rw-r--r--server/include/config.h2
-rw-r--r--server/include/download_internal.h2
-rw-r--r--server/include/event_subscription_base.h2
-rw-r--r--server/include/event_subscription_event.h2
-rw-r--r--server/include/event_subscription_repeated.h2
-rw-r--r--server/include/main.h2
-rw-r--r--server/include/modules_handler.h2
-rw-r--r--server/include/protocol.h2
-rw-r--r--server/include/server.h2
-rw-r--r--server/include/server_session.h8
-rw-r--r--server/include/socket_wraper.h2
-rw-r--r--server/include/utilities.h2
18 files changed, 60 insertions, 21 deletions
diff --git a/server/include/api_core.h b/server/include/api_core.h
index adf0a70..33ed70f 100644
--- a/server/include/api_core.h
+++ b/server/include/api_core.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
@@ -26,10 +26,11 @@
#include <map>
#include "settings.h"
+#include "api_core_events.h"
class module_base;
-class core_api
+class core_api : public core_events::core_events
{
public:
//core
diff --git a/server/include/api_core_events.h b/server/include/api_core_events.h
new file mode 100644
index 0000000..e7e0dac
--- /dev/null
+++ b/server/include/api_core_events.h
@@ -0,0 +1,38 @@
+/*
+ Copyright © 2016 Gluzskiy Alexandr (sss)
+
+ This file is part of Unknown Download Manager (UDM).
+
+ UDM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ UDM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with UDM. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef API_CORE_EVENTS_H
+#define API_CORE_EVENTS_H
+
+namespace core_events
+{
+
+enum download_state {download_stopped, download_running, download_completed, download_error};
+
+class core_events
+{
+public:
+ virtual void download_state_changed(int download_id, download_state state);
+};
+
+};
+
+
+#endif
diff --git a/server/include/api_module_base.h b/server/include/api_module_base.h
index 9c1b639..42deee9 100644
--- a/server/include/api_module_base.h
+++ b/server/include/api_module_base.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/api_module_downloader.h b/server/include/api_module_downloader.h
index 6445772..703683e 100644
--- a/server/include/api_module_downloader.h
+++ b/server/include/api_module_downloader.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/api_module_metadata_storage.h b/server/include/api_module_metadata_storage.h
index adaa614..cbc1642 100644
--- a/server/include/api_module_metadata_storage.h
+++ b/server/include/api_module_metadata_storage.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/client.h b/server/include/client.h
index 22b2ce8..e755fac 100644
--- a/server/include/client.h
+++ b/server/include/client.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/config.h b/server/include/config.h
index 74112ad..58a8aae 100644
--- a/server/include/config.h
+++ b/server/include/config.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/download_internal.h b/server/include/download_internal.h
index 60d9608..92280a9 100644
--- a/server/include/download_internal.h
+++ b/server/include/download_internal.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/event_subscription_base.h b/server/include/event_subscription_base.h
index 4cae7e1..b181dfd 100644
--- a/server/include/event_subscription_base.h
+++ b/server/include/event_subscription_base.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/event_subscription_event.h b/server/include/event_subscription_event.h
index 16172cf..7d39183 100644
--- a/server/include/event_subscription_event.h
+++ b/server/include/event_subscription_event.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/event_subscription_repeated.h b/server/include/event_subscription_repeated.h
index 3b2936b..fc0d857 100644
--- a/server/include/event_subscription_repeated.h
+++ b/server/include/event_subscription_repeated.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/main.h b/server/include/main.h
index 4921e36..e5c88ed 100644
--- a/server/include/main.h
+++ b/server/include/main.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/modules_handler.h b/server/include/modules_handler.h
index 7c8bc71..bec2fe3 100644
--- a/server/include/modules_handler.h
+++ b/server/include/modules_handler.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/protocol.h b/server/include/protocol.h
index 7aa9c93..c6020a4 100644
--- a/server/include/protocol.h
+++ b/server/include/protocol.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/server.h b/server/include/server.h
index e8fb3ad..4a3b3fe 100644
--- a/server/include/server.h
+++ b/server/include/server.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/server_session.h b/server/include/server_session.h
index b03a38b..c0220f0 100644
--- a/server/include/server_session.h
+++ b/server/include/server_session.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
@@ -41,7 +41,8 @@ public:
std::map<int, download_internal_s>& downloads,
boost::asio::ssl::context* c = nullptr);
void run();
- void send_message(server_msg* msg);
+ void send_message(server_msg* msg); //TODO: thread safety
+ void fire_event(SUBSCRIPTION_TYPE type, server_msg &msg);
socket_wraper* socket();
virtual ~server_session();
@@ -53,10 +54,9 @@ private:
void handle_write(const boost::system::error_code& error);
void handle_write_no_read(const boost::system::error_code& error);
void handle_handshake(const boost::system::error_code& error);
- bool handle_command(client_msg* msg);
+ bool handle_command(client_msg* msg); //TODO: thread safety ?
void send_download_list();
- void fire_event(SUBSCRIPTION_TYPE type, server_msg &msg);
char* recv_data_ = nullptr;
socket_wraper* socket_ = nullptr;
diff --git a/server/include/socket_wraper.h b/server/include/socket_wraper.h
index 6e8dd76..8619580 100644
--- a/server/include/socket_wraper.h
+++ b/server/include/socket_wraper.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).
diff --git a/server/include/utilities.h b/server/include/utilities.h
index aa78d29..40eb38f 100644
--- a/server/include/utilities.h
+++ b/server/include/utilities.h
@@ -1,5 +1,5 @@
/*
- Copyright © 2015 Gluzskiy Alexandr (sss)
+ Copyright © 2015-2016 Gluzskiy Alexandr (sss)
This file is part of Unknown Download Manager (UDM).