Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1029)

Side by Side Diff: views/controls/progress_bar.h

Issue 8687031: views: Move the remaining files to ui/views/controls/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/native_control_win.cc ('k') | views/controls/progress_bar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 VIEWS_CONTROLS_PROGRESS_BAR_H_
6 #define VIEWS_CONTROLS_PROGRESS_BAR_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "views/view.h"
12
13 namespace views {
14
15 // Progress bar is a control that indicates progress visually.
16 class VIEWS_EXPORT ProgressBar : public View {
17 public:
18 // The value range defaults to [0.0, 1.0].
19 ProgressBar();
20 virtual ~ProgressBar();
21
22 double current_value() const { return current_value_; }
23
24 // Sets the inclusive range of values to be displayed. Values outside of the
25 // range will be capped when displayed.
26 void SetDisplayRange(double min_display_value, double max_display_value);
27
28 // Sets the current value. Values outside of the range [min_display_value_,
29 // max_display_value_] will be stored unmodified and capped for display.
30 void SetValue(double value);
31
32 // Sets the tooltip text. Default behavior for a progress bar is to show no
33 // tooltip on mouse hover. Calling this lets you set a custom tooltip. To
34 // revert to default behavior, call this with an empty string.
35 void SetTooltipText(const string16& tooltip_text);
36
37 // Overridden from View:
38 virtual bool GetTooltipText(const gfx::Point& p,
39 string16* tooltip) const OVERRIDE;
40 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
41
42 private:
43 static const char kViewClassName[];
44
45 // Overridden from View:
46 virtual gfx::Size GetPreferredSize() OVERRIDE;
47 virtual std::string GetClassName() const OVERRIDE;
48 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
49
50 // Inclusive range used when displaying values.
51 double min_display_value_;
52 double max_display_value_;
53
54 // Current value. May be outside of [min_display_value_, max_display_value_].
55 double current_value_;
56
57 // Tooltip text.
58 string16 tooltip_text_;
59
60 DISALLOW_COPY_AND_ASSIGN(ProgressBar);
61 };
62
63 } // namespace views
64
65 #endif // VIEWS_CONTROLS_PROGRESS_BAR_H_
OLDNEW
« no previous file with comments | « views/controls/native_control_win.cc ('k') | views/controls/progress_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698