File indexing completed on 2024-06-16 04:29:31
0001 /* 0002 SnoreNotify is a Notification Framework based on Qt 0003 Copyright (C) 2013-2015 Hannah von Reth <vonreth@kde.org> 0004 0005 SnoreNotify is free software: you can redistribute it and/or modify 0006 it under the terms of the GNU Lesser General Public License as published by 0007 the Free Software Foundation, either version 3 of the License, or 0008 (at your option) any later version. 0009 0010 SnoreNotify is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 GNU Lesser General Public License for more details. 0014 0015 You should have received a copy of the GNU Lesser General Public License 0016 along with SnoreNotify. If not, see <http://www.gnu.org/licenses/>. 0017 */ 0018 0019 #ifndef PARSER_H 0020 #define PARSER_H 0021 #include <QString> 0022 #include <QHash> 0023 #include "libsnore/notification/notification.h" 0024 #include <QSharedPointer> 0025 #include <QObject> 0026 0027 class Parser : public QObject 0028 { 0029 Q_OBJECT 0030 public: 0031 Parser(class SnarlNetworkFrontend *snarl); 0032 0033 void parse(Snore::Notification &sNotification, const QString &msg, class QTcpSocket *client); 0034 0035 private: 0036 class SnarlNetworkFrontend *snarl; 0037 0038 enum snpTypes { 0039 TYPE, 0040 APP, 0041 VERSION, 0042 ACTION, 0043 REGISTER, 0044 ADD_CLASS, 0045 NOTIFICATION, 0046 UNREGISTER, 0047 CLASS, 0048 TITLE, 0049 TEXT, 0050 ICON, 0051 TIMEOUT, 0052 ERROR 0053 0054 }; 0055 0056 QHash<QByteArray, Parser::snpTypes> getSnpType; 0057 0058 }; 0059 0060 #endif // PARSER_H