Moved structures of compose controls to separated header.
This commit is contained in:
parent
f7c6876e1b
commit
6d775d6f45
|
@ -474,6 +474,7 @@ PRIVATE
|
||||||
history/admin_log/history_admin_log_section.h
|
history/admin_log/history_admin_log_section.h
|
||||||
# history/feed/history_feed_section.cpp
|
# history/feed/history_feed_section.cpp
|
||||||
# history/feed/history_feed_section.h
|
# history/feed/history_feed_section.h
|
||||||
|
history/view/controls/compose_controls_common.h
|
||||||
history/view/controls/history_view_compose_controls.cpp
|
history/view/controls/history_view_compose_controls.cpp
|
||||||
history/view/controls/history_view_compose_controls.h
|
history/view/controls/history_view_compose_controls.h
|
||||||
history/view/media/history_view_call.h
|
history/view/media/history_view_call.h
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
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
|
||||||
|
|
||||||
|
namespace Api {
|
||||||
|
enum class SendProgressType;
|
||||||
|
struct SendOptions;
|
||||||
|
} // namespace Api
|
||||||
|
|
||||||
|
class History;
|
||||||
|
|
||||||
|
namespace HistoryView::Controls {
|
||||||
|
|
||||||
|
struct MessageToEdit {
|
||||||
|
FullMsgId fullId;
|
||||||
|
Api::SendOptions options;
|
||||||
|
TextWithTags textWithTags;
|
||||||
|
};
|
||||||
|
struct VoiceToSend {
|
||||||
|
QByteArray bytes;
|
||||||
|
VoiceWaveform waveform;
|
||||||
|
int duration = 0;
|
||||||
|
};
|
||||||
|
struct SendActionUpdate {
|
||||||
|
Api::SendProgressType type = Api::SendProgressType();
|
||||||
|
int progress = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SetHistoryArgs {
|
||||||
|
required<History*> history;
|
||||||
|
Fn<bool()> showSlowmodeError;
|
||||||
|
rpl::producer<int> slowmodeSecondsLeft;
|
||||||
|
rpl::producer<bool> sendDisabledBySlowmode;
|
||||||
|
rpl::producer<std::optional<QString>> writeRestriction;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace HistoryView::Controls
|
|
@ -56,6 +56,7 @@ using PhotoChosen = ComposeControls::PhotoChosen;
|
||||||
using MessageToEdit = ComposeControls::MessageToEdit;
|
using MessageToEdit = ComposeControls::MessageToEdit;
|
||||||
using VoiceToSend = ComposeControls::VoiceToSend;
|
using VoiceToSend = ComposeControls::VoiceToSend;
|
||||||
using SendActionUpdate = ComposeControls::SendActionUpdate;
|
using SendActionUpdate = ComposeControls::SendActionUpdate;
|
||||||
|
using SetHistoryArgs = ComposeControls::SetHistoryArgs;
|
||||||
|
|
||||||
[[nodiscard]] auto ShowWebPagePreview(WebPageData *page) {
|
[[nodiscard]] auto ShowWebPagePreview(WebPageData *page) {
|
||||||
return page && (page->pendingTill >= 0);
|
return page && (page->pendingTill >= 0);
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/required.h"
|
#include "base/required.h"
|
||||||
#include "api/api_common.h"
|
#include "api/api_common.h"
|
||||||
#include "base/unique_qptr.h"
|
#include "base/unique_qptr.h"
|
||||||
|
#include "history/view/controls/compose_controls_common.h"
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
#include "ui/effects/animations.h"
|
#include "ui/effects/animations.h"
|
||||||
#include "ui/widgets/input_fields.h"
|
#include "ui/widgets/input_fields.h"
|
||||||
|
@ -61,26 +62,17 @@ class ComposeControls final {
|
||||||
public:
|
public:
|
||||||
using FileChosen = ChatHelpers::TabbedSelector::FileChosen;
|
using FileChosen = ChatHelpers::TabbedSelector::FileChosen;
|
||||||
using PhotoChosen = ChatHelpers::TabbedSelector::PhotoChosen;
|
using PhotoChosen = ChatHelpers::TabbedSelector::PhotoChosen;
|
||||||
|
|
||||||
|
using MessageToEdit = Controls::MessageToEdit;
|
||||||
|
using VoiceToSend = Controls::VoiceToSend;
|
||||||
|
using SendActionUpdate = Controls::SendActionUpdate;
|
||||||
|
using SetHistoryArgs = Controls::SetHistoryArgs;
|
||||||
|
|
||||||
enum class Mode {
|
enum class Mode {
|
||||||
Normal,
|
Normal,
|
||||||
Scheduled,
|
Scheduled,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MessageToEdit {
|
|
||||||
FullMsgId fullId;
|
|
||||||
Api::SendOptions options;
|
|
||||||
TextWithTags textWithTags;
|
|
||||||
};
|
|
||||||
struct VoiceToSend {
|
|
||||||
QByteArray bytes;
|
|
||||||
VoiceWaveform waveform;
|
|
||||||
int duration = 0;
|
|
||||||
};
|
|
||||||
struct SendActionUpdate {
|
|
||||||
Api::SendProgressType type = Api::SendProgressType();
|
|
||||||
int progress = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
ComposeControls(
|
ComposeControls(
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
not_null<Window::SessionController*> window,
|
not_null<Window::SessionController*> window,
|
||||||
|
@ -88,14 +80,6 @@ public:
|
||||||
~ComposeControls();
|
~ComposeControls();
|
||||||
|
|
||||||
[[nodiscard]] Main::Session &session() const;
|
[[nodiscard]] Main::Session &session() const;
|
||||||
|
|
||||||
struct SetHistoryArgs {
|
|
||||||
required<History*> history;
|
|
||||||
Fn<bool()> showSlowmodeError;
|
|
||||||
rpl::producer<int> slowmodeSecondsLeft;
|
|
||||||
rpl::producer<bool> sendDisabledBySlowmode;
|
|
||||||
rpl::producer<std::optional<QString>> writeRestriction;
|
|
||||||
};
|
|
||||||
void setHistory(SetHistoryArgs &&args);
|
void setHistory(SetHistoryArgs &&args);
|
||||||
void finishAnimating();
|
void finishAnimating();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue