ServerThread.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* 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 SERVERTHREAD_H
#define SERVERTHREAD_H
#include <QThread>
#include <QMutex>
#include <SyncResults.h>
namespace Buteo {
class ServerPlugin;
class ServerThread : public QThread
{
Q_OBJECT
public:
ServerThread();
virtual ~ServerThread();
QString getProfileName() const;
ServerPlugin *getPlugin() const;
bool startThread( ServerPlugin *aServerPlugin);
void stopThread();
signals:
void initError(const QString &aProfileName, const QString &aMessage,
SyncResults::MinorCode aErrorCode);
protected:
virtual void run();
private:
ServerPlugin *iServerPlugin;
bool iRunning;
mutable QMutex iMutex;
#ifdef SYNCFW_UNIT_TESTS
friend class ServerThreadTest;
#endif
};
}
#endif // SERVERTHREAD_H
Buteo::ServerPlugin
Base class for server plugins.
Definition ServerPlugin.h:37
Buteo::ServerThread::getProfileName
QString getProfileName() const
Returns profile that this thread is running.
Definition ServerThread.cpp:44
Buteo::ServerThread::stopThread
void stopThread()
Stops server thread.
Definition ServerThread.cpp:90
Buteo::ServerThread::initError
void initError(const QString &aProfileName, const QString &aMessage, SyncResults::MinorCode aErrorCode)
Emitted when synchronization cannot be started due to an error in plugin initialization.
Buteo::ServerThread::startThread
bool startThread(ServerPlugin *aServerPlugin)
Starts server thread.
Definition ServerThread.cpp:63
Buteo::ServerThread::~ServerThread
virtual ~ServerThread()
Destructor.
Definition ServerThread.cpp:39
Buteo::ServerThread::run
virtual void run()
overriding method of QThread::run
Definition ServerThread.cpp:96
Buteo::ServerThread::ServerThread
ServerThread()
Constructor.
Definition ServerThread.cpp:32
Buteo::ServerThread::getPlugin
ServerPlugin * getPlugin() const
Returns plugin that this thread is running.
Definition ServerThread.cpp:56
Buteo::SyncResults::MinorCode
MinorCode
enum value
Definition SyncResults.h:93