3 * Copyright (c) 2011, Blue Static <http://www.bluestatic.org>
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 #import <Cocoa/Cocoa.h>
19 // A VariableNode represents a property in the variable list display. It
20 // converts XML response nodes to this format and extracts all the necessary
21 // information. The fields of this class are defined by the spec:
22 // http://www.xdebug.org/docs-dbgp.php#properties-variables-and-values
23 @interface VariableNode
: NSObject
30 NSMutableArray
* children_
;
31 NSInteger childCount_
;
35 @
property (readonly
, copy
) NSString
* name
;
36 @
property (readonly
, copy
) NSString
* fullName
;
37 @
property (readonly
, copy
) NSString
* className
;
38 @
property (readonly
, copy
) NSString
* type
;
39 @
property (readonly
, copy
) NSString
* value
;
40 @
property (readonly
, retain
) NSArray
* children
;
41 @
property (readonly
) NSInteger childCount
;
42 @
property (readonly
, copy
) NSString
* address
;
44 // Creates and initializes a new VariableNode from the XML response from the
46 - (id
)initWithXMLNode
:(NSXMLElement
*)node
;
48 // When properties are asynchrnously loaded, this method can be used to set
49 // the children on a node from the list of children from the XML response.
50 - (void)setChildrenFromXMLChildren
:(NSArray
*)children
;
52 // Returns the children and requests any unloaded ones.
53 - (NSArray
*)dynamicChildren
;
55 // Whether or not this is a leaf node (i.e. does not have child properties).
58 // Returns a formatted type and classname display.
59 - (NSString
*)displayType
;