OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ |
6 #define IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ | 6 #define IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ |
7 | 7 |
8 #include <CoreGraphics/CoreGraphics.h> | 8 #include <CoreGraphics/CoreGraphics.h> |
9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
10 #import <UIKit/UIKit.h> | 10 #import <UIKit/UIKit.h> |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 NSDictionary* metrics, | 227 NSDictionary* metrics, |
228 NSLayoutFormatOptions options); | 228 NSLayoutFormatOptions options); |
229 // Deprecated version: | 229 // Deprecated version: |
230 void ApplyVisualConstraintsWithMetricsAndOptions( | 230 void ApplyVisualConstraintsWithMetricsAndOptions( |
231 NSArray* constraints, | 231 NSArray* constraints, |
232 NSDictionary* subviewsDictionary, | 232 NSDictionary* subviewsDictionary, |
233 NSDictionary* metrics, | 233 NSDictionary* metrics, |
234 NSLayoutFormatOptions options, | 234 NSLayoutFormatOptions options, |
235 UIView* unused_parentView); | 235 UIView* unused_parentView); |
236 | 236 |
| 237 // Returns constraints based on the visual constraints described with |
| 238 // |constraints| and |metrics| to views in |subviewsDictionary|. |
| 239 NSArray* VisualConstraintsWithMetrics(NSArray* constraints, |
| 240 NSDictionary* subviewsDictionary, |
| 241 NSDictionary* metrics); |
| 242 |
| 243 // Returns constraints based on the visual constraints described with |
| 244 // |constraints|, |metrics| and |options| to views in |subviewsDictionary|. |
| 245 NSArray* VisualConstraintsWithMetricsAndOptions( |
| 246 NSArray* constraints, |
| 247 NSDictionary* subviewsDictionary, |
| 248 NSDictionary* metrics, |
| 249 NSLayoutFormatOptions options); |
| 250 |
237 // Adds a constraint that |view1| and |view2| are center-aligned horizontally | 251 // Adds a constraint that |view1| and |view2| are center-aligned horizontally |
238 // and vertically. | 252 // and vertically. |
239 void AddSameCenterConstraints(UIView* view1, UIView* view2); | 253 void AddSameCenterConstraints(UIView* view1, UIView* view2); |
240 | 254 |
241 // Adds a constraint that |view1| and |view2| are center-aligned horizontally. | 255 // Adds a constraint that |view1| and |view2| are center-aligned horizontally. |
242 // |view1| and |view2| must be in the same view hierarchy. | 256 // |view1| and |view2| must be in the same view hierarchy. |
243 void AddSameCenterXConstraint(UIView* view1, UIView* view2); | 257 void AddSameCenterXConstraint(UIView* view1, UIView* view2); |
244 // Deprecated version: | 258 // Deprecated version: |
245 void AddSameCenterXConstraint(UIView* unused_parentView, | 259 void AddSameCenterXConstraint(UIView* unused_parentView, |
246 UIView* subview1, | 260 UIView* subview1, |
(...skipping 28 matching lines...) Expand all Loading... |
275 // Returns the current first responder. | 289 // Returns the current first responder. |
276 UIResponder* GetFirstResponder(); | 290 UIResponder* GetFirstResponder(); |
277 | 291 |
278 // On iOS10 and above, trigger a haptic vibration for various types of | 292 // On iOS10 and above, trigger a haptic vibration for various types of |
279 // actions. This is a no-op for devices that do not support haptic feedback. | 293 // actions. This is a no-op for devices that do not support haptic feedback. |
280 void TriggerHapticFeedbackForAction(); | 294 void TriggerHapticFeedbackForAction(); |
281 void TriggerHapticFeedbackForSelectionChange(); | 295 void TriggerHapticFeedbackForSelectionChange(); |
282 void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type); | 296 void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type); |
283 | 297 |
284 #endif // IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ | 298 #endif // IOS_CHROME_BROWSER_UI_UIKIT_UI_UTIL_H_ |
OLD | NEW |