/*
* 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 TEST_OFFER_DBUSTUBE_H
#define TEST_OFFER_DBUSTUBE_H

#include "ui_test-offer-dbustube.h"

#include "ontologies/personcontact.h"
//#include <TelepathyQt4/OutgoingDBusTubeChannel>
#include <QDBusConnection>

class KJob;
class Example;

namespace Test {

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

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

    private Q_SLOTS:
        void onRunPushButtonClicked();
        void onInfoMessage(KJob* job, const QString &plain, const QString &rich);
        void onModeChanged(int mode);
        void handleResult(KJob* job);
    private:
        Nepomuk::PersonContact m_mePersonContact;
//        Tp::OutgoingDBusTubeChannelPtr m_outgoingDBusTubeChannel;
        QDBusConnection m_dbusConnection;
        Example* m_example;

        void syncCall(KJob* job);
        void asyncCall(KJob* job);
        bool registerExample();
};

} // end namespace Test

#endif // TEST_OFFER_DBUSTUBE_H
