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.
5 #ifndef VIEWS_NATIVE_THEME_DELEGATE_H_
6 #define VIEWS_NATIVE_THEME_DELEGATE_H_
9 #include "ui/gfx/native_theme.h"
10 #include "ui/gfx/rect.h"
14 // A delagate that supports animating transtions between different native
15 // theme states. This delegate can be used to control a native theme Border
18 // If animation is onging, the native theme border or painter will
19 // composite the foreground state over the backgroud state using an alpha
20 // between 0 and 255 based on the current value of the animation.
21 class NativeThemeDelegate
{
23 virtual ~NativeThemeDelegate() {}
25 // Get the native theme part that should be drawn.
26 virtual gfx::NativeTheme::Part
GetThemePart() const = 0;
28 // Get the rectangle that should be painted.
29 virtual gfx::Rect
GetThemePaintRect() const = 0;
31 // Get the state of the part, along with any extra data needed for drawing.
32 virtual gfx::NativeTheme::State
GetThemeState(
33 gfx::NativeTheme::ExtraParams
* params
) const = 0;
35 // If the native theme drawign should be animated, return the Animation object
36 // that controlls it. If no animation is ongoing, NULL may be returned.
37 virtual const ui::Animation
* GetThemeAnimation() const = 0;
39 // If animation is onging, this returns the background native theme state.
40 virtual gfx::NativeTheme::State
GetBackgroundThemeState(
41 gfx::NativeTheme::ExtraParams
* params
) const = 0;
43 // If animation is onging, this returns the foreground native theme state.
44 // This state will be composited over the background using an alpha value
45 // based on the current value of the animation.
46 virtual gfx::NativeTheme::State
GetForegroundThemeState(
47 gfx::NativeTheme::ExtraParams
* params
) const = 0;
52 #endif // VIEWS_NATIVE_THEME_DELEGATE_H_