/*
* Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef LOCAL_STREAMTUBE_INITIATOR_H
#define LOCAL_STREAMTUBE_INITIATOR_H

#include "ui_test-offer-local-streamtube.h"

#include "ontologies/personcontact.h"
//#include <TelepathyQt4/OutgoingStreamTubeChannel>

class QLocalServer;
class KJob;

namespace Test {

class OfferLocalStreamTube : public QDialog, Test::Ui::OfferLocalStreamTube
{
    Q_OBJECT

    public:
        OfferLocalStreamTube(QWidget* parent = 0);
        virtual ~OfferLocalStreamTube();

    private Q_SLOTS:
        void onRunPushButtonClicked();
        void onLocalServerNewConnection();
        void onDataFromSocket();
        void onInfoMessage(KJob* job, const QString &plain, const QString &rich);
        void onModeChanged(int mode);
        void handleResult(KJob* job);
    private:
        Nepomuk::PersonContact m_mePersonContact;
//        Tp::OutgoingStreamTubeChannelPtr m_outgoingStreamTubeChannel;
        QLocalServer* m_server;

        void syncCall(KJob* job);
        void asyncCall(KJob* job);

};

} // end namespace Test

#endif // LOCAL_STREAMTUBE_INITIATOR_H