1 |
/* Browser2.h |
2 |
* |
3 |
* Copyright (C) 2003 Free Software Foundation, Inc. |
4 |
* |
5 |
* Author: Enrico Sersale <enrico@imago.ro> |
6 |
* Date: August 2001 |
7 |
* |
8 |
* This file is part of the GNUstep GWorkspace application |
9 |
* |
10 |
* This program is free software; you can redistribute it and/or modify |
11 |
* it under the terms of the GNU General Public License as published by |
12 |
* the Free Software Foundation; either version 2 of the License, or |
13 |
* (at your option) any later version. |
14 |
* |
15 |
* This program is distributed in the hope that it will be useful, |
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
* GNU General Public License for more details. |
19 |
* |
20 |
* You should have received a copy of the GNU General Public License |
21 |
* along with this program; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 |
*/ |
24 |
|
25 |
|
26 |
#ifndef BROWSER2_H |
27 |
#define BROWSER2_H |
28 |
|
29 |
#include <AppKit/NSView.h> |
30 |
|
31 |
enum { |
32 |
GWColumnIconMask = 1, |
33 |
GWIconCellsMask = 2, |
34 |
GWViewsPaksgesMask = 4 |
35 |
}; |
36 |
|
37 |
@class NSString; |
38 |
@class NSArray; |
39 |
@class NSFileManager; |
40 |
@class NSDictionary; |
41 |
@class NSNotification; |
42 |
@class NSScroller; |
43 |
@class NSFont; |
44 |
@class NSCursor; |
45 |
@class BColumn; |
46 |
@class BIcon; |
47 |
@class BCell; |
48 |
@class BNameEditor; |
49 |
|
50 |
typedef int (*intIMP)(id, SEL, id); |
51 |
|
52 |
@interface Browser2 : NSView |
53 |
{ |
54 |
NSString *remoteHostName; |
55 |
BOOL isRemote; |
56 |
NSCursor *waitCursor; |
57 |
|
58 |
NSString *basePath; |
59 |
NSString *pathSeparator; |
60 |
BOOL isLoaded; |
61 |
unsigned int styleMask; |
62 |
|
63 |
NSMutableArray *columns; |
64 |
NSRect *colRects; |
65 |
BCell *cellPrototype; |
66 |
NSScroller *scroller; |
67 |
BOOL skipUpdateScroller; |
68 |
|
69 |
BOOL canUpdateViews; |
70 |
|
71 |
int visibleColumns; |
72 |
int lastColumnLoaded; |
73 |
int firstVisibleColumn; |
74 |
int lastVisibleColumn; |
75 |
int currentshift; |
76 |
|
77 |
NSSize columnSize; |
78 |
float columnOriginY; |
79 |
float columnWidth; |
80 |
float iconsPathWidth; |
81 |
NSRect scrollerRect; |
82 |
float scrollerWidth; |
83 |
|
84 |
BOOL simulatingDoubleClick; |
85 |
NSArray *doubleClickSelection; |
86 |
float mousePointX; |
87 |
float mousePointY; |
88 |
|
89 |
BNameEditor *nameEditor; |
90 |
NSFont *editorFont; |
91 |
BColumn *edCol; |
92 |
BOOL isEditingIconName; |
93 |
|
94 |
NSString *charBuffer; |
95 |
NSTimeInterval lastKeyPressed; |
96 |
int alphaNumericalLastColumn; |
97 |
|
98 |
id delegate; |
99 |
id gworkspace; |
100 |
|
101 |
SEL createEmptySel; |
102 |
IMP createEmpty; |
103 |
SEL addAndLoadSel; |
104 |
IMP addAndLoad; |
105 |
SEL unloadFromSel; |
106 |
IMP unloadFrom; |
107 |
SEL lastColumnSel; |
108 |
IMP lastColumn; |
109 |
SEL setPathsSel; |
110 |
IMP setPaths; |
111 |
SEL getSel; |
112 |
IMP getImp; |
113 |
SEL indexSel; |
114 |
intIMP indexImp; |
115 |
} |
116 |
|
117 |
- (id)initWithBasePath:(NSString *)bpath |
118 |
visibleColumns:(int)vcols |
119 |
styleMask:(int)mask |
120 |
delegate:(id)anobject |
121 |
remoteHost:(NSString *)rhost; |
122 |
|
123 |
- (void)setPathAndSelection:(NSArray *)selection; |
124 |
|
125 |
- (void)loadColumnZero; |
126 |
- (BColumn *)createEmptyColumn; |
127 |
- (void)addAndLoadColumnForPaths:(NSArray *)cpaths; |
128 |
- (void)unloadFromColumn:(int)column; |
129 |
- (void)reloadColumnWithPath:(NSString *)cpath; |
130 |
- (void)reloadFromColumnWithPath:(NSString *)cpath; |
131 |
- (void)setLastColumn:(int)column; |
132 |
|
133 |
- (void)tile; |
134 |
- (void)makeColumnsRects; |
135 |
- (void)scrollViaScroller:(NSScroller *)sender; |
136 |
- (void)updateScroller; |
137 |
- (void)scrollColumnsLeftBy:(int)shiftAmount; |
138 |
- (void)scrollColumnsRightBy:(int)shiftAmount; |
139 |
- (void)scrollColumnToVisible:(int)column; |
140 |
- (void)moveLeft:(id)sender; |
141 |
- (void)moveRight:(id)sender; |
142 |
- (void)setShift:(int)s; |
143 |
|
144 |
- (BOOL)isShowingPath:(NSString *)path; |
145 |
- (NSString *)pathToLastColumn; |
146 |
- (BColumn *)selectedColumn; |
147 |
- (NSArray *)selectionInColumn:(int)column; |
148 |
- (NSArray *)selectionInColumnBeforeColumn:(BColumn *)col; |
149 |
- (void)selectCellsWithNames:(NSArray *)names |
150 |
inColumnWithPath:(NSString *)cpath |
151 |
sendAction:(BOOL)act; |
152 |
- (void)extendSelectionWithDimmedFiles:(NSArray *)dimmFiles |
153 |
fromColumnWithPath:(NSString *)cpath; |
154 |
- (void)selectAllInLastColumn; |
155 |
- (void)selectForEditingInLastColumn; |
156 |
- (void)unselectNameEditor; |
157 |
- (void)restoreSelectionAfterDndOfIcon:(BIcon *)dndicon; |
158 |
- (void)renewLastIcon; |
159 |
|
160 |
- (void)addCellsWithNames:(NSArray *)names |
161 |
inColumnWithPath:(NSString *)cpath; |
162 |
- (void)addDimmedCellsWithNames:(NSArray *)names |
163 |
inColumnWithPath:(NSString *)cpath; |
164 |
- (void)removeCellsWithNames:(NSArray *)names |
165 |
inColumnWithPath:(NSString *)cpath; |
166 |
- (void)lockCellsWithNames:(NSArray *)names |
167 |
inColumnWithPath:(NSString *)cpath; |
168 |
- (void)unLockCellsWithNames:(NSArray *)names |
169 |
inColumnWithPath:(NSString *)cpath |
170 |
mustExtend:(BOOL)extend; |
171 |
|
172 |
- (int)firstVisibleColumn; |
173 |
- (BColumn *)lastLoadedColumn; |
174 |
- (BColumn *)lastNotEmptyColumn; |
175 |
- (BColumn *)columnWithPath:(NSString *)cpath; |
176 |
- (BColumn *)columnBeforeColumn:(BColumn *)col; |
177 |
- (BColumn *)columnAfterColumn:(BColumn *)col; |
178 |
- (NSArray *)columnsDifferentFromColumn:(BColumn *)col; |
179 |
|
180 |
- (NSPoint)positionOfLastIcon; |
181 |
- (NSPoint)positionForSlidedImage; |
182 |
|
183 |
- (BOOL)viewsapps; |
184 |
|
185 |
- (void)doubleClikTimeOut:(id)sender; |
186 |
- (void)clickInMatrixOfColumn:(BColumn *)col; |
187 |
- (void)doubleClickInMatrixOfColumn:(BColumn *)col; |
188 |
- (void)clickOnIcon:(BIcon *)icon ofColumn:(BColumn *)col; |
189 |
- (void)doubleClickOnIcon:(BIcon *)icon |
190 |
ofColumn:(BColumn *)col |
191 |
newViewer:(BOOL)isnew; |
192 |
|
193 |
- (void)updateNameEditor; |
194 |
- (BOOL)isEditingIconName; |
195 |
- (void)controlTextDidBeginEditing:(NSNotification *)aNotification; |
196 |
- (void)controlTextDidChange:(NSNotification *)aNotification; |
197 |
- (void)controlTextDidEndEditing:(NSNotification *)aNotification; |
198 |
- (void)editorAction:(id)sender; |
199 |
- (BOOL)fileManager:(NSFileManager *)manager |
200 |
shouldProceedAfterError:(NSDictionary *)errorDict; |
201 |
- (void)fileManager:(NSFileManager *)manager willProcessPath:(NSString *)path; |
202 |
|
203 |
@end |
204 |
|
205 |
// |
206 |
// Methods Implemented by the Delegate |
207 |
// |
208 |
@interface NSObject (Browser2DelegateMethods) |
209 |
|
210 |
- (void)currentSelectedPaths:(NSArray *)paths; |
211 |
|
212 |
- (void)openSelectedPaths:(NSArray *)paths newViewer:(BOOL)isnew; |
213 |
|
214 |
@end |
215 |
|
216 |
#endif // BROWSER2_H |
217 |
|