| OLD | NEW |
| (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_NATIVE_THEME_DELEGATE_H_ | |
| 6 #define VIEWS_NATIVE_THEME_DELEGATE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/gfx/native_theme.h" | |
| 10 #include "ui/gfx/rect.h" | |
| 11 #include "views/views_export.h" | |
| 12 | |
| 13 namespace views { | |
| 14 | |
| 15 // A delagate that supports animating transtions between different native | |
| 16 // theme states. This delegate can be used to control a native theme Border | |
| 17 // or Painter object. | |
| 18 // | |
| 19 // If animation is onging, the native theme border or painter will | |
| 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. | |
| 22 class VIEWS_EXPORT NativeThemeDelegate { | |
| 23 public: | |
| 24 virtual ~NativeThemeDelegate() {} | |
| 25 | |
| 26 // Get the native theme part that should be drawn. | |
| 27 virtual gfx::NativeTheme::Part GetThemePart() const = 0; | |
| 28 | |
| 29 // Get the rectangle that should be painted. | |
| 30 virtual gfx::Rect GetThemePaintRect() const = 0; | |
| 31 | |
| 32 // Get the state of the part, along with any extra data needed for drawing. | |
| 33 virtual gfx::NativeTheme::State GetThemeState( | |
| 34 gfx::NativeTheme::ExtraParams* params) const = 0; | |
| 35 | |
| 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. | |
| 38 virtual const ui::Animation* GetThemeAnimation() const = 0; | |
| 39 | |
| 40 // If animation is onging, this returns the background native theme state. | |
| 41 virtual gfx::NativeTheme::State GetBackgroundThemeState( | |
| 42 gfx::NativeTheme::ExtraParams* params) const = 0; | |
| 43 | |
| 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 | |
| 46 // based on the current value of the animation. | |
| 47 virtual gfx::NativeTheme::State GetForegroundThemeState( | |
| 48 gfx::NativeTheme::ExtraParams* params) const = 0; | |
| 49 }; | |
| 50 | |
| 51 } // namespace views | |
| 52 | |
| 53 #endif // VIEWS_NATIVE_THEME_DELEGATE_H_ | |
| OLD | NEW |