2015-12-09 09:12:08 +00:00
|
|
|
/*
|
|
|
|
Copyright 2015 OpenMarket 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.
|
|
|
|
*/
|
|
|
|
|
2015-12-09 13:39:37 +00:00
|
|
|
#import <MatrixKit/MatrixKit.h>
|
|
|
|
|
2015-12-09 09:12:08 +00:00
|
|
|
#import "SegmentedViewController.h"
|
2016-06-21 19:47:20 +00:00
|
|
|
|
|
|
|
#import "ContactPickerViewController.h"
|
|
|
|
|
2016-04-15 07:43:56 +00:00
|
|
|
#import "RoomViewController.h"
|
2016-04-21 14:19:16 +00:00
|
|
|
#import "AuthenticationViewController.h"
|
2015-12-09 15:48:43 +00:00
|
|
|
|
2015-12-09 17:20:00 +00:00
|
|
|
/**
|
|
|
|
The `HomeViewController` screen is the main app screen.
|
|
|
|
*/
|
2016-06-21 19:47:20 +00:00
|
|
|
@interface HomeViewController : SegmentedViewController <MXKRecentListViewControllerDelegate, UISearchBarDelegate, UIGestureRecognizerDelegate, ContactPickerViewControllerDelegate>
|
2015-12-09 09:12:08 +00:00
|
|
|
|
|
|
|
@property (weak, nonatomic) IBOutlet UIBarButtonItem *settingsBarButtonItem;
|
|
|
|
@property (weak, nonatomic) IBOutlet UIBarButtonItem *searchBarButtonIem;
|
|
|
|
|
2015-12-09 15:48:43 +00:00
|
|
|
// References on the currently selected room and its view controller
|
|
|
|
@property (nonatomic, readonly) RoomViewController *currentRoomViewController;
|
|
|
|
@property (nonatomic, readonly) NSString *selectedRoomId;
|
2016-04-07 15:36:18 +00:00
|
|
|
@property (nonatomic, readonly) NSString *selectedEventId;
|
2015-12-09 15:48:43 +00:00
|
|
|
@property (nonatomic, readonly) MXSession *selectedRoomSession;
|
2016-04-15 07:43:56 +00:00
|
|
|
@property (nonatomic, readonly) RoomPreviewData *selectedRoomPreviewData;
|
2015-12-09 15:48:43 +00:00
|
|
|
|
2016-04-21 14:19:16 +00:00
|
|
|
// Reference to the current auth VC. It is not nil only when the auth screen is displayed.
|
|
|
|
@property (nonatomic, readonly) AuthenticationViewController *authViewController;
|
2016-04-05 13:31:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Display the authentication screen.
|
|
|
|
*/
|
|
|
|
- (void)showAuthenticationScreen;
|
|
|
|
|
2016-04-21 15:49:52 +00:00
|
|
|
/**
|
2016-04-22 16:42:14 +00:00
|
|
|
Display the authentication screen in order to pursue a registration process by using a predefined set
|
|
|
|
of parameters.
|
|
|
|
|
|
|
|
If the provided registration parameters are not supported, we switch back to the default login screen.
|
2016-04-21 15:49:52 +00:00
|
|
|
|
2016-04-22 16:42:14 +00:00
|
|
|
@param parameters the set of parameters.
|
2016-04-21 15:49:52 +00:00
|
|
|
*/
|
2016-04-22 16:42:14 +00:00
|
|
|
- (void)showAuthenticationScreenWithRegistrationParameters:(NSDictionary*)parameters;
|
2016-04-21 15:49:52 +00:00
|
|
|
|
2015-12-09 13:39:37 +00:00
|
|
|
/**
|
|
|
|
Open the room with the provided identifier in a specific matrix session.
|
|
|
|
|
|
|
|
@param roomId the room identifier.
|
2016-04-07 15:36:18 +00:00
|
|
|
@param eventId if not nil, the room will be opened on this event.
|
2015-12-09 13:39:37 +00:00
|
|
|
@param mxSession the matrix session in which the room should be available.
|
|
|
|
*/
|
2016-04-07 15:36:18 +00:00
|
|
|
- (void)selectRoomWithId:(NSString*)roomId andEventId:(NSString*)eventId inMatrixSession:(MXSession*)mxSession;
|
2015-12-09 13:39:37 +00:00
|
|
|
|
2016-04-15 07:43:56 +00:00
|
|
|
/**
|
|
|
|
Open the RoomViewController to 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.
|
|
|
|
*/
|
|
|
|
- (void)showRoomPreview:(RoomPreviewData*)roomPreviewData;
|
|
|
|
|
2015-12-09 13:39:37 +00:00
|
|
|
/**
|
|
|
|
Close the current selected room (if any)
|
|
|
|
*/
|
|
|
|
- (void)closeSelectedRoom;
|
|
|
|
|
2015-12-18 16:17:03 +00:00
|
|
|
/**
|
|
|
|
Open the public rooms directory page.
|
|
|
|
It uses the `publicRoomsDirectoryDataSource` managed by the recents view controller data source
|
|
|
|
*/
|
|
|
|
- (void)showPublicRoomsDirectory;
|
|
|
|
|
2015-12-09 09:12:08 +00:00
|
|
|
/**
|
|
|
|
Action registered on `UIControlEventTouchUpInside` event for both buttons.
|
|
|
|
*/
|
|
|
|
- (IBAction)onButtonPressed:(id)sender;
|
|
|
|
|
|
|
|
@end
|