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.
5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_
8 #import <Foundation/Foundation.h>
11 class InfoBarViewDelegate
;
14 // Interface for setting up the infobar's widgets.
15 @protocol InfoBarViewProtocol
16 // How much of infobar is visible. The infobar is only partly visible during
17 // showing/hiding animation.
18 @
property(nonatomic
, assign
) CGFloat visibleHeight
;
20 // Stops propagating events to delegate.
21 - (void)resetDelegate
;
23 // TODO(jif): rename methods from add* to set*. crbug.com/302582
24 // Adds a dismiss button subview.
25 - (void)addCloseButtonWithTag
:(NSInteger
)tag
30 - (void)addLeftIcon
:(UIImage
*)image
;
32 // Adds transparent icon of size |imageSize| as placeholder during the time when
33 // the icon is being downloaded.
34 - (void)addPlaceholderTransparentIcon
:(CGSize
const&)imageSize
;
36 // Adds an icon subview with rounded corners and a shadow.
37 - (void)addLeftIconWithRoundedCornersAndShadow
:(UIImage
*)image
;
39 // Creates a new string from |string| that is interpreted as a link by
40 // |addLabel:|. |tag| must not be 0.
41 + (NSString
*)stringAsLink
:(NSString
*)string tag
:(NSUInteger
)tag
;
43 // Adds a message to the infobar that optionaly contains links initialized with
45 - (void)addLabel
:(NSString
*)label
;
47 // Adds a message to the infobar that optionaly contains links initialized with
48 // |stringAsLink:|. |action| is called on |target| when a link is clicked.
49 - (void)addLabel
:(NSString
*)label target
:(id
)target action
:(SEL
)action
;
51 // Adds two buttons to the infobar. Button1 is the primary action of the infobar
52 // and in Material Design mode is shown with bold colors to reflect this role.
53 - (void)addButton1
:(NSString
*)title1
55 button2
:(NSString
*)title2
60 // Adds a button to the infobar.
61 - (void)addButton
:(NSString
*)title
66 // Adds to the infobar a switch and an adjacent label.
67 - (void)addSwitchWithLabel
:(NSString
*)label
75 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_