| OLD | NEW |
| 1 // Copyright (c) 2011 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 VIEWS_NATIVE_THEME_DELEGATE_H_ | 5 #ifndef VIEWS_NATIVE_THEME_DELEGATE_H_ |
| 6 #define VIEWS_NATIVE_THEME_DELEGATE_H_ | 6 #define VIEWS_NATIVE_THEME_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/gfx/native_theme.h" | 9 #include "ui/gfx/native_theme.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "views/views_api.h" | 11 #include "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_API 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 gfx::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. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 gfx::NativeTheme::State GetForegroundThemeState( | 47 virtual gfx::NativeTheme::State GetForegroundThemeState( |
| 48 gfx::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 // VIEWS_NATIVE_THEME_DELEGATE_H_ | 53 #endif // VIEWS_NATIVE_THEME_DELEGATE_H_ |
| OLD | NEW |