2015-12-07 16:05:00 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
|
|
|
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class LayeredWidget;
|
|
|
|
|
|
|
|
namespace App {
|
|
|
|
|
|
|
|
void sendBotCommand(const QString &cmd, MsgId replyTo = 0);
|
2016-01-01 02:34:56 +08:00
|
|
|
bool insertBotCommand(const QString &cmd, bool specialGif = false);
|
2015-12-07 16:05:00 +03:00
|
|
|
void searchByHashtag(const QString &tag, PeerData *inPeer);
|
|
|
|
void openPeerByName(const QString &username, bool toProfile = false, const QString &startToken = QString());
|
|
|
|
void joinGroupByHash(const QString &hash);
|
|
|
|
void stickersBox(const QString &name);
|
|
|
|
void openLocalUrl(const QString &url);
|
|
|
|
bool forward(const PeerId &peer, ForwardWhatMessages what);
|
|
|
|
void removeDialog(History *history);
|
|
|
|
void showSettings();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2016-01-11 23:43:29 +08:00
|
|
|
namespace Ui {
|
2015-12-07 16:05:00 +03:00
|
|
|
|
|
|
|
void showStickerPreview(DocumentData *sticker);
|
|
|
|
void hideStickerPreview();
|
|
|
|
|
2015-12-07 21:09:05 +03:00
|
|
|
void showLayer(LayeredWidget *box, ShowLayerOptions options = CloseOtherLayers);
|
|
|
|
void hideLayer(bool fast = false);
|
|
|
|
bool isLayerShown();
|
2015-12-25 16:09:14 +03:00
|
|
|
bool isMediaViewShown();
|
2015-12-31 03:09:20 +08:00
|
|
|
bool isInlineItemBeingChosen();
|
2015-12-07 21:09:05 +03:00
|
|
|
|
2015-12-28 00:37:48 +03:00
|
|
|
void repaintHistoryItem(const HistoryItem *item);
|
2015-12-31 03:09:20 +08:00
|
|
|
void repaintInlineItem(const LayoutInlineItem *layout);
|
|
|
|
bool isInlineItemVisible(const LayoutInlineItem *reader);
|
2015-12-13 14:17:15 +03:00
|
|
|
|
2015-12-13 01:29:33 +03:00
|
|
|
void showPeerHistory(const PeerId &peer, MsgId msgId, bool back = false);
|
2015-12-13 14:36:08 +03:00
|
|
|
inline void showPeerHistory(const PeerData *peer, MsgId msgId, bool back = false) {
|
|
|
|
showPeerHistory(peer->id, msgId, back);
|
|
|
|
}
|
|
|
|
inline void showPeerHistory(const History *history, MsgId msgId, bool back = false) {
|
|
|
|
showPeerHistory(history->peer->id, msgId, back);
|
|
|
|
}
|
|
|
|
inline void showPeerHistoryAtItem(const HistoryItem *item) {
|
|
|
|
showPeerHistory(item->history()->peer->id, item->id);
|
|
|
|
}
|
2015-12-13 14:17:15 +03:00
|
|
|
void showPeerHistoryAsync(const PeerId &peer, MsgId msgId);
|
2015-12-13 14:36:08 +03:00
|
|
|
inline void showChatsList() {
|
|
|
|
showPeerHistory(PeerId(0), 0);
|
|
|
|
}
|
2015-12-13 01:29:33 +03:00
|
|
|
|
2015-12-07 16:05:00 +03:00
|
|
|
};
|
|
|
|
|
2015-12-28 00:37:48 +03:00
|
|
|
enum ClipStopperType {
|
|
|
|
ClipStopperMediaview,
|
|
|
|
ClipStopperSavedGifsPanel,
|
|
|
|
};
|
|
|
|
|
2015-12-07 16:05:00 +03:00
|
|
|
namespace Notify {
|
|
|
|
|
|
|
|
void userIsBotChanged(UserData *user);
|
2015-12-13 14:17:15 +03:00
|
|
|
void userIsContactChanged(UserData *user, bool fromThisApp = false);
|
2015-12-07 16:05:00 +03:00
|
|
|
void botCommandsChanged(UserData *user);
|
2015-12-22 11:01:02 +03:00
|
|
|
|
2016-01-01 17:58:05 +08:00
|
|
|
void inlineBotRequesting(bool requesting);
|
|
|
|
|
2015-12-07 16:05:00 +03:00
|
|
|
void migrateUpdated(PeerData *peer);
|
2015-12-22 11:01:02 +03:00
|
|
|
|
2015-12-28 00:37:48 +03:00
|
|
|
void clipStopperHidden(ClipStopperType type);
|
2015-12-25 16:09:14 +03:00
|
|
|
|
2015-12-22 11:01:02 +03:00
|
|
|
void historyItemResized(const HistoryItem *item, bool scrollToIt = false);
|
|
|
|
inline void historyItemsResized() {
|
|
|
|
historyItemResized(0);
|
|
|
|
}
|
2015-12-13 01:29:33 +03:00
|
|
|
void historyItemLayoutChanged(const HistoryItem *item);
|
2015-12-07 16:05:00 +03:00
|
|
|
|
2015-12-31 23:27:21 +08:00
|
|
|
void automaticLoadSettingsChangedGif();
|
|
|
|
|
2015-12-07 16:05:00 +03:00
|
|
|
};
|
2016-01-09 19:24:16 +08:00
|
|
|
|
|
|
|
namespace Global {
|
|
|
|
|
2016-01-11 23:43:29 +08:00
|
|
|
bool CheckBetaVersionDir();
|
|
|
|
void WorkingDirReady();
|
|
|
|
|
|
|
|
void start();
|
|
|
|
void finish();
|
2016-01-09 19:24:16 +08:00
|
|
|
|
|
|
|
#define DeclareGlobalReadOnly(Type, Name) const Type &Name();
|
|
|
|
#define DeclareGlobal(Type, Name) DeclareGlobalReadOnly(Type, Name) \
|
|
|
|
void Set##Name(const Type &Name); \
|
|
|
|
Type &Ref##Name();
|
|
|
|
|
2016-01-11 23:43:29 +08:00
|
|
|
DeclareGlobalReadOnly(QString, LangSystemISO);
|
|
|
|
DeclareGlobalReadOnly(int32, LangSystem);
|
2016-01-21 14:58:58 +08:00
|
|
|
DeclareGlobal(QByteArray, LastCrashDump);
|
2016-01-11 23:43:29 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Sandbox {
|
|
|
|
|
|
|
|
void start();
|
|
|
|
void finish();
|
|
|
|
|
|
|
|
#define DeclareSandboxReadOnly(Type, Name) const Type &Name();
|
|
|
|
#define DeclareSandbox(Type, Name) DeclareSandboxReadOnly(Type, Name) \
|
|
|
|
void Set##Name(const Type &Name); \
|
|
|
|
Type &Ref##Name();
|
|
|
|
|
|
|
|
DeclareSandboxReadOnly(uint64, LaunchId);
|
2016-01-09 19:24:16 +08:00
|
|
|
|
|
|
|
};
|