-
Notifications
You must be signed in to change notification settings - Fork 0
/
ITAddressBookMgr.h
92 lines (78 loc) · 3.15 KB
/
ITAddressBookMgr.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
** ITAddressBookMgr.h
**
** Copyright (c) 2002, 2003
**
** Author: Fabian, Ujwal S. Setlur
**
** Project: iTerm
**
** Description: keeps track of the address book data.
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#import <Foundation/Foundation.h>
#define KEY_CHILDREN @"Children"
#define KEY_NAME @"Name"
#define KEY_DESCRIPTION @"Description"
#define KEY_COMMAND @"Command"
#define KEY_WORKING_DIRECTORY @"Working Directory"
#define KEY_TERMINAL_PROFILE @"Terminal Profile"
#define KEY_KEYBOARD_PROFILE @"Keyboard Profile"
#define KEY_DISPLAY_PROFILE @"Display Profile"
#define KEY_SHORTCUT @"Shortcut"
#define KEY_DEFAULT_BOOKMARK @"Default Bookmark"
#define KEY_BONJOUR_GROUP @"Bonjour Group"
#define KEY_BONJOUR_SERVICE @"Bonjour Service"
#define KEY_BONJOUR_SERVICE_ADDRESS @"Bonjour Service Address"
@class TreeNode;
@interface ITAddressBookMgr : NSObject
{
TreeNode *bookmarks;
NSNetServiceBrowser *sshBonjourBrowser;
NSNetServiceBrowser *ftpBonjourBrowser;
NSNetServiceBrowser *telnetBonjourBrowser;
TreeNode *bonjourGroup;
NSMutableArray *bonjourServices;
}
+ (id)sharedInstance;
- (void) setBookmarks: (NSDictionary *) aDict;
- (NSDictionary *) bookmarks;
- (void) locateBonjourServices;
- (void) migrateOldBookmarks;
// Model for NSOutlineView tree structure
- (id) child:(int)index ofItem:(id)item;
- (BOOL) isExpandable:(id)item;
- (int) numberOfChildrenOfItem:(id)item;
- (id) objectForKey: (id) key inItem: (id) item;
- (void) setObjectValue: (id) object forKey: (id) key inItem: (id) item;
- (void) addFolder: (NSString *) folderName toNode: (TreeNode *) aNode;
- (void) addBookmarkWithData: (NSDictionary *) data toNode: (TreeNode *) aNode;
- (void) setBookmarkWithData: (NSDictionary *) data forNode: (TreeNode *) aNode;
- (void) deleteBookmarkNode: (TreeNode *) aNode;
- (BOOL) mayDeleteBookmarkNode: (TreeNode *) aNode;
- (TreeNode *) rootNode;
- (TreeNode *) defaultBookmark;
- (void) setDefaultBookmark: (TreeNode *) aNode;
- (NSDictionary *) defaultBookmarkData;
- (NSDictionary *) dataForBookmarkWithName: (NSString *) bookmarkName;
- (int) indexForBookmark: (NSDictionary *)bookmark;
- (NSDictionary *) bookmarkForIndex: (int)index;
@end
@interface ITAddressBookMgr (Private)
- (BOOL) _checkForDefaultBookmark: (TreeNode *) rootNode defaultBookmark: (TreeNode **)defaultBookmark;
- (TreeNode *) _getBookmarkNodeWithName: (NSString *) aName searchFromNode: (TreeNode *) aNode;
- (TreeNode *) _getBonjourServiceTypeNode: (NSString *) aType;
@end