2 // PithosBrowserController.h
5 // Copyright 2011-2012 GRNET S.A. All rights reserved.
7 // Redistribution and use in source and binary forms, with or
8 // without modification, are permitted provided that the following
11 // 1. Redistributions of source code must retain the above
12 // copyright notice, this list of conditions and the following
15 // 2. Redistributions in binary form must reproduce the above
16 // copyright notice, this list of conditions and the following
17 // disclaimer in the documentation and/or other materials
18 // provided with the distribution.
20 // THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
21 // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
24 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
33 // The views and conclusions contained in the software and
34 // documentation are those of the authors and should not be
35 // interpreted as representing official policies, either expressed
36 // or implied, of GRNET S.A.
38 #import <Cocoa/Cocoa.h>
39 #import "PithosActivityFacility.h"
43 @class PithosAccountNode;
44 @class PithosSharingAccountsNode;
45 @class PithosEmptyNode;
46 @class PithosActivityFacility;
47 @class ASINetworkQueue;
49 @interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, NSMenuDelegate, PithosActivityFacilityDelegate> {
50 BOOL browserInitialized;
55 PithosAccount *__unsafe_unretained pithosAccountManager;
57 PithosAccountNode *accountNode;
58 PithosEmptyNode *containersNode;
59 NSMutableArray *containersNodeChildren;
60 PithosEmptyNode *sharedNode;
61 PithosAccountNode *mySharedNode;
62 PithosSharingAccountsNode *othersSharedNode;
64 NSViewController *sharedPreviewController;
66 IBOutlet NSSplitView *verticalSplitView;
67 IBOutlet NSSplitView *horizontalSplitView;
68 IBOutlet NSView *leftTopView;
69 IBOutlet NSView *leftBottomView;
70 IBOutlet NSOutlineView *outlineView;
71 IBOutlet NSBrowser *browser;
72 IBOutlet NSMenu *outlineViewMenu;
73 IBOutlet NSMenu *browserMenu;
77 NSArray *draggedNodes;
78 PithosNode *draggedParentNode;
80 NSArray *clipboardNodes;
81 PithosNode *clipboardParentNode;
84 IBOutlet NSTextField *activityTextField;
85 IBOutlet NSProgressIndicator *activityProgressIndicator;
86 PithosActivityFacility *activityFacility;
88 NSTimer *refreshTimer;
90 ASINetworkQueue *moveNetworkQueue;
91 ASINetworkQueue *copyNetworkQueue;
92 ASINetworkQueue *deleteNetworkQueue;
93 ASINetworkQueue *uploadNetworkQueue;
94 ASINetworkQueue *downloadNetworkQueue;
95 NSOperationQueue *moveQueue;
96 NSOperationQueue *copyQueue;
97 NSOperationQueue *deleteQueue;
98 NSOperationQueue *uploadQueue;
99 NSOperationQueue *downloadQueue;
100 NSOperationQueue *moveCallbackQueue;
101 NSOperationQueue *copyCallbackQueue;
102 NSOperationQueue *deleteCallbackQueue;
103 NSOperationQueue *uploadCallbackQueue;
104 NSOperationQueue *downloadCallbackQueue;
107 @property (nonatomic, strong) ASIPithos *pithos;
109 @property (nonatomic, unsafe_unretained) PithosAccount *pithosAccountManager;
110 @property (nonatomic, strong) PithosAccountNode *accountNode;
112 @property (nonatomic, strong) NSArray *draggedNodes;
113 @property (nonatomic, strong) PithosNode *draggedParentNode;
115 @property (nonatomic, strong) NSArray *clipboardNodes;
116 @property (nonatomic, strong) PithosNode *clipboardParentNode;
117 @property (nonatomic, assign) BOOL clipboardCopy;
119 - (IBAction)forceRefresh:(id)sender;
120 - (IBAction)refresh:(id)sender;
121 - (void)resetBrowser;
122 - (void)startBrowser;
123 - (BOOL)operationsPending;
124 - (void)downloadNode:(PithosNode *)node toDirectory:(NSString *)dirPath withNewFileName:(NSString *)newFileName
125 version:(NSString *)version checkIfExists:(BOOL)checkIfExists;