"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-2.6.1/Telegram/SourceFiles/window/window_history_hider.h" (24 Feb 2021, 1578 Bytes) of package /linux/misc/tdesktop-2.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "window_history_hider.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2 This file is part of Telegram Desktop,
    3 the official desktop application for the Telegram messaging service.
    4 
    5 For license and copyright information please follow this link:
    6 https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
    7 */
    8 #pragma once
    9 
   10 #include "ui/rp_widget.h"
   11 #include "ui/effects/animations.h"
   12 
   13 namespace Ui {
   14 class RoundButton;
   15 } // namespace Ui
   16 
   17 namespace Window {
   18 
   19 class HistoryHider : public Ui::RpWidget, private base::Subscriber {
   20 public:
   21     // Forward messages (via drag-n-drop)
   22     HistoryHider(QWidget *parent, MessageIdsList &&items);
   23 
   24     // Send path from command line argument.
   25     HistoryHider(QWidget *parent);
   26 
   27     // Share url.
   28     HistoryHider(QWidget *parent, const QString &url, const QString &text);
   29 
   30     // Inline switch button handler.
   31     HistoryHider(QWidget *parent, const QString &botAndQuery);
   32 
   33     HistoryHider(
   34         QWidget *parent,
   35         const QString &text,
   36         Fn<bool(PeerId)> confirm);
   37 
   38     void offerPeer(PeerId peer);
   39 
   40     void startHide();
   41     void confirm();
   42     rpl::producer<> confirmed() const;
   43     rpl::producer<> hidden() const;
   44 
   45     ~HistoryHider();
   46 
   47 protected:
   48     void paintEvent(QPaintEvent *e) override;
   49     void keyPressEvent(QKeyEvent *e) override;
   50     void mousePressEvent(QMouseEvent *e) override;
   51     void resizeEvent(QResizeEvent *e) override;
   52 
   53 private:
   54     void refreshLang();
   55     void updateControlsGeometry();
   56     void animationCallback();
   57 
   58     QString _text;
   59     Fn<bool(PeerId)> _confirm;
   60     Ui::Animations::Simple _a_opacity;
   61 
   62     QRect _box;
   63     bool _hiding = false;
   64 
   65     int _chooseWidth = 0;
   66 
   67     rpl::event_stream<> _confirmed;
   68     rpl::event_stream<> _hidden;
   69 
   70 };
   71 
   72 } // namespace Window