"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-2.6.1/Telegram/SourceFiles/info/settings/info_settings_widget.h" (24 Feb 2021, 1690 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 "info_settings_widget.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 "info/info_content_widget.h"
   11 #include "info/info_controller.h"
   12 
   13 namespace Settings {
   14 class Section;
   15 } // namespace Settings
   16 
   17 namespace Info {
   18 namespace Settings {
   19 
   20 using Type = Section::SettingsType;
   21 
   22 struct Tag;
   23 
   24 class Memento final : public ContentMemento {
   25 public:
   26     Memento(not_null<UserData*> self, Type type);
   27 
   28     object_ptr<ContentWidget> createWidget(
   29         QWidget *parent,
   30         not_null<Controller*> controller,
   31         const QRect &geometry) override;
   32 
   33     Section section() const override;
   34 
   35     Type type() const {
   36         return _type;
   37     }
   38 
   39     not_null<UserData*> self() const {
   40         return settingsSelf();
   41     }
   42 
   43     ~Memento();
   44 
   45 private:
   46     Type _type = Type();
   47 
   48 };
   49 
   50 class Widget final : public ContentWidget {
   51 public:
   52     Widget(
   53         QWidget *parent,
   54         not_null<Controller*> controller);
   55     ~Widget();
   56 
   57     not_null<UserData*> self() const;
   58 
   59     bool showInternal(
   60         not_null<ContentMemento*> memento) override;
   61 
   62     void setInternalState(
   63         const QRect &geometry,
   64         not_null<Memento*> memento);
   65 
   66     rpl::producer<bool> canSaveChanges() const override;
   67     void saveChanges(FnMut<void()> done) override;
   68 
   69     rpl::producer<bool> desiredShadowVisibility() const override;
   70 
   71 private:
   72     void saveState(not_null<Memento*> memento);
   73     void restoreState(not_null<Memento*> memento);
   74 
   75     std::shared_ptr<ContentMemento> doCreateMemento() override;
   76 
   77     not_null<UserData*> _self;
   78     Type _type = Type();
   79 
   80     not_null<::Settings::Section*> _inner;
   81 
   82 };
   83 
   84 } // namespace Settings
   85 } // namespace Info