OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_PROTOCOL_H_ | |
6 #define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_PROTOCOL_H_ | |
7 | |
8 #import <CoreGraphics/CoreGraphics.h> | |
9 #import <Foundation/Foundation.h> | |
10 | |
11 @class UIImage; | |
12 | |
13 // Interface for setting up the infobar's widgets. | |
14 @protocol InfoBarViewProtocol | |
15 // How much of infobar is visible. The infobar is only partly visible during | |
16 // showing/hiding animation. | |
17 @property(nonatomic, assign) CGFloat visibleHeight; | |
18 // Label text with links initialized with |stringAsLink:|. | |
19 @property(nonatomic, readonly) NSString* markedLabel; | |
20 | |
21 // Stops propagating events to delegate. | |
22 - (void)resetDelegate; | |
23 | |
24 // TODO(jif): rename methods from add* to set*. crbug.com/302582 | |
25 // Adds a dismiss button subview. | |
26 - (void)addCloseButtonWithTag:(NSInteger)tag | |
27 target:(id)target | |
28 action:(SEL)action; | |
29 | |
30 // Adds icon subview. | |
31 - (void)addLeftIcon:(UIImage*)image; | |
32 | |
33 // Adds transparent icon of size |imageSize| as placeholder during the time when | |
34 // the icon is being downloaded. | |
35 - (void)addPlaceholderTransparentIcon:(CGSize const&)imageSize; | |
36 | |
37 // Adds an icon subview with rounded corners and a shadow. | |
38 - (void)addLeftIconWithRoundedCornersAndShadow:(UIImage*)image; | |
39 | |
40 // Creates a new string from |string| that is interpreted as a link by | |
41 // |addLabel:|. |tag| must not be 0. | |
42 + (NSString*)stringAsLink:(NSString*)string tag:(NSUInteger)tag; | |
43 | |
44 // Adds a message to the infobar that optionaly contains links initialized with | |
45 // |stringAsLink:|. | |
46 - (void)addLabel:(NSString*)label; | |
47 | |
48 // Adds a message to the infobar that optionaly contains links initialized with | |
49 // |stringAsLink:|. |action| is called on |target| when a link is clicked. | |
50 - (void)addLabel:(NSString*)label target:(id)target action:(SEL)action; | |
51 | |
52 // Adds two buttons to the infobar. Button1 is the primary action of the infobar | |
53 // and in Material Design mode is shown with bold colors to reflect this role. | |
54 - (void)addButton1:(NSString*)title1 | |
55 tag1:(NSInteger)tag1 | |
56 button2:(NSString*)title2 | |
57 tag2:(NSInteger)tag2 | |
58 target:(id)target | |
59 action:(SEL)action; | |
60 | |
61 // Adds a button to the infobar. | |
62 - (void)addButton:(NSString*)title | |
63 tag:(NSInteger)tag | |
64 target:(id)target | |
65 action:(SEL)action; | |
66 | |
67 // Adds to the infobar a switch and an adjacent label. | |
68 - (void)addSwitchWithLabel:(NSString*)label | |
69 isOn:(BOOL)isOn | |
70 tag:(NSInteger)tag | |
71 target:(id)target | |
72 action:(SEL)action; | |
73 | |
74 @end | |
75 | |
76 #endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_PROTOCOL_H_ | |
OLD | NEW |