Use user catalog displayname when displaying an account node
[pithos-macos] / pithos-macos / PithosBrowserController.h
1 //
2 //  PithosBrowserController.h
3 //  pithos-macos
4 //
5 // Copyright 2011-2012 GRNET S.A. All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or
8 // without modification, are permitted provided that the following
9 // conditions are met:
10 // 
11 //   1. Redistributions of source code must retain the above
12 //      copyright notice, this list of conditions and the following
13 //      disclaimer.
14 // 
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.
19 // 
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.
32 // 
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.
37
38 #import <Cocoa/Cocoa.h>
39 #import "PithosActivityFacility.h"
40 @class ASIPithos;
41 @class PithosAccount;
42 @class PithosNode;
43 @class PithosAccountNode;
44 @class PithosSharingAccountsNode;
45 @class PithosEmptyNode;
46 @class PithosActivityFacility;
47 @class ASINetworkQueue;
48
49 @interface PithosBrowserController : NSWindowController <NSBrowserDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, NSMenuDelegate, PithosActivityFacilityDelegate> {
50     BOOL browserInitialized;
51     BOOL browserActive;
52     
53     ASIPithos *pithos;
54     
55     PithosAccount *__unsafe_unretained pithosAccountManager;
56     PithosNode *rootNode;
57     PithosAccountNode *accountNode;
58     PithosEmptyNode *containersNode;
59     NSMutableArray *containersNodeChildren;
60     PithosEmptyNode *sharedNode;
61     PithosAccountNode *mySharedNode;
62     PithosSharingAccountsNode *othersSharedNode;
63     
64     NSViewController *sharedPreviewController;
65     
66     NSSplitView *__unsafe_unretained verticalSplitView;
67     NSSplitView *__unsafe_unretained horizontalSplitView;
68     NSView *__unsafe_unretained leftTopView;
69     NSView *__unsafe_unretained leftBottomView;
70     NSOutlineView *__unsafe_unretained outlineView;
71     NSBrowser *__unsafe_unretained browser;
72     NSMenu *__unsafe_unretained outlineViewMenu;
73     NSMenu *__unsafe_unretained browserMenu;
74     
75     BOOL editingItem;
76     
77     NSArray *draggedNodes;
78     PithosNode *draggedParentNode;
79     
80     NSArray *clipboardNodes;
81     PithosNode *clipboardParentNode;
82     BOOL clipboardCopy;
83     
84     NSTextField *__unsafe_unretained activityTextField;
85     NSProgressIndicator *__unsafe_unretained activityProgressIndicator;
86     PithosActivityFacility *activityFacility;
87     
88     NSTimer *refreshTimer;
89     
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;
105 }
106
107 @property (nonatomic, strong) ASIPithos *pithos;
108
109 @property (nonatomic, unsafe_unretained) PithosAccount *pithosAccountManager;
110 @property (nonatomic, strong) PithosAccountNode *accountNode;
111
112 @property (nonatomic, unsafe_unretained) IBOutlet NSSplitView *verticalSplitView;
113 @property (nonatomic, unsafe_unretained) IBOutlet NSSplitView *horizontalSplitView;
114 @property (nonatomic, unsafe_unretained) IBOutlet NSView *leftTopView;
115 @property (nonatomic, unsafe_unretained) IBOutlet NSView *leftBottomView;
116 @property (nonatomic, unsafe_unretained) IBOutlet NSOutlineView *outlineView;
117 @property (nonatomic, unsafe_unretained) IBOutlet NSBrowser *browser;
118 @property (nonatomic, unsafe_unretained) IBOutlet NSMenu *outlineViewMenu;
119 @property (nonatomic, unsafe_unretained) IBOutlet NSMenu *browserMenu;
120
121 @property (nonatomic, strong) NSArray *draggedNodes;
122 @property (nonatomic, strong) PithosNode *draggedParentNode;
123
124 @property (nonatomic, strong) NSArray *clipboardNodes;
125 @property (nonatomic, strong) PithosNode *clipboardParentNode;
126 @property (nonatomic, assign) BOOL clipboardCopy;
127
128 @property (nonatomic, unsafe_unretained) IBOutlet NSTextField *activityTextField;
129 @property (nonatomic, unsafe_unretained) IBOutlet NSProgressIndicator *activityProgressIndicator;
130
131 - (IBAction)forceRefresh:(id)sender;
132 - (IBAction)refresh:(id)sender;
133 - (void)resetBrowser;
134 - (void)startBrowser;
135 - (BOOL)operationsPending;
136 - (void)downloadNode:(PithosNode *)node toDirectory:(NSString *)dirPath withNewFileName:(NSString *)newFileName 
137              version:(NSString *)version checkIfExists:(BOOL)checkIfExists;
138
139 @end