skauth.h 2.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*  ____  _          _ _          __  __
 * / ___|| | ___   _| (_)_   _____\ \/ /
 * \___ \| |/ / | | | | \ \ / / _ \\  / 
 *  ___) |   <| |_| | | |\ V /  __//  \ Remote Telescopes
 * |____/|_|\_\\__, |_|_| \_/ \___/_/\_\ For the masses
 *             |___/               
 *
 * Copyright (C) 2013 Franco (nextime) Lanza <nextime@nexlab.it>
 * Copyright (C) 2013 Ivan Bellia <skylive@skylive.it>
 *
 * All rights reserved.
 *
 * This file is part of SkyliveX.
 *
 * SkyliveX 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 3 of the License, or
 * (at your option) any later version.
 *
 * Foobar 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 Foobar.  If not, see <http://www.gnu.org/licenses/>.
 *
 ********************************************************************
 *
 * File: 
 * 
 * Purpose:
 *
 */
35 36 37 38 39
#ifndef SKAUTH_H
#define SKAUTH_H

#define SENDER "skauth"

40
#include <QObject>
41 42
#include <QHash>
#include <QString>
43 44
#include <QtPlugin>
#include "pluginsinterfaces.h"
45
#include "ipcmsg.h"
46

47
class SkyliveAuth;
root's avatar
root committed
48
typedef void (SkyliveAuth::*SKHandlerFunction)(SKMessage);
49

50 51 52 53 54 55
class SkyliveAuth : public QObject, SkylivexPluginInterface
{
   Q_OBJECT
   Q_PLUGIN_METADATA(IID "com.skylivex.SkylivexPlugin/1.0" FILE "skauth.json")
   Q_INTERFACES(SkylivexPluginInterface)

56 57 58
   private:
      QHash<QString, SKHandlerFunction> _handlers;

59 60
   public:
      void startPlugin();
root's avatar
root committed
61
      void sendMessage(SKMessage msg);
62
      void registerHandler(QString type, SKHandlerFunction handler);
root's avatar
root committed
63
      void handle_getlogin(SKMessage msg);
64 65 66



67
   public slots:
root's avatar
root committed
68
      void receiveMessage(SKMessage msg);
69
      void pluginKicked();
70
   signals:
root's avatar
root committed
71
      void putMessage(SKMessage  msg);
72

73 74
};

75
#endif