Qt Cryptographic Architecture: qca_safetimer.h Source File

Qt Cryptographic Architecture

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

qca_safetimer.h
1 /*
2 * qca_safetimer.h - Qt Cryptographic Architecture
3 * Copyright (C) 2014 Ivan Romanov <drizt@land.ru>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22 #ifndef QCA_SAFETIMER_H
23 #define QCA_SAFETIMER_H
24
25 #include "qca_export.h"
26 #include <QObject>
27
28 class QEvent;
29 class QTimerEvent;
30
31 namespace QCA {
32
33 class QCA_EXPORT SafeTimer : public QObject
34 {
35 Q_OBJECT
36 public:
37 SafeTimer(QObject *parent = 0);
38 ~SafeTimer();
39
40 int interval() const;
41 bool isActive() const;
42 bool isSingleShot() const;
43 void setInterval(int msec);
44 void setSingleShot(bool singleShot);
45 int timerId() const;
46
47 public slots:
48 void start(int msec);
49 void start();
50 void stop();
51
52 signals:
53 void timeout();
54
55 protected:
56 bool event(QEvent *event);
57 void timerEvent(QTimerEvent *event);
58
59 private:
60 // Functions is used internally. Outer world mustn't have access them.
61 void startTimer() {}
62 void killTimer(int) {}
63
64 class Private;
65 Private *d;
66 };
67
68 }
69
70 #endif // QCA_SAFETIMER_H
QObject
qca_export.h
Preprocessor magic to allow export of library symbols.
QCA::SafeTimer
Definition: qca_safetimer.h:33
QCA
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:45