// PithosBrowserController.h
// pithos-macos
//
-// Copyright 2011 GRNET S.A. All rights reserved.
+// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// or implied, of GRNET S.A.
#import <Cocoa/Cocoa.h>
+#import "PithosActivityFacility.h"
+@class ASIPithos;
+@class PithosAccount;
@class PithosNode;
@class PithosAccountNode;
@class PithosSharingAccountsNode;
@class PithosEmptyNode;
+@class PithosActivityFacility;
+@class ASINetworkQueue;
-@interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSMenuDelegate> {
+@interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, NSMenuDelegate, PithosActivityFacilityDelegate> {
+ BOOL browserInitialized;
+ BOOL browserActive;
+
+ ASIPithos *pithos;
+
+ PithosAccount *__unsafe_unretained pithosAccountManager;
PithosNode *rootNode;
PithosAccountNode *accountNode;
PithosEmptyNode *containersNode;
NSViewController *sharedPreviewController;
- NSMenu *browserMenu;
+ NSSplitView *__unsafe_unretained verticalSplitView;
+ NSSplitView *__unsafe_unretained horizontalSplitView;
+ NSView *__unsafe_unretained leftTopView;
+ NSView *__unsafe_unretained leftBottomView;
+ NSOutlineView *__unsafe_unretained outlineView;
+ NSBrowser *__unsafe_unretained browser;
+ NSMenu *__unsafe_unretained outlineViewMenu;
+ NSMenu *__unsafe_unretained browserMenu;
- NSSplitView *verticalSplitView;
- NSSplitView *horizontalSplitView;
- NSView *leftTopView;
- NSView *leftBottomView;
- NSOutlineView *outlineView;
- NSBrowser *browser;
+ BOOL editingItem;
NSArray *draggedNodes;
PithosNode *draggedParentNode;
NSArray *clipboardNodes;
PithosNode *clipboardParentNode;
BOOL clipboardCopy;
+
+ NSTextField *__unsafe_unretained activityTextField;
+ NSProgressIndicator *__unsafe_unretained activityProgressIndicator;
+ PithosActivityFacility *activityFacility;
+
+ NSTimer *refreshTimer;
+
+ ASINetworkQueue *moveNetworkQueue;
+ ASINetworkQueue *copyNetworkQueue;
+ ASINetworkQueue *deleteNetworkQueue;
+ ASINetworkQueue *uploadNetworkQueue;
+ ASINetworkQueue *downloadNetworkQueue;
+ NSOperationQueue *moveQueue;
+ NSOperationQueue *copyQueue;
+ NSOperationQueue *deleteQueue;
+ NSOperationQueue *uploadQueue;
+ NSOperationQueue *downloadQueue;
+ NSOperationQueue *moveCallbackQueue;
+ NSOperationQueue *copyCallbackQueue;
+ NSOperationQueue *deleteCallbackQueue;
+ NSOperationQueue *uploadCallbackQueue;
+ NSOperationQueue *downloadCallbackQueue;
}
-@property (nonatomic, assign) IBOutlet NSSplitView *verticalSplitView;
-@property (nonatomic, assign) IBOutlet NSSplitView *horizontalSplitView;
-@property (nonatomic, assign) IBOutlet NSView *leftTopView;
-@property (nonatomic, assign) IBOutlet NSView *leftBottomView;
-@property (nonatomic, assign) IBOutlet NSOutlineView *outlineView;
-@property (nonatomic, assign) IBOutlet NSBrowser *browser;
+@property (nonatomic, strong) ASIPithos *pithos;
+
+@property (nonatomic, unsafe_unretained) PithosAccount *pithosAccountManager;
+@property (nonatomic, strong) PithosAccountNode *accountNode;
-@property (nonatomic, retain) NSArray *draggedNodes;
-@property (nonatomic, retain) PithosNode *draggedParentNode;
+@property (nonatomic, unsafe_unretained) IBOutlet NSSplitView *verticalSplitView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSSplitView *horizontalSplitView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSView *leftTopView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSView *leftBottomView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSOutlineView *outlineView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSBrowser *browser;
+@property (nonatomic, unsafe_unretained) IBOutlet NSMenu *outlineViewMenu;
+@property (nonatomic, unsafe_unretained) IBOutlet NSMenu *browserMenu;
-@property (nonatomic, retain) NSArray *clipboardNodes;
-@property (nonatomic, retain) PithosNode *clipboardParentNode;
+@property (nonatomic, strong) NSArray *draggedNodes;
+@property (nonatomic, strong) PithosNode *draggedParentNode;
+
+@property (nonatomic, strong) NSArray *clipboardNodes;
+@property (nonatomic, strong) PithosNode *clipboardParentNode;
@property (nonatomic, assign) BOOL clipboardCopy;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *activityTextField;
+@property (nonatomic, unsafe_unretained) IBOutlet NSProgressIndicator *activityProgressIndicator;
+
+- (IBAction)forceRefresh:(id)sender;
- (IBAction)refresh:(id)sender;
+- (void)resetBrowser;
+- (void)startBrowser;
+- (BOOL)operationsPending;
+- (void)downloadNode:(PithosNode *)node toDirectory:(NSString *)dirPath withNewFileName:(NSString *)newFileName
+ version:(NSString *)version checkIfExists:(BOOL)checkIfExists;
@end