]> git.sesse.net Git - vlc/blob - modules/gui/macosx/SideBarItem.h
macosx: saved various objc selector dispatches when iterating, additionally fixes...
[vlc] / modules / gui / macosx / SideBarItem.h
1 //
2 //  SourceListItem.h
3 //  PXSourceList
4 //
5 //  Created by Alex Rozanski on 08/01/2010.
6 //  Copyright 2010 Alex Rozanski http://perspx.com
7 //
8 //  Adapted to VLC media player by Felix Paul Kühne
9 //
10
11 #import <Cocoa/Cocoa.h>
12
13 /*An example of a class that could be used to represent a Source List Item
14
15  Provides a title, an identifier, and an icon to be shown, as well as a badge value and a property to determine
16  whether the current item has a badge or not (`badgeValue` is set to -1 if no badge is shown)
17  
18  Used to form a hierarchical model of SourceListItem instances – similar to the Source List tree structure
19  and easily accessible by the data source with the "children" property
20  
21  SourceListItem *parent
22   - SourceListItem *child1;
23   - SourceListItem *child2;
24      - SourceListItem *childOfChild2;
25          - SourceListItem *anotherChildOfChild2;
26   - SourceListItem *child3;
27  
28  */
29
30 @interface SideBarItem : NSObject {
31         NSString *title;
32         NSString *identifier;
33         NSImage *icon;
34         NSInteger badgeValue;
35
36         NSArray *children;
37 }
38
39 @property (nonatomic, copy) NSString *title;
40 @property (nonatomic, copy) NSString *identifier;
41 @property (nonatomic, retain) NSImage *icon;
42 @property NSInteger badgeValue;
43
44 @property (nonatomic, copy) NSArray *children;
45
46 //Convenience methods
47 + (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier;
48 + (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier icon:(NSImage*)anIcon;
49
50
51 - (BOOL)hasBadge;
52 - (BOOL)hasChildren;
53 - (BOOL)hasIcon;
54
55 @end