diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-12 18:29:39 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-13 19:19:52 (GMT) |
commit | ef1052bbdb315aaa1c6254098ea05638d9a25b2f (patch) | |
tree | 482277f649f6c0fc00027514ea8986861fe33437 /SwifTools/Notifier/LoggingNotifier.h | |
parent | 3ae8cccfe9c6bfed5dda5f024a5cb046ccfc9793 (diff) | |
download | swift-contrib-ef1052bbdb315aaa1c6254098ea05638d9a25b2f.zip swift-contrib-ef1052bbdb315aaa1c6254098ea05638d9a25b2f.tar.bz2 |
Added presence notifier.
Diffstat (limited to 'SwifTools/Notifier/LoggingNotifier.h')
-rw-r--r-- | SwifTools/Notifier/LoggingNotifier.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/SwifTools/Notifier/LoggingNotifier.h b/SwifTools/Notifier/LoggingNotifier.h new file mode 100644 index 0000000..93349d9 --- /dev/null +++ b/SwifTools/Notifier/LoggingNotifier.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include "SwifTools/Notifier/Notifier.h" +#include "Swiften/Base/ByteArray.h" + +namespace Swift { + class LoggingNotifier : public Notifier { + public: + virtual void showMessage(Type type, const String& subject, const String& description, const ByteArray& picture, boost::function<void()> callback) { + notifications.push_back(Notification(type, subject, description, picture, callback)); + } + + struct Notification { + Notification(Type type, const String& subject, const String& description, const ByteArray& picture, boost::function<void()> callback) : type(type), subject(subject), description(description), picture(picture), callback(callback) {} + Type type; + String subject; + String description; + ByteArray picture; + boost::function<void()> callback; + }; + + std::vector<Notification> notifications; + }; +} |