SideBarItem.h 1.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
//
//  SourceListItem.h
//  PXSourceList
//
//  Created by Alex Rozanski on 08/01/2010.
//  Copyright 2010 Alex Rozanski http://perspx.com
//
//  Adapted to VLC media player by Felix Paul Kühne
//

#import <Cocoa/Cocoa.h>

/*An example of a class that could be used to represent a Source List Item
14

15 16
 Provides a title, an identifier, and an icon to be shown, as well as a badge value and a property to determine
 whether the current item has a badge or not (`badgeValue` is set to -1 if no badge is shown)
17

18 19
 Used to form a hierarchical model of SourceListItem instances – similar to the Source List tree structure
 and easily accessible by the data source with the "children" property
20

21 22 23 24
 SourceListItem *parent
  - SourceListItem *child1;
  - SourceListItem *child2;
     - SourceListItem *childOfChild2;
25 26

 - SourceListItem *anotherChildOfChild2;
27
  - SourceListItem *child3;
28

29 30
 */

31
@interface SideBarItem : NSObject
32 33 34

@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *identifier;
35
@property (nonatomic, copy) NSString *untranslatedTitle;
36 37
@property (nonatomic, retain) NSImage *icon;
@property NSInteger badgeValue;
38
@property NSInteger sdtype;
39 40 41 42 43 44 45 46 47 48 49 50 51

@property (nonatomic, copy) NSArray *children;

//Convenience methods
+ (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier;
+ (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier icon:(NSImage*)anIcon;


- (BOOL)hasBadge;
- (BOOL)hasChildren;
- (BOOL)hasIcon;

@end