1 /*
2    NSTreeController.h
3 
4    The tree controller class.
5 
6    Copyright (C) 2012 Free Software Foundation, Inc.
7 
8    Author:  Gregory Casamento <greg.casamento@gmail.com>
9    Date: 2012
10 
11    This file is part of the GNUstep GUI Library.
12 
13    This library is free software; you can redistribute it and/or
14    modify it under the terms of the GNU Lesser General Public
15    License as published by the Free Software Foundation; either
16    version 2 of the License, or (at your option) any later version.
17 
18    This library is distributed in the hope that it will be useful,
19    but WITHOUT ANY WARRANTY; without even the implied warranty of
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
21    Lesser General Public License for more details.
22 
23    You should have received a copy of the GNU Lesser General Public
24    License along with this library; see the file COPYING.LIB.
25    If not, see <http://www.gnu.org/licenses/> or write to the
26    Free Software Foundation, 51 Franklin Street, Fifth Floor,
27    Boston, MA 02110-1301, USA.
28 */
29 
30 #ifndef _GNUstep_H_NSTreeController
31 #define _GNUstep_H_NSTreeController
32 
33 #import <GNUstepBase/GSVersionMacros.h>
34 
35 #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
36 #import <AppKit/NSObjectController.h>
37 
38 @class NSString;
39 @class NSArray;
40 @class NSIndexPath;
41 @class NSTreeNode;
42 
43 @interface NSTreeController : NSObjectController <NSCoding, NSCopying>
44 {
45   NSString *_childrenKeyPath;
46   NSString *_countKeyPath;
47   NSString *_leafKeyPath;
48   NSArray *_sortDescriptors;
49   BOOL _alwaysUsesMultipleValuesMarker;
50   BOOL _avoidsEmptySelection;
51   BOOL _preservesSelection;
52   BOOL _selectsInsertedObjects;
53 }
54 
55 - (BOOL) addSelectionIndexPaths: (NSArray*)indexPaths;
56 - (BOOL) alwaysUsesMultipleValuesMarker;
57 - (BOOL) avoidsEmptySelection;
58 - (BOOL) canAddChid;
59 - (BOOL) canInsert;
60 - (BOOL) canInsertChild;
61 - (BOOL) preservesSelection;
62 - (BOOL) selectsInsertedObjects;
63 - (BOOL) setSelectionIndexPath: (NSIndexPath*)indexPath;
64 - (BOOL) setSelectionIndexPaths: (NSArray*)indexPaths;
65 - (id) arrangedObjects;
66 - (id) content;
67 - (NSArray*) selectedObjects;
68 - (NSIndexPath*) selectionIndexPath;
69 - (NSArray*) selectionIndexPaths;
70 - (NSArray*) sortDescriptors;
71 - (NSString*) childrenKeyPath;
72 - (NSString*) countKeyPath;
73 - (NSString*) leafKeyPath;
74 - (void) addChild: (id)sender;
75 - (void) add: (id)sender;
76 - (void) insertChild: (id)sender;
77 - (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath*)indexPath;
78 - (void) insertObjects: (NSArray*)objects atArrangedObjectIndexPaths: (NSArray*)indexPaths;
79 - (void) insert: (id)sender;
80 - (void) rearrangeObjects;
81 - (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath*)indexPath;
82 - (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray*)indexPaths;
83 - (void) removeSelectionIndexPaths: (NSArray*)indexPaths;
84 - (void) remove: (id)sender;
85 - (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag;
86 - (void) setAvoidsEmptySelection: (BOOL)flag;
87 - (void) setChildrenKeyPath: (NSString*)path;
88 - (void) setContent: (id)content;
89 - (void) setCountKeyPath: (NSString*)path;
90 - (void) setLeafPathKey: (NSString*)key;
91 - (void) setPreservesSelection: (BOOL)flag;
92 - (void) setSelectsInsertedObjects: (BOOL)flag;
93 - (void) setSortDescriptors: (NSArray*)descriptors;
94 
95 #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
96 - (NSString*) childrenKeyPathForNode: (NSTreeNode*)node;
97 - (NSString*) countKeyPathForNode: (NSTreeNode*)node;
98 - (NSString*) leafKeyPathForNode: (NSTreeNode*)node;
99 - (void) moveNode: (NSTreeNode*)node toIndexPath: (NSIndexPath*)indexPath;
100 - (void) moveNodes: (NSArray*)nodes toIndexPath: (NSIndexPath*)startingIndexPath;
101 - (NSArray*) selectedNodes;
102 #endif
103 @end
104 
105 #endif
106 #endif /* _GNUstep_H_NSTreeController */
107