home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / eText5 / Source / eTImage.subproj / eTImage.h next >
Encoding:
Text File  |  1994-11-26  |  3.3 KB  |  98 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //    FILENAME:    eTImage.h 
  3. //    SUMMARY:    Interface for Image annotations with Action support
  4. //    SUPERCLASS:    Object
  5. //    INTERFACE:    None
  6. //    PROTOCOLS:    <Annotation,HTMDSupport,ASCIISupport,LaTeXSupport,Tool,
  7. //                InspectableTarget,DocNotification>
  8. //    AUTHOR:        Rohit Khare
  9. //    COPYRIGHT:    (c) 1994 California Institure of Technology, eText Project
  10. ///////////////////////////////////////////////////////////////////////////////
  11. //    DESCRIPTION
  12. //        This is a class with two faces: it is useful as an abstract
  13. //    implementation of the <Annotation> protocol suitable for staic-image-like
  14. //    annotation development (contrast eTView) AND it is a simple annotation
  15. //    class for imageable data in its default implementation.
  16. //        It uses eTImageComponent to hold its image data.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //    HISTORY
  19. //    11/26/94:    Added captionMode for text-graphics.
  20. //    10/30/94:    Modified to support <InspectableTarget>
  21. //    07/16/94:    Rewritten from scratch, integrating ImageAnnotation and Image
  22. ///////////////////////////////////////////////////////////////////////////////
  23.  
  24. #import "Component.subproj/eTImageComponent.h"
  25. #import "eTextKernel.h"
  26.  
  27. @interface eTImage:Object <DocNotification,Annotation,Tool,ASCIISupport,LaTeXSupport,HTMDSupport>
  28. {
  29.     id        theText;
  30.     id        etDoc;
  31.     
  32.     id        imageComponent;
  33.     id        image;
  34.     id        altImageComponent;
  35.     id        altImage;
  36.     char     *description;
  37.     NXSize    size;
  38.     BOOL    usesButtonStyle;
  39.     BOOL    isDraggable;
  40.     BOOL    highlighted;    // usesHighlightedStyle ????
  41.     BOOL    state;            // button-emulation
  42.     BOOL    captionMode;    // override to display text string in cell.
  43. }
  44.  
  45. // "Delegate" methods
  46.     // User Interaction
  47.         - click:(NXEvent*)e;
  48.         - doubleClick:(NXEvent*)e;
  49.         - inspect:(NXEvent*)e;
  50.         - drag: (Pasteboard *)draggingPboard image:(NXImage **)proxyImage;
  51.             // client fills in for drag
  52.  
  53. // "Client" methods -- feel free to access ivars directly.
  54.     // Getter/Setter methods
  55.         - setImageComponent: newImageComponent;
  56.         - setAltImageComponent: newAltImageComponent;    
  57.         - setDescription: (const char *) newDescription;
  58.         - setUsesButtonStyle:(BOOL)newState;
  59.         - setDraggable:(BOOL)newState;
  60.         - setSize:(const NXSize *)newSize;
  61.         - setState:(int) newState;    // can't do BOOL because of NS's Cell class
  62.         - setCaptionMode;
  63.         - eTextObj;
  64.         - etDoc;
  65.         - imageComponent;
  66.         - altImageComponent;
  67.         - (char *) description;
  68.         - (char **) getDescription;        // be careful of reallocing this
  69.         - (BOOL) usesButtonStyle;
  70.         - (BOOL) isDraggable;
  71.         - (NXSize *) size;
  72.         - (BOOL) state;
  73.         - (BOOL) captionMode;
  74.     // State Flushing
  75.         - updateGraphics;
  76.  
  77. // "Private" Methods; really, default implementations
  78.     // Lifecycle
  79.         + toolAwake:theApp;
  80.         - init;
  81.         - free;        // NOTE: we free none of our ivars; subclasses must!
  82.         - initFromPboard:thePB inDoc:theDoc linked:(BOOL) linked;
  83.     // Drawing
  84.         - calcCellSize:(NXSize *)theSize;
  85.         - drawSelf:(const NXRect *)rect inView:view;
  86.         - highlight:(const NXRect *)rect inView:view lit:(BOOL)flag;
  87.         - (BOOL)    trackMouse:(NXEvent *)theEvent
  88.                     inRect:(const NXRect *)rect
  89.                     ofView:view;
  90.     // File I/O
  91.         - readRichText:(NXStream *)stream forView:view;
  92.         - writeRichText:(NXStream *)stream forView:view;
  93.     // Drag-and-Drop
  94.         - (NXDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag;
  95.         - draggedImage:(NXImage *)image endedAt:(NXPoint *)screenPoint
  96.           deposited:(BOOL)flag;
  97.  
  98. @end