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