2 /****************************************************************************
4 ** Copyright (C) Qxt Foundation. Some rights reserved.
6 ** This file is part of the QxtCore module of the Qt eXTension library
8 ** This library is free software; you can redistribute it and/or modify it
9 ** under the terms of th Common Public License, version 1.0, as published by
12 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
13 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
14 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
15 ** FITNESS FOR A PARTICULAR PURPOSE.
17 ** You should have received a copy of the CPL along with this file.
18 ** See the LICENSE file and the cpl1.0.txt file included with the source
19 ** distribution for more information. If you did not receive a copy of the
20 ** license, contact the Qxt Foundation.
22 ** <http://libqxt.sourceforge.net> <foundation@libqxt.org>
24 ****************************************************************************/
25 #ifndef QXTJOB_H_GUARD
26 #define QXTJOB_H_GUARD
32 #include <qxtglobal.h>
36 class QxtSignalWaiter;
38 class QXT_CORE_EXPORT QxtFuture: public QObject
42 QVariant delayedResult(int msec=-1);
43 QVariant joinedResult();
45 QxtFuture(const QxtFuture& other);
48 friend class QxtSlotJob;
49 QxtFuture(QxtSlotJob* j);
51 QxtSignalWaiter * waiter;
58 class QxtSlotJobPrivate;
60 class QXT_CORE_EXPORT QxtSlotJob : public QxtJob
64 static QxtFuture detach(QThread * o,QObject* recv, const char* slot,
65 QGenericArgument p1=QGenericArgument(),
66 QGenericArgument p2=QGenericArgument(),
67 QGenericArgument p3=QGenericArgument(),
68 QGenericArgument p4=QGenericArgument(),
69 QGenericArgument p5=QGenericArgument(),
70 QGenericArgument p6=QGenericArgument(),
71 QGenericArgument p7=QGenericArgument(),
72 QGenericArgument p8=QGenericArgument(),
73 QGenericArgument p9=QGenericArgument(),
74 QGenericArgument p10=QGenericArgument());
76 QxtSlotJob(QObject* recv, const char* slot,
77 QGenericArgument p1=QGenericArgument(),
78 QGenericArgument p2=QGenericArgument(),
79 QGenericArgument p3=QGenericArgument(),
80 QGenericArgument p4=QGenericArgument(),
81 QGenericArgument p5=QGenericArgument(),
82 QGenericArgument p6=QGenericArgument(),
83 QGenericArgument p7=QGenericArgument(),
84 QGenericArgument p8=QGenericArgument(),
85 QGenericArgument p9=QGenericArgument(),
86 QGenericArgument p10=QGenericArgument());
89 QxtFuture exec(QThread *o);
96 QXT_DECLARE_PRIVATE(QxtSlotJob);
97 ///must not be in pimpl. that's heavy doom when they are both Qobject and one moves to another thread