• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 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 CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_STATE_H_
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_STATE_H_
7 #pragma once
8 
9 #import <Cocoa/Cocoa.h>
10 
11 namespace bookmarks {
12 
13 // States for the bookmark bar.
14 enum VisualState {
15   kInvalidState  = 0,
16   kHiddenState   = 1,
17   kShowingState  = 2,
18   kDetachedState = 3,
19 };
20 
21 }  // namespace bookmarks
22 
23 // The interface for controllers (etc.) which can give information about the
24 // bookmark bar's state.
25 @protocol BookmarkBarState
26 
27 // Returns YES if the bookmark bar is currently visible (as a normal toolbar or
28 // as a detached bar on the NTP), NO otherwise.
29 - (BOOL)isVisible;
30 
31 // Returns YES if an animation is currently running, NO otherwise.
32 - (BOOL)isAnimationRunning;
33 
34 // Returns YES if the bookmark bar is in the given state and not in an
35 // animation, NO otherwise.
36 - (BOOL)isInState:(bookmarks::VisualState)state;
37 
38 // Returns YES if the bookmark bar is animating from the given state (to any
39 // other state), NO otherwise.
40 - (BOOL)isAnimatingToState:(bookmarks::VisualState)state;
41 
42 // Returns YES if the bookmark bar is animating to the given state (from any
43 // other state), NO otherwise.
44 - (BOOL)isAnimatingFromState:(bookmarks::VisualState)state;
45 
46 // Returns YES if the bookmark bar is animating from the first given state to
47 // the second given state, NO otherwise.
48 - (BOOL)isAnimatingFromState:(bookmarks::VisualState)fromState
49                      toState:(bookmarks::VisualState)toState;
50 
51 // Returns YES if the bookmark bar is animating between the two given states (in
52 // either direction), NO otherwise.
53 - (BOOL)isAnimatingBetweenState:(bookmarks::VisualState)fromState
54                        andState:(bookmarks::VisualState)toState;
55 
56 // Returns how morphed into the detached bubble the bookmark bar should be (1 =
57 // completely detached, 0 = normal).
58 - (CGFloat)detachedMorphProgress;
59 
60 @end
61 
62 #endif  // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_STATE_H_
63