11/*
22 Copyright 2017 Vector Creations Ltd
3+ Copyright 2019 New Vector Ltd
34
45 Licensed under the Apache License, Version 2.0 (the "License");
56 you may not use this file except in compliance with the License.
2021
2122#import " Widget.h"
2223
24+ @class WidgetManagerConfig;
25+
2326/* *
2427 The type of matrix event used for matrix widgets.
2528 */
@@ -51,7 +54,9 @@ FOUNDATION_EXPORT NSString *const WidgetManagerErrorDomain;
5154typedef enum : NSUInteger
5255{
5356 WidgetManagerErrorCodeNotEnoughPower,
54- WidgetManagerErrorCodeCreationFailed
57+ WidgetManagerErrorCodeCreationFailed,
58+ WidgetManagerErrorCodeNoIntegrationsServerConfigured,
59+ WidgetManagerErrorCodeFailedToConnectToIntegrationsServer
5560}
5661WidgetManagerErrorCode;
5762
@@ -180,6 +185,30 @@ WidgetManagerErrorCode;
180185
181186#pragma mark - Modular interface
182187
188+ /* *
189+ Get the integration manager configuration for a user.
190+
191+ @param userId the user id.
192+ @return the integration manager configuration.
193+ */
194+ - (WidgetManagerConfig*)configForUser : (NSString *)userId ;
195+
196+ /* *
197+ Store the integration manager configuration for a user.
198+
199+ @param the integration manager configuration.
200+ @param userId the user id.
201+ */
202+ - (void )setConfig : (WidgetManagerConfig*)config forUser : (NSString *)userId ;
203+
204+ /* *
205+ Check if the user has URLs for an integration manager configured.
206+
207+ @param userId the user id.
208+ @return YES if they have URLs for an integration manager.
209+ */
210+ - (BOOL )hasIntegrationManagerForUser : (NSString *)userId ;
211+
183212/* *
184213 Make sure there is a scalar token for the given Matrix session.
185214
@@ -201,8 +230,9 @@ WidgetManagerErrorCode;
201230 Returns true if specified url is a scalar URL, typically https://scalar.vector.im/api
202231
203232 @param urlString the URL to check.
233+ @param userId the user id.
204234 @return YES if specified URL is a scalar URL.
205235 */
206- + (BOOL )isScalarUrl : (NSString *)urlString ;
236+ - (BOOL )isScalarUrl : (NSString *)urlString forUser : ( NSString *) userId ;
207237
208238@end
0 commit comments