// 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> {
+@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;
+ NSMutableArray *containersNodeChildren;
+ PithosEmptyNode *sharedNode;
+ PithosAccountNode *mySharedNode;
+ PithosSharingAccountsNode *othersSharedNode;
+
+ NSViewController *sharedPreviewController;
+
+ 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;
+
+ BOOL editingItem;
+
+ NSArray *draggedNodes;
+ PithosNode *draggedParentNode;
- NSMutableArray *outlineViewDataSourceArray;
+ 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, retain) IBOutlet NSUserDefaultsController *userDefaultsController;
+@property (nonatomic, strong) ASIPithos *pithos;
-@property (nonatomic, retain) NSMutableArray *outlineViewDataSourceArray;
+@property (nonatomic, unsafe_unretained) PithosAccount *pithosAccountManager;
+@property (nonatomic, strong) PithosAccountNode *accountNode;
-@property (nonatomic, retain) IBOutlet NSSplitView *splitView;
-@property (nonatomic, retain) IBOutlet NSOutlineView *outlineView;
-@property (nonatomic, retain) IBOutlet NSBrowser *browser;
+@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) IBOutlet NSPanel *authenticationPanel;
+@property (nonatomic, strong) NSArray *draggedNodes;
+@property (nonatomic, strong) PithosNode *draggedParentNode;
-- (IBAction)refresh:(id)sender;
+@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)authenticationSelect:(id)sender;
-- (IBAction)authenticationDone:(id)sender;
-- (IBAction)authenticationCancel:(id)sender;
+- (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