File indexing completed on 2024-05-12 05:46:30
0001 /* 0002 This file is part of Choqok, the KDE micro-blogging client* 0003 Copyright (C) 2011-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 0004 0005 This program is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU General Public License as 0007 published by the Free Software Foundation; either version 2 of 0008 the License or (at your option) version 3 or any later version 0009 accepted by the membership of KDE e.V. (or its successor approved 0010 by the membership of KDE e.V.), which shall act as a proxy 0011 defined in Section 14 of version 3 of the license. 0012 0013 This program is distributed in the hope that it will be useful, 0014 but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0016 GNU General Public License for more details. 0017 0018 You should have received a copy of the GNU General Public License along 0019 with this program; if not, write to the Free Software Foundation, Inc., 0020 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 0021 */ 0022 0023 #ifndef NOTIFICATION_H 0024 #define NOTIFICATION_H 0025 0026 #include "postwidget.h" 0027 0028 #include "mytextbrowser.h" 0029 0030 class Notification : public QWidget 0031 { 0032 Q_OBJECT 0033 public: 0034 Notification(Choqok::UI::PostWidget *post); 0035 virtual ~Notification(); 0036 void init(); 0037 0038 virtual QSize sizeHint() const override; 0039 0040 Q_SIGNALS: 0041 void ignored(); 0042 void postReaded(); 0043 void mouseEntered(); 0044 void mouseLeaved(); 0045 0046 protected Q_SLOTS: 0047 void slotProcessAnchor(const QUrl &url); 0048 void slotClicked(); 0049 0050 protected: 0051 virtual void mouseMoveEvent(QMouseEvent *) override; 0052 0053 private: 0054 void setDirection(); 0055 void setHeight(); 0056 static const QRegExp dirRegExp; 0057 Choqok::UI::PostWidget *post; 0058 QString dir; 0059 MyTextBrowser mainWidget; 0060 }; 0061 0062 #endif // NOTIFICATION_H