defuze.me  Client
doorman.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 namespace Network {
00012     class Doorman;
00013 }
00014 
00015 #ifndef DOORMAN_HPP
00016 #define DOORMAN_HPP
00017 
00018 #include <QObject>
00019 #include <QTcpServer>
00020 #include <QTcpSocket>
00021 #include "remoteevent.hpp"
00022 #include "remotesock.hpp"
00023 #include "dbcore.hpp"
00024 #include "parameterizable.hpp"
00025 
00026 namespace Network
00027 {
00033     class Doorman : public Params::Parameterizable
00034     {
00035         Q_OBJECT
00036     public:
00037         Doorman(QTcpServer *rcServer);
00038         void                loadKnownDevices();
00039         void                storeKnownDevices();
00040 
00041     signals:
00042         void                authenticatedRemote(RemoteSock*);       
00043         void                needAuthorization(const RemoteEvent&);  
00044 
00045     public slots:
00046         void                newConnection();                        
00047         void                authentication(const RemoteEvent&);     
00048         void                answered(RemoteSock*, unsigned, bool, bool);    
00049 
00050     private:
00051         void                defineParams();                         
00052         QTcpServer          *rcServer;
00053         QVariantMap         knownDevices;
00054     };
00055 }
00056 
00057 #endif // DOORMAN_HPP