Warning, file /network/falkon/src/lib/tabwidget/tabicon.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2014-2018 David Rosca <nowrep@gmail.com>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU 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 * This program 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 General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 * ============================================================ */
0018 #ifndef TABICON_H
0019 #define TABICON_H
0020 
0021 #include <QWidget>
0022 #include <QImage>
0023 
0024 #include "qzcommon.h"
0025 
0026 class QTimer;
0027 
0028 class WebTab;
0029 
0030 class FALKON_EXPORT TabIcon : public QWidget
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     struct Data {
0036         int framesCount;
0037         int animationInterval;
0038         QPixmap animationPixmap;
0039         QPixmap audioPlayingPixmap;
0040         QPixmap audioMutedPixmap;
0041     };
0042     explicit TabIcon(QWidget* parent = nullptr);
0043 
0044     void setWebTab(WebTab* tab);
0045     void updateIcon();
0046 
0047     static Data *data();
0048 
0049 Q_SIGNALS:
0050     void resized();
0051 
0052 private Q_SLOTS:
0053     void showLoadingAnimation();
0054     void hideLoadingAnimation();
0055 
0056     void updateAudioIcon(bool recentlyAudible);
0057     void updateAnimationFrame();
0058 
0059 private:
0060     void show();
0061     void hide();
0062     bool shouldBeVisible() const;
0063 
0064     bool event(QEvent *event) override;
0065     void paintEvent(QPaintEvent* event) override;
0066     void mousePressEvent(QMouseEvent* event) override;
0067 
0068     WebTab* m_tab;
0069     QTimer* m_updateTimer;
0070     QTimer* m_hideTimer;
0071     QPixmap m_sitePixmap;
0072     int m_currentFrame;
0073     bool m_animationRunning;
0074     bool m_audioIconDisplayed;
0075     QRect m_audioIconRect;
0076 };
0077 
0078 #endif // TABICON_H