home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Documentation / Development Notes / ODF Examples RoadMap / Data Interchange next >
Encoding:
Text File  |  1996-09-18  |  4.7 KB  |  56 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. Data Interchange
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9. Table of Contents
  10. -------------------------
  11. • Promises - ODFDraw
  12. • Multiple Kinds - ODFDraw, ODFBitmap
  13. • Cut/Copy/Paste/Clear - all but ODFButton, ODFClock and ODFNothing
  14.    Undoable - ODFContainer, ODFDraw, ODFEmbed, ODFHello, ODFTable
  15. • Drag - ODFBitmap, ODFContainer, ODFDraw, ODFEmbed, ODFHello, ODFTable
  16.    Undoable - ODFContainer, ODFDraw, ODFEmbed, ODFTable
  17. • Drop - all but ODFClock, ODFForm, and ODFNothing
  18.    Undoable - ODFContainer, ODFDraw, ODFEmbed, ODFTable
  19.  
  20.  
  21. Promises
  22.  
  23. ODFDraw: The class CBaseShape maintains the flagfPromised to tell if a shape is promised or not. Because a shape can be promised for different storage types (linking, clipboard...), fPromised is not just a boolean but an array of bit flags. Whenever a shape’s property is about to be changed the method CBaseShape::CheckPromise is called; if the shape is promised the promise is fulfilled before the shape is modified. 
  24. ODFDraw subclasses FW_CPromise (CDrawSelectionPromise ) and implements the FulfillPromise method. In CDrawSelection::Externalize an instance of CDrawSelectionPromise is created and Promise() is called for each promised data type.
  25. CDrawSelectionPromise keeps track of a content object (CDrawPromiseContent) and the FulfillPromise method will be called to fulfill the promise for a specific data type.
  26.  
  27. Multiple Kinds
  28.  
  29. ODFDraw: ODFDraw supports two data types for data interchange: its own internal format which is simply a list of shapes, and PICTs. Take a look at the methods CDrawSelectionContent:Externalize and CDrawSelectionPromise::FulfillPromise. This version of ODFDraw doesn't save a document with multiple representations yet.
  30.  
  31. ODFBitmap: like ODFDraw, ODFBitmap supports both its own internal format (streamed pixmap) and PICTs and JPEG (only for internalization not externalization). Also, like ODFDraw, ODFBitmap supports multiple kinds only for clipboard and drag&drop operations (see CBitmapContent::Externalize). All the code dealing with multiple kinds is in CBitmapContent.
  32.  
  33.  
  34. Cut/Copy/Paste/Clear
  35.  
  36. ODFBitmap: doesn’t define its own clipboard command class, but cut, copy, paste, and clear work via the selection object, CBitmapSelection. The selection object supplies a reference to the content object (in GetSelectedContent) when requested by ODF for data interchange operations. For a cut or copy, the content object’s Externalize method is called (see CBitmapSelectionContent::Externalize). For a paste, the content object’s Internalize method is called (see CBitmapSelectionContent::Internalize). 
  37. ODFContainer, ODFDraw, ODFEmbed, ODFHello, ODFTable: each defines a clipboard command class that is undoable. Note that the code for undoing and redoing clipboard operations is pretty much the same conceptually across all the parts. 
  38. ODFForm: defines a clipboard command class that works with edit views (CViewEditCommand).
  39.  
  40.  
  41. Drag
  42.  
  43. ODFBitmap: doesn’t define its own drag command class, but a drag works because a) the frame has FW_MDraggableFrame mixed in, and b) ODFBitmap implements a selection object, CBitmapSelection. 
  44. ODFContainer, ODFDraw, ODFEmbed, ODFHello, ODFTable: each defines a drag command class that is undoable. Note that the drag command’s undo code is only called for a drag operation that removed data from the part. So the code for undoing a drag is similar to that for undoing a cut; compare the UndoIt methods in CEmbedEditCommand and CEmbedDragCommand in ODFEmbed.
  45.  
  46.  
  47. Drop
  48.  
  49. ODFBitmap: doesn’t define a drop command class, but a drop works because a) the frame has FW_MDroppableFrame mixed in, and b) ODFBitmap implements a selection object, CBitmapSelection.  
  50. ODFContainer, ODFDraw: define undoable drop commands. The drop command has to save the dropped data (in SaveRedoState) so that it can be restored in case of redo. It doesn’t have to save previous content because the dropped data is simply added to the part’s data. 
  51. ODFEmbed, ODFHello: the drop command saves the previous content (in SaveUndoState) and restores it on undo. Undoing a drop command is similar to undoing a paste; compare the UndoIt methods in CEmbedEditCommand and CEmbedDropCommand.
  52. ODFTable: doesn’t allow a part to be dropped in a cell that is already occupied. This is enforced by the drop tracker (see CTableDropTracker::ShouldHilite).
  53.  
  54.  
  55. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  56. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.