ftp.nice.ch/pub/next/developer/objc/iconkit/IconKit.1.2.s.tar.gz#/IconKit-1.2/Classes/IKCell.h

This is IKCell.h in view mode; [Download] [Up]

/*

File IKCell.h

Release 1.2, 7 June 1994
Copyright (C) 1994 by H. Scott Roy

This code is part of IconKit, a general toolbox for drag-and-drop applications.  IconKit is free for noncommercial use, but costs money for a commercial license.  You should have received a copy of the license agreement with this file.  If not, a copy of the license and the complete source of IconKit can be obtained from the author:

		H. Scott Roy
		2573 Stowe Ct.
		Northbrook, IL  60062-8103
		iconkit@cs.stanford.edu

For your editing convenience, this file is best viewed using an editor that automatically wraps long lines, in a fixed point font at 80 columns, with tabs every 4 spaces.

*/


/* ========================================================================== */


/*

This is the type of cell used throughout the appkit, in file viewers and the like, to display an icon with an associated title.  The nomal use is for the icon to represent an object.  If given a delegate, the icon cell treats that delegate as the object it should display and sends it query messages to determine its title, icon, and dragging characteristics.

In conjuction with the IKIconPath class, IKCells support drag-and-drop, acting as both sources and destinations.  The title of an editable IKCell can be changed by clicking on the title region and typing a new one.  The delegate is kept informed throughout dragging and editing so that it can initiate appropriate changes throughout the application.

*/

#import <appkit/ActionCell.h>
#import <appkit/NXImage.h>

#import "IKIconObject.h"
#import "IKDependency.h"


/* ========================================================================== */


/*

The cell class uses enumerated constants to indicate parts of the cell and to set the shelf behavior.

*/

enum {
			IK_NOPART,
			IK_TITLEPART,
			IK_ICONPART
	};

enum {
			IK_NOSHELF,
			IK_UNLOCKED,
			IK_LOCKED,
			IK_REALLYLOCKED
	};


/* ========================================================================== */


/*

Instances maintain their own flag to indicate whether they are editable so that the IKIconPath can reuse a few matrix methods without the matrix class getting confused.

*/

@interface IKCell : ActionCell
{
	id <IKIconObject, IKDependency>
		delegate;
	
	id
		image;
	
	struct _cellflags {
							unsigned int	showBranch:1;
							unsigned int	draggable:1;
							unsigned int	dragAccepting:1;
							unsigned int	editable:1;
							unsigned int	container:1;
							unsigned int	locked:1;
							unsigned int	reallyLocked:1;
							unsigned int	multipleLines:1;
							unsigned int	ghosted:1;
		}	flags;
}


- init;
- initImage: (NXImage *) theImage  title: (const char *) theTitle;
- initDelegate: (id <IKIconObject, IKDependency>) theDelegate;
- initTextCell: (const char *) theTitle;
- initIconCell: (const char *) iconName;
- initFromCopy: (IKCell *) copy;
- free;
- delegate;
- read: (NXTypedStream *) stream;
- write: (NXTypedStream *) stream;

- image;
- (const char *) title;
- (BOOL) isBranch;
- (BOOL) isDraggable;
- (BOOL) isDragAccepting;
- (BOOL) isEditable;
- (BOOL) isContainer;
- (BOOL) isEmptyContainer;
- (BOOL) isLocked;
- (BOOL) isReallyLocked;
- (BOOL) isMultipleLines;
- (BOOL) isGhosted;

- setImage: (NXImage *) theImage;
- setTitle: (const char *) theTitle;
- setDelegate: (id <IKIconObject, IKDependency>) theDelegate;
- setBranch: (BOOL) flag;
- setDraggable: (BOOL) flag;
- setDragAccepting: (BOOL) flag;
- setEditable: (BOOL) flag;
- setContainer: (BOOL) flag;
- setLocked: (BOOL) flag;
- setReallyLocked: (BOOL) flag;
- setMultipleLines: (BOOL) flag;
- setGhosted: (BOOL) flag;
- (int) shelfMode;
- setShelfMode: (int) mode;

- didChangeName: sender;
- didChangeImage: sender;
- willFree: sender;

- drawIcon: (NXRect) iconRect;
- drawTitle: (NXRect) titleRect;
- drawBranch: (NXRect) cellFrame;
- getIconRect: (NXRect *) iconRect;
- getTitleRect: (NXRect *) titleRect;
- (int) hitPart: (NXPoint *) where  inRect: (const NXRect *) cellFrame;

- dragIcon: (NXEvent *) event  inRect: (const NXRect *) cellFrame  ofView: view;
- editTitle: (NXEvent *) event inRect: (const NXRect *) cellFrame  ofView: view;
- (BOOL) textWillEnd: sender;
- editor;


/*
	-NO NEW DOCUMENTATION-

- highlight: (const NXRect *) cellFrame  inView: aView  lit: (BOOL) flag;
- calcCellSize: (NXSize *) size  inRect: (const NXRect *) frame;

*/

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.