1 |
/* IconsPanel.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 ICONSPANEL_H |
27 |
#define ICONSPANEL_H |
28 |
|
29 |
#include <AppKit/NSView.h> |
30 |
|
31 |
@class NSString; |
32 |
@class NSMutableString; |
33 |
@class NSArray; |
34 |
@class NSMutableArray; |
35 |
@class NSNotification; |
36 |
@class NSFileManager; |
37 |
@class IconsViewerIcon; |
38 |
@class BNameEditor; |
39 |
@class NSImage; |
40 |
|
41 |
@interface IconsPanel : NSView |
42 |
{ |
43 |
id delegate; |
44 |
id gworkspace; |
45 |
NSString *currentPath; |
46 |
|
47 |
NSMutableArray *icons; |
48 |
NSImage *verticalImage; |
49 |
NSImage *horizontalImage; |
50 |
|
51 |
BOOL isDragTarget; |
52 |
BOOL isShiftClick; |
53 |
BOOL selectInProgress; |
54 |
int iconsperrow; |
55 |
int cellsWidth; |
56 |
|
57 |
BNameEditor *nameEditor; |
58 |
IconsViewerIcon *edIcon; |
59 |
NSFont *editorFont; |
60 |
BOOL editingIcnName; |
61 |
|
62 |
BOOL contestualMenu; |
63 |
|
64 |
NSString *charBuffer; |
65 |
NSTimeInterval lastKeyPressed; |
66 |
|
67 |
NSFileManager *fm; |
68 |
} |
69 |
|
70 |
- (id)initAtPath:(NSString *)path |
71 |
delegate:(id)adelegate; |
72 |
|
73 |
- (void)setPath:(NSString *)path; |
74 |
- (void)setCurrentSelection:(NSArray *)paths; |
75 |
- (void)reloadFromPath:(NSString *)path; |
76 |
- (NSArray *)checkHiddenFiles:(NSArray *)files atPath:(NSString *)path; |
77 |
- (void)makeFileIcons; |
78 |
- (void)sortIcons; |
79 |
|
80 |
- (void)tile; |
81 |
- (void)scrollFirstIconToVisible; |
82 |
- (void)scrollToVisibleIconsWithPaths:(NSArray *)paths; |
83 |
|
84 |
- (NSString *)currentPath; |
85 |
- (BOOL)isOnBasePath:(NSString *)bpath withFiles:(NSArray *)files; |
86 |
- (NSArray *)currentSelection; |
87 |
- (IconsViewerIcon *)iconWithPath:(NSString *)path; |
88 |
- (NSArray *)iconsWithPaths:(NSArray *)paths; |
89 |
|
90 |
- (void)selectIconWithPath:(NSString *)path; |
91 |
- (void)selectIconsWithPaths:(NSArray *)paths; |
92 |
- (NSString *)selectIconWithPrefix:(NSString *)prefix; |
93 |
- (void)selectIconInPrevLine; |
94 |
- (void)selectIconInNextLine; |
95 |
- (void)selectPrevIcon; |
96 |
- (void)selectNextIcon; |
97 |
- (void)selectAllIcons; |
98 |
- (void)unselectOtherIcons:(id)anIcon; |
99 |
- (void)extendSelectionWithDimmedFiles:(NSArray *)files |
100 |
startingAtPath:(NSString *)bpath; |
101 |
- (void)openSelectionWithApp:(id)sender; |
102 |
- (void)openSelectionWith:(id)sender; |
103 |
|
104 |
- (void)addIconWithPath:(NSString *)iconpath dimmed:(BOOL)isdimmed; |
105 |
- (void)addIconsWithNames:(NSArray *)names dimmed:(BOOL)isdimmed; |
106 |
- (void)removeIcon:(id)anIcon; |
107 |
- (void)removeIconsWithNames:(NSArray *)names; |
108 |
|
109 |
- (void)lockIconsWithNames:(NSArray *)names; |
110 |
- (void)unLockIconsWithNames:(NSArray *)names; |
111 |
- (void)lockAllIcons; |
112 |
- (void)unLockAllIcons; |
113 |
|
114 |
- (void)setLabelRectOfIcon:(id)anIcon; |
115 |
- (int)cellsWidth; |
116 |
- (void)cellsWidthChanged:(NSNotification *)notification; |
117 |
|
118 |
- (void)setShiftClick:(BOOL)value; |
119 |
|
120 |
- (void)openCurrentSelection:(NSArray *)paths newViewer:(BOOL)newv; |
121 |
|
122 |
- (void)updateNameEditor; |
123 |
|
124 |
- (void)editorAction:(id)sender; |
125 |
|
126 |
- (void)setDelegate:(id)anObject; |
127 |
|
128 |
- (id)delegate; |
129 |
|
130 |
@end |
131 |
|
132 |
@interface IconsPanel (DraggingDestination) |
133 |
|
134 |
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender; |
135 |
|
136 |
- (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender; |
137 |
|
138 |
- (void)draggingExited:(id <NSDraggingInfo>)sender; |
139 |
|
140 |
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender; |
141 |
|
142 |
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; |
143 |
|
144 |
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender; |
145 |
|
146 |
@end |
147 |
|
148 |
// |
149 |
// Methods Implemented by the Delegate |
150 |
// |
151 |
|
152 |
@interface NSObject (IconsPanelDelegateMethods) |
153 |
|
154 |
- (void)setTheSelectedPaths:(id)paths; |
155 |
|
156 |
- (void)openTheCurrentSelection:(id)paths newViewer:(BOOL)newv; |
157 |
|
158 |
- (int)iconCellsWidth; |
159 |
|
160 |
@end |
161 |
|
162 |
// |
163 |
// IconsViewerIcon Delegate Methods |
164 |
// |
165 |
|
166 |
@interface IconsPanel (IconsViewerIconDelegateMethods) |
167 |
|
168 |
- (int)getCellsWidth; |
169 |
|
170 |
- (void)setLabelFrameOfIcon:(id)aicon; |
171 |
|
172 |
- (void)unselectIconsDifferentFrom:(id)aicon; |
173 |
|
174 |
- (void)setShiftClickValue:(BOOL)value; |
175 |
|
176 |
- (void)setTheCurrentSelection:(id)paths; |
177 |
|
178 |
- (NSArray *)getTheCurrentSelection; |
179 |
|
180 |
- (void)openTheCurrentSelection:(id)paths newViewer:(BOOL)newv; |
181 |
|
182 |
- (id)menuForRightMouseEvent:(NSEvent *)theEvent; |
183 |
|
184 |
@end |
185 |
|
186 |
#endif // ICONSPANEL_H |
187 |
|