element-ios/Riot/Modules/Room/RoomViewController.h

289 lines
9.9 KiB
C
Raw Normal View History

/*
Copyright 2014 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import "MatrixKit.h"
2016-02-10 09:59:48 +00:00
#import "RoomTitleView.h"
#import "RoomPreviewData.h"
2016-04-14 00:34:30 +00:00
#import "RoomParticipantsViewController.h"
#import "ContactsTableViewController.h"
#import "UIViewController+RiotSearch.h"
@class BadgeLabel;
@class UniversalLinkParameters;
@protocol RoomViewControllerDelegate;
@class RoomDisplayConfiguration;
NS_ASSUME_NONNULL_BEGIN
2021-01-21 11:27:32 +00:00
/**
Notification string used to indicate call tile tapped in a room. Notification object will be the `RoomBubbleCellData` object.
*/
2021-09-17 12:19:38 +00:00
extern NSNotificationName const RoomCallTileTappedNotification;
2021-01-21 11:27:32 +00:00
2021-03-17 16:41:31 +00:00
/**
Notification string used to indicate group call tile tapped in a room. Notification object will be the `RoomBubbleCellData` object.
*/
2021-09-17 12:19:38 +00:00
extern NSNotificationName const RoomGroupCallTileTappedNotification;
2021-03-17 16:41:31 +00:00
@interface RoomViewController : MXKRoomViewController
2016-02-10 09:59:48 +00:00
// The delegate for the view controller.
@property (weak, nonatomic, nullable) id<RoomViewControllerDelegate> delegate;
2016-04-14 00:34:30 +00:00
// The preview header
@property (weak, nonatomic, nullable) IBOutlet UIView *previewHeaderContainer;
@property (weak, nonatomic, nullable) IBOutlet NSLayoutConstraint *previewHeaderContainerHeightConstraint;
2016-04-14 00:34:30 +00:00
// The jump to last unread banner
@property (weak, nonatomic, nullable) IBOutlet UIView *jumpToLastUnreadBannerContainer;
@property (weak, nonatomic, nullable) IBOutlet UIView *jumpToLastUnreadBanner;
@property (weak, nonatomic, nullable) IBOutlet UIImageView *jumpToLastUnreadImageView;
@property (weak, nonatomic, nullable) IBOutlet UIButton *jumpToLastUnreadButton;
@property (weak, nonatomic, nullable) IBOutlet UILabel *jumpToLastUnreadLabel;
@property (weak, nonatomic, nullable) IBOutlet UIButton *resetReadMarkerButton;
@property (weak, nonatomic, nullable) IBOutlet UIView *inputBackgroundView;
@property (weak, nonatomic, nullable) IBOutlet UIButton *scrollToBottomButton;
@property (weak, nonatomic, nullable) IBOutlet BadgeLabel *scrollToBottomBadgeLabel;
// Remove Jitsi widget container
@property (weak, nonatomic, nullable) IBOutlet UIView *removeJitsiWidgetContainer;
/**
Preview data for a room invitation received by email, or a link to a room.
*/
@property (nonatomic, readonly, nullable) RoomPreviewData *roomPreviewData;
/**
Display configuration for the room view controller.
*/
@property (nonatomic, readonly) RoomDisplayConfiguration *displayConfiguration;
/**
Tell whether a badge must be added next to the chevron (back button) showing number of unread rooms.
YES by default.
*/
@property (nonatomic) BOOL showMissedDiscussionsBadge;
/**
ID of the parent space. `nil` for home space.
*/
@property (nonatomic, nullable) NSString *parentSpaceId;
2016-04-14 00:34:30 +00:00
/**
Display the preview of a room that is unknown for the user.
This room can come from an email invitation link or a simple link to a room.
@param roomPreviewData the data for the room preview.
2016-04-14 00:34:30 +00:00
*/
2021-09-17 12:19:38 +00:00
- (void)displayRoomPreview:(RoomPreviewData*)roomPreviewData;
/**
If `YES`, the room settings screen will be initially displayed. Default `NO`
*/
@property (nonatomic) BOOL showSettingsInitially;
/**
Action used to handle some buttons.
*/
- (IBAction)onButtonPressed:(id)sender;
- (IBAction)scrollToBottomAction:(id)sender;
/**
Highlights an event in the timeline. Does not reload room data source if the event is already loaded. Otherwise, loads a new data source around the given event.
@param eventId Identifier of the event to be highlighted.
@param completion Completion block to be called at the end of process. Optional.
*/
2022-01-25 20:59:19 +00:00
- (void)highlightAndDisplayEvent:(NSString *)eventId completion:(nullable void (^)(void))completion;
/**
Creates and returns a new `RoomViewController` object.
@param configuration display configuration for the room view controller.
@return An initialized `RoomViewController` object.
*/
+ (instancetype)instantiateWithConfiguration:(RoomDisplayConfiguration *)configuration;
@end
/**
`RoomViewController` delegate.
*/
@protocol RoomViewControllerDelegate <NSObject>
/**
Tells the delegate that the user wants to open the room details (members, files, settings).
@param roomViewController the `RoomViewController` instance.
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewControllerShowRoomDetails:(RoomViewController *)roomViewController;
/**
Tells the delegate that the user wants to display the details of a room member.
@param roomViewController the `RoomViewController` instance.
@param roomMember the selected member
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewController:(RoomViewController *)roomViewController
showMemberDetails:(MXRoomMember *)roomMember;
/**
Tells the delegate that the user wants to display another room.
@param roomViewController the `RoomViewController` instance.
@param roomID the selected roomId
2021-11-12 14:24:58 +00:00
@param eventID the selected eventId
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewController:(RoomViewController *)roomViewController
2021-11-12 14:24:58 +00:00
showRoomWithId:(NSString *)roomID
eventId:(nullable NSString *)eventID;
/**
Tells the delegate that the room has replaced by a room with a specific replacement room ID.
@param roomViewController the `RoomViewController` instance.
@param roomID the replacement roomId
*/
- (void)roomViewController:(RoomViewController *)roomViewController
didReplaceRoomWithReplacementId:(NSString *)roomID;
/**
Tells the delegate that the user wants to start a direct chat with a user.
@param roomViewController the `RoomViewController` instance.
@param userId the selected user id
@param completion Blocks called when the chat is created.
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewController:(RoomViewController *)roomViewController
startChatWithUserId:(NSString*)userId
completion:(void (^)(void))completion;
/**
Tells the delegate that the user wants to show complete security screen.
@param roomViewController the `RoomViewController` instance.
@param session The selected Matrix session.
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewController:(RoomViewController *)roomViewController showCompleteSecurityForSession:(MXSession*)session;
/**
Tells the delegate that the user left the room.
@param roomViewController the `RoomViewController` instance.
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewControllerDidLeaveRoom:(RoomViewController *)roomViewController;
/**
Tells the delegate that the user wants to cancel the room preview.
@param roomViewController the `RoomViewController` instance.
*/
2021-09-17 12:19:38 +00:00
- (void)roomViewControllerPreviewDidTapCancel:(RoomViewController *)roomViewController;
/**
Process universal link.
@param roomViewController the `RoomViewController` instance.
@param parameters the universal link parameters.
@return YES in case of processing success.
*/
2021-09-17 12:19:38 +00:00
- (BOOL)roomViewController:(RoomViewController *)roomViewController
handleUniversalLinkWithParameters:(UniversalLinkParameters*)parameters;
/**
Ask the coordinator to invoke the poll creation form coordinator.
@param roomViewController the `RoomViewController` instance.
*/
- (void)roomViewControllerDidRequestPollCreationFormPresentation:(RoomViewController *)roomViewController;
/**
Ask the coordinator to invoke the location sharing form coordinator.
@param roomViewController the `RoomViewController` instance.
*/
- (void)roomViewControllerDidRequestLocationSharingFormPresentation:(RoomViewController *)roomViewController;
/**
Ask the coordinator to invoke the location sharing form coordinator.
@param roomViewController the `RoomViewController` instance.
@param event the event containing location information
@param bubbleData the bubble data containing sender details
*/
- (void)roomViewController:(RoomViewController *)roomViewController
didRequestLocationPresentationForEvent:(MXEvent *)event
bubbleData:(id<MXKRoomBubbleCellDataStoring>)bubbleData;
- (nullable UIActivityViewController *)roomViewController:(RoomViewController *)roomViewController
locationShareActivityViewControllerForEvent:(MXEvent *)event;
- (BOOL)roomViewController:(RoomViewController *)roomViewController
canEndPollWithEventIdentifier:(NSString *)eventIdentifier;
- (void)roomViewController:(RoomViewController *)roomViewController
endPollWithEventIdentifier:(NSString *)eventIdentifier;
- (BOOL)roomViewController:(RoomViewController *)roomViewController
canEditPollWithEventIdentifier:(NSString *)eventIdentifier;
- (void)roomViewController:(RoomViewController *)roomViewController
didRequestEditForPollWithStartEvent:(MXEvent *)startEvent;
/**
Checks whether the delegate supports handling of activity indicators
Note: This is a transition API whilst `RoomViewController` contains legacy activity indicators
as well as using a newer user interaction presenters.
*/
- (BOOL)roomViewControllerCanDelegateUserIndicators:(RoomViewController *)roomViewController;
/**
2022-02-28 10:05:11 +00:00
Indicate to the delegate that loading should start
Note: Only called if the controller can delegate user indicators rather than managing
loading indicators internally
*/
- (void)roomViewControllerDidStartLoading:(RoomViewController *)roomViewController;
/**
Indicate to the delegate that loading should stop
Note: Only called if the controller can delegate user indicators rather than managing
loading indicators internally
*/
- (void)roomViewControllerDidStopLoading:(RoomViewController *)roomViewController;
2022-03-17 15:58:41 +00:00
/// User tap live location sharing stop action
- (void)roomViewControllerDidStopLiveLocationSharing:(RoomViewController *)roomViewController;
/// User tap live location sharing banner
- (void)roomViewControllerDidTapLiveLocationSharingBanner:(RoomViewController *)roomViewController;
@end
NS_ASSUME_NONNULL_END