summaryrefslogtreecommitdiff
path: root/EventDispatcher.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-01-04 14:50:19 +0100
committerThomas Preud'homme <robotux@celest.fr>2013-01-04 14:50:19 +0100
commit8f9f382e1c97cab2e72e97495650c73ac4b97314 (patch)
tree78510a0d81368c09b56f444fb19bb132c8bc3009 /EventDispatcher.h
Imported Upstream version 0.3.0.5
Diffstat (limited to 'EventDispatcher.h')
-rw-r--r--EventDispatcher.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/EventDispatcher.h b/EventDispatcher.h
new file mode 100644
index 0000000..6f583bb
--- /dev/null
+++ b/EventDispatcher.h
@@ -0,0 +1,87 @@
+/** \file EventDispatcher.h
+\brief Define the class of the event dispatcher
+\author alpha_one_x86
+\version 0.3
+\date 2010
+\licence GPL3, see the file COPYING */
+
+#ifndef EVENT_DISPATCHER_H
+#define EVENT_DISPATCHER_H
+
+#include <QObject>
+#include <QStringList>
+#include <QString>
+#include <QTimer>
+#include <QList>
+#include <QUrl>
+
+#include "Environment.h"
+#include "Core.h"
+#include "GlobalClass.h"
+#include "SystrayIcon.h"
+#include "OptionEngine.h"
+#include "HelpDialog.h"
+#include "SessionLoader.h"
+#include "CopyListener.h"
+#include "OptionDialog.h"
+#include "CopyEngineManager.h"
+#include "LocalListener.h"
+#include "CliParser.h"
+
+/** \brief Define the class of the event dispatcher
+
+This class provide a core for dispatch the event of signal/slot, it checks too if not other instance is running */
+class EventDispatcher : public QObject, public GlobalClass
+{
+ Q_OBJECT
+ public:
+ /// \brief Initiate the ultracopier event dispatcher and check if no other session is running
+ EventDispatcher();
+ /// \brief Destroy the ultracopier event dispatcher
+ ~EventDispatcher();
+ /// \brief return if need be close
+ bool shouldBeClosed();
+ public slots:
+ /// \brief Quit ultracopier
+ void quit();
+ signals:
+ /** \brief Send that's caught state have changed for CatchedState::Uncatched or CatchedState::Semicatched or CatchedState::Catched
+ \see CatchState
+ \see tryCatchCopy()
+ \see tryUncatchCopy()
+ \param State is the new state */
+ void catchCopyStateChanged(CatchState state);
+ /** \brief Send that's copy/move task is finished in returning the copyMoveEventId
+ \see routeCopyMoveEvent()
+ \param copyMoveEventId The task id generated by routeCopyMoveEvent() */
+ void copyMoveEventIsFinish(int copyMoveEventId);
+ private:
+ /// \brief To have counter for increment the copyMoveEventId at each request
+ int copyMoveEventIdIndex;
+ /// \brief To store windows windows session
+ struct CoreSession
+ {
+ Core * CoreWindow;
+ QList<int> copyMoveEventIdManaged;
+ };
+ /// \brief the systray icon
+ SystrayIcon *backgroundIcon;
+ /// \brief To lunch event only when the event loop is setup
+ QTimer lunchInitFunction;
+ /// \brief the help dialog
+ HelpDialog theHelp;
+ /// \brief the session loader
+ SessionLoader *sessionloader;
+ bool stopIt;
+ CopyListener copyServer;
+ Core *core;
+ OptionDialog optionDialog;
+ CopyEngineManager *copyEngineList;
+ LocalListener localListener;
+ CliParser cliParser;
+ private slots:
+ /// \brief Called when event loop is setup
+ void initFunction();
+};
+
+#endif // EVENT_DISPATCHER_H