// PithosNode.h
// pithos-macos
//
-// Created by Miltiadis Vasilakis on 01/08/11.
-// Copyright 2011 koomasi. All rights reserved.
+// Copyright 2011 GRNET S.A. All rights reserved.
//
+// Redistribution and use in source and binary forms, with or
+// without modification, are permitted provided that the following
+// conditions are met:
+//
+// 1. Redistributions of source code must retain the above
+// copyright notice, this list of conditions and the following
+// disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials
+// provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+// The views and conclusions contained in the software and
+// documentation are those of the authors and should not be
+// interpreted as representing official policies, either expressed
+// or implied, of GRNET S.A.
-#import <Foundation/Foundation.h>
+#define PithosNodeStateFresh 0
+#define PithosNodeStateRefreshNeeded 1
+#define PithosNodeStateRefreshing 2
+#define PithosNodeStateRefreshFinished 3
+@class PithosNodeInfoController;
+@class PithosAccount;
+@class ASIPithos;
+@class ASIPithosAccount;
+@class ASIPithosContainer;
+@class ASIPithosObject;
+@class ASIPithosRequest;
@interface PithosNode : NSObject {
-@private
+ NSInteger freshness;
+ BOOL forcedRefresh;
+ NSString *url;
+
+ PithosAccount *__unsafe_unretained pithosAccountManager;
+ PithosNode *__unsafe_unretained parent;
+ BOOL shared;
+ NSString *sharingAccount;
+ NSMutableArray *children;
+ NSMutableArray *newChildren;
+ NSString *childrenUpdatedNotificationName;
+ BOOL inheritChildrenUpdatedNotificationName;
+
+ NSString *displayName;
+ BOOL isLeafItem;
+
+ NSImage *icon;
+
+ PithosNodeInfoController *pithosNodeInfoController;
}
-@end
+@property(nonatomic, assign) BOOL forcedRefresh;
+
+@property(unsafe_unretained, nonatomic, readonly) NSString *url;
+
+@property(nonatomic, unsafe_unretained) PithosAccount *pithosAccountManager;
+@property(nonatomic, unsafe_unretained) PithosNode *parent;
+@property(nonatomic, assign) BOOL shared;
+@property(nonatomic, strong) NSString *sharingAccount;
+@property(unsafe_unretained, nonatomic, readonly) NSArray *children;
+@property(nonatomic, strong) NSString *childrenUpdatedNotificationName;
+@property(nonatomic, assign) BOOL inheritChildrenUpdatedNotificationName;
+
+@property(nonatomic, strong) NSString *displayName;
+@property(nonatomic, readonly) BOOL isLeafItem;
+
+@property(nonatomic, strong) NSImage *icon;
+
+@property(nonatomic, strong) ASIPithos *pithos;
+@property(nonatomic, strong) ASIPithosAccount *pithosAccount;
+@property(nonatomic, strong) ASIPithosContainer *pithosContainer;
+@property(nonatomic, strong) ASIPithosObject *pithosObject;
+
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager;
+
+- (void)invalidateChildren;
+- (void)invalidateChildrenRecursive;
+- (void)refresh;
+- (void)forceRefresh;
+
+- (void)postChildrenUpdatedNotificationName;
+
+- (void)showPithosNodeInfo:(id)sender;
+- (void)pithosNodeInfoWillClose:(id)sender;
+
+- (void)pithosNodeWillBeRemoved;
+
+- (void)performRequestFinishedDelegateInBackground:(ASIPithosRequest *)request;
+- (void)performRequestFailedDelegateInBackground:(ASIPithosRequest *)request;
+
+@end
\ No newline at end of file