1 | //
|
---|
2 | // CTBadge.h
|
---|
3 | // CTWidgets
|
---|
4 | //
|
---|
5 | // Created by Chad Weider on 2/14/07.
|
---|
6 | // Copyright (c) 2007 Chad Weider.
|
---|
7 | // Some rights reserved: <http://creativecommons.org/licenses/by/2.5/>
|
---|
8 | //
|
---|
9 | // Version: 1.5
|
---|
10 |
|
---|
11 | #import <Cocoa/Cocoa.h>
|
---|
12 | #import "CTGradient.h"
|
---|
13 |
|
---|
14 | extern const float CTLargeBadgeSize;
|
---|
15 | extern const float CTSmallBadgeSize;
|
---|
16 | extern const float CTLargeLabelSize;
|
---|
17 | extern const float CTSmallLabelSize;
|
---|
18 |
|
---|
19 | @interface CTBadge : NSObject
|
---|
20 | {
|
---|
21 | NSColor *badgeColor;
|
---|
22 | NSColor *labelColor;
|
---|
23 | }
|
---|
24 |
|
---|
25 | + (CTBadge *)systemBadge; //Classic white on red badge
|
---|
26 | + (CTBadge *)badgeWithColor:(NSColor *)badgeColor labelColor:(NSColor *)labelColor; //Badge of any color scheme
|
---|
27 |
|
---|
28 | - (NSImage *)smallBadgeForValue:(unsigned)value; //Image to use during drag operations
|
---|
29 | - (NSImage *)smallBadgeForString:(NSString *)string;
|
---|
30 | - (NSImage *)largeBadgeForValue:(unsigned)value; //For dock icons, etc
|
---|
31 | - (NSImage *)largeBadgeForString:(NSString *)string;
|
---|
32 | - (NSImage *)badgeOfSize:(float)size forValue:(unsigned)value; //A badge of arbitrary size,
|
---|
33 | - (NSImage *)badgeOfSize:(float)size forString:(NSString *)string; // <size> is the size in pixels of the badge
|
---|
34 | // not counting the shadow effect
|
---|
35 | // (image returned will be larger than <size>)
|
---|
36 |
|
---|
37 | - (NSImage *)badgeOverlayImageForValue:(unsigned)value insetX:(float)dx y:(float)dy; //Returns a transparent 128x128 image
|
---|
38 | - (NSImage *)badgeOverlayImageForString:(NSString *)string insetX:(float)dx y:(float)dy; // with Large badge inset dx/dy from the upper right
|
---|
39 | - (void)badgeApplicationDockIconWithValue:(unsigned)value insetX:(float)dx y:(float)dy; //Badges the Application's icon with <value>
|
---|
40 | - (void)badgeApplicationDockIconWithString:(NSString *)string insetX:(float)dx y:(float)dy; // and puts it on the dock
|
---|
41 |
|
---|
42 | - (void)setBadgeColor:(NSColor *)theColor; //Sets the color used on badge
|
---|
43 | - (void)setLabelColor:(NSColor *)theColor; //Sets the color of the label
|
---|
44 |
|
---|
45 | - (NSColor *)badgeColor; //Color currently being used on the badge
|
---|
46 | - (NSColor *)labelColor; //Color currently being used on the label
|
---|
47 |
|
---|
48 | @end
|
---|