1 |
/* PathIcon.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 PATHICON_H |
27 |
#define PATHICON_H |
28 |
|
29 |
#include <AppKit/NSView.h> |
30 |
|
31 |
@class NSString; |
32 |
@class NSArray; |
33 |
@class NSPasteboard; |
34 |
@class NSEvent; |
35 |
@class NSImage; |
36 |
@class NSFileManager; |
37 |
@class NSWorkspace; |
38 |
@class PathIconLabel; |
39 |
@class NSTextField; |
40 |
|
41 |
@interface PathIcon : NSView |
42 |
{ |
43 |
NSArray *paths; |
44 |
NSString *fullpath; |
45 |
NSString *name; |
46 |
NSString *hostname; |
47 |
|
48 |
BOOL isRootIcon; |
49 |
BOOL isPakage; |
50 |
BOOL singlepath; |
51 |
NSString *type; |
52 |
BOOL isbranch; |
53 |
BOOL locked; |
54 |
|
55 |
NSImage *icon, *highlight, *arrow; |
56 |
PathIconLabel *namelabel; |
57 |
|
58 |
id delegate; |
59 |
id gworkspace; |
60 |
|
61 |
BOOL isSelect; |
62 |
|
63 |
int dragdelay; |
64 |
BOOL isDragTarget; |
65 |
|
66 |
BOOL contestualMenu; |
67 |
|
68 |
NSFileManager *fm; |
69 |
NSWorkspace *ws; |
70 |
} |
71 |
|
72 |
- (id)initWithDelegate:(id)aDelegate; |
73 |
|
74 |
- (void)setPaths:(NSArray *)p; |
75 |
|
76 |
- (void)select; |
77 |
|
78 |
- (void)unselect; |
79 |
|
80 |
- (void)renewIcon; |
81 |
|
82 |
- (void)openWithApp:(id)sender; |
83 |
|
84 |
- (void)openWith:(id)sender; |
85 |
|
86 |
- (NSTextField *)label; |
87 |
|
88 |
- (void)clickOnLabel; |
89 |
|
90 |
- (NSString *)type; |
91 |
|
92 |
- (BOOL)isSinglePath; |
93 |
|
94 |
- (BOOL)isSelect; |
95 |
|
96 |
- (void)setPaths:(NSArray *)paths; |
97 |
|
98 |
- (void)setBranch:(BOOL)value; |
99 |
|
100 |
- (BOOL)isBranch; |
101 |
|
102 |
- (void)setLocked:(BOOL)value; |
103 |
|
104 |
- (BOOL)isLocked; |
105 |
|
106 |
- (BOOL)isRootIcon; |
107 |
|
108 |
- (BOOL)isPakage; |
109 |
|
110 |
- (NSArray *)paths; |
111 |
|
112 |
- (NSString *)name; |
113 |
|
114 |
- (NSString *)hostname; |
115 |
|
116 |
- (NSImage *)icon; |
117 |
|
118 |
- (NSSize)iconShift; |
119 |
|
120 |
- (BOOL)isSinglePath; |
121 |
|
122 |
- (id)delegate; |
123 |
|
124 |
- (void)setDelegate:(id)aDelegate; |
125 |
|
126 |
@end |
127 |
|
128 |
|
129 |
@interface PathIcon (DraggingSource) |
130 |
|
131 |
- (void)startExternalDragOnEvent:(NSEvent *)event; |
132 |
|
133 |
- (void)declareAndSetShapeOnPasteboard:(NSPasteboard *)pb; |
134 |
|
135 |
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)flag; |
136 |
|
137 |
@end |
138 |
|
139 |
@interface PathIcon (DraggingDestination) |
140 |
|
141 |
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender; |
142 |
|
143 |
- (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender; |
144 |
|
145 |
- (void)draggingExited:(id <NSDraggingInfo>)sender; |
146 |
|
147 |
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender; |
148 |
|
149 |
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; |
150 |
|
151 |
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender; |
152 |
|
153 |
@end |
154 |
|
155 |
// |
156 |
// Methods Implemented by the Delegate |
157 |
// |
158 |
|
159 |
@interface NSObject (PathIconDelegateMethods) |
160 |
|
161 |
- (void)setLabelFrameOfIcon:(id)anicon; |
162 |
|
163 |
- (void)unselectIconsDifferentFrom:(id)anicon; |
164 |
|
165 |
- (void)clickedIcon:(id)anicon; |
166 |
|
167 |
- (void)doubleClickedIcon:(id)anicon newViewer:(BOOL)isnew; |
168 |
|
169 |
- (void)unselectNameEditor; |
170 |
|
171 |
- (void)restoreSelectionAfterDndOfIcon:(id)dndicon; |
172 |
|
173 |
@end |
174 |
|
175 |
#endif // PATHICON_H |