"Fossies" - the Fresh Open Source Software Archive

Member "tdesktop-4.8.3/Telegram/SourceFiles/ui/search_field_controller.h" (1 Jun 2023, 1127 Bytes) of package /linux/misc/tdesktop-4.8.3.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 "search_field_controller.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 <rpl/variable.h>
   11 #include "ui/rp_widget.h"
   12 #include "base/unique_qptr.h"
   13 
   14 namespace style {
   15 struct SearchFieldRow;
   16 struct InputField;
   17 } // namespace style
   18 
   19 namespace Ui {
   20 
   21 class CrossButton;
   22 class InputField;
   23 
   24 class SearchFieldController {
   25 public:
   26     SearchFieldController(const QString &query);
   27 
   28     base::unique_qptr<Ui::InputField> createField(
   29         QWidget *parent,
   30         const style::InputField &st);
   31     struct RowView {
   32         base::unique_qptr<Ui::RpWidget> wrap;
   33         QPointer<Ui::InputField> field;
   34     };
   35     RowView createRowView(
   36         QWidget *parent,
   37         const style::SearchFieldRow &st);
   38 
   39     QString query() const;
   40     rpl::producer<QString> queryValue() const;
   41     rpl::producer<QString> queryChanges() const;
   42 
   43     rpl::lifetime &lifetime() {
   44         return _lifetime;
   45     }
   46 
   47 private:
   48     base::unique_qptr<QWidget> _view;
   49     rpl::variable<QString> _query;
   50 
   51     rpl::lifetime _lifetime;
   52 
   53 };
   54 
   55 } // namespace Ui