1ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Use of this source code is governed by a BSD-style license that can be
3c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// found in the LICENSE file.
4c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
521d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen#ifndef CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen#define CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
73345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick#pragma once
8c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
9ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#include "base/memory/scoped_nsobject.h"
10c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
11c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#import <Cocoa/Cocoa.h>
12c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
13c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Draws a vertical background gradient with a bottom stroke. The gradient and
14c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// stroke colors can be defined by calling |setGradient| and |setStrokeColor|,
15c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// respectively. Alternatively, you may override the |gradient| and
16c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// |strokeColor| accessors in order to provide colors dynamically. If the
17c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// gradient or color is |nil|, the respective element will not be drawn.
18c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@interface VerticalGradientView : NSView {
19c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch @private
20c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The gradient to draw.
21c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<NSGradient> gradient_;
22c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Color for bottom stroke.
23c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<NSColor> strokeColor_;
24c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch}
25c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
26c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Gets and sets the gradient to paint as background.
27c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (NSGradient*)gradient;
28c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)setGradient:(NSGradient*)gradient;
29c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
30c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Gets and sets the color of the stroke drawn at the bottom of the view.
31c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (NSColor*)strokeColor;
32c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)setStrokeColor:(NSColor*)gradient;
33c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
34c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@end
35c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
3621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen#endif // CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
37