1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
/* Contents.h
*
* Copyright (C) 2004-2010 Free Software Foundation, Inc.
*
* Author: Enrico Sersale <enrico@imago.ro>
* Date: January 2004
*
* This file is part of the GNUstep GWorkspace application
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
*/
#import <Foundation/Foundation.h>
@class NSWorkspace;
@class NSImage;
@class NSView;
@class TextViewer;
@class GenericView;
@class NSTextView;
@class NSScrollView;
@class NSTextField;
@class NSButton;
@interface Contents : NSObject
{
IBOutlet id win;
IBOutlet NSBox *mainBox;
IBOutlet NSBox *topBox;
IBOutlet id iconView;
IBOutlet id titleField;
IBOutlet NSBox *viewersBox;
NSView *noContsView;
GenericView *genericView;
NSMutableArray *viewers;
id currentViewer;
TextViewer *textViewer;
NSString *currentPath;
NSImage *pboardImage;
NSFileManager *fm;
NSWorkspace *ws;
id inspector;
}
- (id)initForInspector:(id)insp;
- (NSView *)inspView;
- (NSString *)winname;
- (void)activateForPaths:(NSArray *)paths;
- (id)viewerForPath:(NSString *)path;
- (id)viewerForDataOfType:(NSString *)type;
- (void)showContentsAt:(NSString *)path;
- (void)contentsReadyAt:(NSString *)path;
- (BOOL)canDisplayDataOfType:(NSString *)type;
- (void)showData:(NSData *)data
ofType:(NSString *)type;
- (BOOL)isShowingData;
- (void)dataContentsReadyForType:(NSString *)typeDescr
useIcon:(NSImage *)icon;
- (void)watchedPathDidChange:(NSDictionary *)info;
- (id)inspector;
@end
@interface TextViewer : NSView
{
NSScrollView *scrollView;
NSTextView *textView;
NSTextField *errLabel;
NSButton *editButt;
NSString *editPath;
NSWorkspace *ws;
id contsinsp;
}
- (id)initWithFrame:(NSRect)frameRect
forInspector:(id)insp;
- (BOOL)tryToDisplayPath:(NSString *)path;
- (NSData *)textContentsAtPath:(NSString *)path
withAttributes:(NSDictionary *)attributes;
- (void)editFile:(id)sender;
@end
@interface GenericView : NSView
{
NSString *shComm;
NSString *fileComm;
NSTask *task;
NSPipe *pipe;
NSTextView *textview;
NSNotificationCenter *nc;
}
- (void)showInfoOfPath:(NSString *)path;
- (void)dataFromTask:(NSNotification *)notif;
- (void)showString:(NSString *)str;
@end
|