summaryrefslogtreecommitdiffstats
path: root/Liaison/Group.h
blob: 2112bff69996ec3a39c96358c9919e457df91fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
//  Group.h
//  Liaison
//
//  Created by Brian Cully on Tue Feb 04 2003.
//  Copyright (c) 2003 Brian Cully. All rights reserved.
//

typedef enum _GroupType { LEAF, BRANCH } GroupType;

@interface Group : NSObject <NSCoding>
{
    NSString *name;
    GroupType type;
    NSImage *icon;
    NSMutableArray *children;
    Group *parent;

    LiFileStore *theFileStore;
}
+ (Group *)groupWithName: (NSString *)aName;
+ (Group *)groupWithName: (NSString *)aName andType: (GroupType)aType;
- (Group *)initWithName: (NSString *)aName;
- (Group *)initWithName: (NSString *)aName andType: (GroupType)aType;

- (id)initWithContentsOfFile: (NSString *)aFilename;
- (BOOL)writeToFile: (NSString *)aFilename;

- (LiFileStore *)fileStore;
- (void)setFileStore: (LiFileStore *)aFileStore;

- (NSString *)name;
- (GroupType)type;
- (void)setName: (NSString *)aName;
- (void)setType: (GroupType)aType;
- (NSImage *)icon;
- (void)setIcon: (NSImage *)anIcon;

- (Group *)parent;

- (int)numberOfChildren;
- (NSEnumerator *)childEnumerator;
- (BOOL)hasChild: (id)aChild;
- (void)addChild: (id)aChild;
- (void)removeChild: (id)aChild;
- (Group *)childNamed: (NSString *)aName;
- (void)removeChildNamed: (NSString *)aName;
- (id)childAtIndex: (int)index;
- (void)removeChildAtIndex: (int)index;
@property (retain) NSMutableArray *children;
@property (retain,getter=fileStore) LiFileStore *theFileStore;
@end