| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 UI_VIEWS_NATIVE_THEME_DELEGATE_H_ | 5 #ifndef UI_VIEWS_NATIVE_THEME_DELEGATE_H_ |
| 6 #define UI_VIEWS_NATIVE_THEME_DELEGATE_H_ | 6 #define UI_VIEWS_NATIVE_THEME_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/base/native_theme/native_theme.h" | 9 #include "ui/gfx/native_theme.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/views/views_export.h" | 11 #include "ui/views/views_export.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 // A delagate that supports animating transtions between different native | 15 // A delagate that supports animating transtions between different native |
| 16 // theme states. This delegate can be used to control a native theme Border | 16 // theme states. This delegate can be used to control a native theme Border |
| 17 // or Painter object. | 17 // or Painter object. |
| 18 // | 18 // |
| 19 // If animation is onging, the native theme border or painter will | 19 // If animation is onging, the native theme border or painter will |
| 20 // composite the foreground state over the backgroud state using an alpha | 20 // composite the foreground state over the backgroud state using an alpha |
| 21 // between 0 and 255 based on the current value of the animation. | 21 // between 0 and 255 based on the current value of the animation. |
| 22 class VIEWS_EXPORT NativeThemeDelegate { | 22 class VIEWS_EXPORT NativeThemeDelegate { |
| 23 public: | 23 public: |
| 24 virtual ~NativeThemeDelegate() {} | 24 virtual ~NativeThemeDelegate() {} |
| 25 | 25 |
| 26 // Get the native theme part that should be drawn. | 26 // Get the native theme part that should be drawn. |
| 27 virtual ui::NativeTheme::Part GetThemePart() const = 0; | 27 virtual gfx::NativeTheme::Part GetThemePart() const = 0; |
| 28 | 28 |
| 29 // Get the rectangle that should be painted. | 29 // Get the rectangle that should be painted. |
| 30 virtual gfx::Rect GetThemePaintRect() const = 0; | 30 virtual gfx::Rect GetThemePaintRect() const = 0; |
| 31 | 31 |
| 32 // Get the state of the part, along with any extra data needed for drawing. | 32 // Get the state of the part, along with any extra data needed for drawing. |
| 33 virtual ui::NativeTheme::State GetThemeState( | 33 virtual gfx::NativeTheme::State GetThemeState( |
| 34 ui::NativeTheme::ExtraParams* params) const = 0; | 34 gfx::NativeTheme::ExtraParams* params) const = 0; |
| 35 | 35 |
| 36 // If the native theme drawign should be animated, return the Animation object | 36 // If the native theme drawign should be animated, return the Animation object |
| 37 // that controlls it. If no animation is ongoing, NULL may be returned. | 37 // that controlls it. If no animation is ongoing, NULL may be returned. |
| 38 virtual const ui::Animation* GetThemeAnimation() const = 0; | 38 virtual const ui::Animation* GetThemeAnimation() const = 0; |
| 39 | 39 |
| 40 // If animation is onging, this returns the background native theme state. | 40 // If animation is onging, this returns the background native theme state. |
| 41 virtual ui::NativeTheme::State GetBackgroundThemeState( | 41 virtual gfx::NativeTheme::State GetBackgroundThemeState( |
| 42 ui::NativeTheme::ExtraParams* params) const = 0; | 42 gfx::NativeTheme::ExtraParams* params) const = 0; |
| 43 | 43 |
| 44 // If animation is onging, this returns the foreground native theme state. | 44 // If animation is onging, this returns the foreground native theme state. |
| 45 // This state will be composited over the background using an alpha value | 45 // This state will be composited over the background using an alpha value |
| 46 // based on the current value of the animation. | 46 // based on the current value of the animation. |
| 47 virtual ui::NativeTheme::State GetForegroundThemeState( | 47 virtual gfx::NativeTheme::State GetForegroundThemeState( |
| 48 ui::NativeTheme::ExtraParams* params) const = 0; | 48 gfx::NativeTheme::ExtraParams* params) const = 0; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace views | 51 } // namespace views |
| 52 | 52 |
| 53 #endif // UI_VIEWS_NATIVE_THEME_DELEGATE_H_ | 53 #endif // UI_VIEWS_NATIVE_THEME_DELEGATE_H_ |
| OLD | NEW |