init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
93
Telegram/SourceFiles/passport/passport_panel_edit_contact.h
Normal file
93
Telegram/SourceFiles/passport/passport_panel_edit_contact.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/rp_widget.h"
|
||||
#include "base/object_ptr.h"
|
||||
|
||||
namespace Ui {
|
||||
class MaskedInputField;
|
||||
class PlainShadow;
|
||||
class RoundButton;
|
||||
class VerticalLayout;
|
||||
class BoxContent;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Passport {
|
||||
|
||||
class PanelController;
|
||||
|
||||
struct EditContactScheme {
|
||||
enum class ValueType {
|
||||
Phone,
|
||||
Text,
|
||||
};
|
||||
explicit EditContactScheme(ValueType type);
|
||||
|
||||
ValueType type;
|
||||
|
||||
QString aboutExisting;
|
||||
QString newHeader;
|
||||
rpl::producer<QString> newPlaceholder;
|
||||
QString aboutNew;
|
||||
Fn<bool(const QString &value)> validate;
|
||||
Fn<QString(const QString &value)> format;
|
||||
Fn<QString(const QString &value)> postprocess;
|
||||
|
||||
};
|
||||
|
||||
class PanelEditContact : public Ui::RpWidget {
|
||||
public:
|
||||
using Scheme = EditContactScheme;
|
||||
|
||||
PanelEditContact(
|
||||
QWidget *parent,
|
||||
not_null<PanelController*> controller,
|
||||
Scheme scheme,
|
||||
const QString &data,
|
||||
const QString &existing);
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *e) override;
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
|
||||
private:
|
||||
void setupControls(
|
||||
const QString &data,
|
||||
const QString &existing);
|
||||
void updateControlsGeometry();
|
||||
|
||||
void save();
|
||||
void save(const QString &value);
|
||||
|
||||
not_null<PanelController*> _controller;
|
||||
Scheme _scheme;
|
||||
|
||||
object_ptr<Ui::VerticalLayout> _content;
|
||||
QPointer<Ui::MaskedInputField> _field;
|
||||
object_ptr<Ui::PlainShadow> _bottomShadow;
|
||||
object_ptr<Ui::RoundButton> _done;
|
||||
|
||||
};
|
||||
|
||||
object_ptr<Ui::BoxContent> VerifyPhoneBox(
|
||||
const QString &phone,
|
||||
int codeLength,
|
||||
const QString &openUrl,
|
||||
Fn<void(QString code)> submit,
|
||||
rpl::producer<QString> call,
|
||||
rpl::producer<QString> error);
|
||||
object_ptr<Ui::BoxContent> VerifyEmailBox(
|
||||
const QString &email,
|
||||
int codeLength,
|
||||
Fn<void(QString code)> submit,
|
||||
Fn<void()> resend,
|
||||
rpl::producer<QString> error,
|
||||
rpl::producer<QString> resent);
|
||||
|
||||
} // namespace Passport
|
||||
Reference in New Issue
Block a user