home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / OpenDoc / CreditNow! / CreditNow! Source / CPCreditNowDemo.Doc.cpp < prev    next >
Encoding:
Text File  |  1995-04-23  |  44.0 KB  |  1,156 lines  |  [TEXT/MPCC]

  1. //----------------------------------------------------------------------------------------
  2. // CPCreditNowDemo.Doc.cp - Documentation for CreditNowDemo methods.
  3. // This is very preliminary.
  4. //----------------------------------------------------------------------------------------
  5.  
  6. // PART
  7. void Explain_Constructor();
  8. void Explain_Destructor();
  9. void Explain_InitPart();
  10. void Explain_InitPartFromStorage();
  11. void Explain_Externalize();
  12. void Explain_Open();
  13. void Explain_Release();
  14. void Explain_ReleaseAll();
  15. void Explain_IncrementRefCount();
  16. void Explain_CloneInto();
  17.  
  18. // EXTENSIONS
  19. void Explain_HasExtension();
  20. void Explain_GetExtension();
  21. void Explain_ReleaseExtension();
  22.  
  23. // DRAGDROP
  24. void Explain_DragLeave();
  25. void Explain_Drop();
  26. void Explain_DragWithin();
  27. void Explain_DragEnter();
  28. void Explain_DropCompleted();
  29. void Explain_FulfillPromise();
  30.  
  31. // EMBED
  32. void Explain_ContainingPartPropertiesChanged();
  33. void Explain_GetContainingPartProperties();
  34. void Explain_RevealFrame();
  35. void Explain_EmbeddedFrameSpec();
  36. void Explain_CreateEmbeddedFramesIterator();
  37. void Explain_EmbeddedFrameChanged();
  38.  
  39. // EVENTS
  40. void Explain_HandleEvent();
  41. void Explain_AdjustMenus();
  42.  
  43. // FOCUS
  44. void Explain_BeginRelinquishFocus();
  45. void Explain_CommitRelinquishFocus();
  46. void Explain_AbortRelinquishFocus();
  47. void Explain_FocusAcquired();
  48. void Explain_FocusLost();
  49.  
  50. // FRAMES
  51. void Explain_DisplayFrameAdded();
  52. void Explain_DisplayFrameConnected();
  53. void Explain_DisplayFrameRemoved();
  54. void Explain_DisplayFrameClosed();
  55. void Explain_FrameShapeChanged();
  56. void Explain_AttachSourceFrame();
  57. void Explain_ViewTypeChanged();
  58. void Explain_PresentationChanged();
  59. void Explain_SequenceChanged();
  60. void Explain_WritePartInfo();
  61. void Explain_ReadPartInfo();
  62. void Explain_ClonePartInfo();
  63. void Explain_RequestEmbeddedFrame();
  64. void Explain_RemoveEmbeddedFrame();
  65. void Explain_RequestFrameShape();
  66. void Explain_UsedShapeChanged();
  67. void Explain_AdjustBorderShape();
  68.  
  69. // FACETS
  70. void Explain_FacetAdded();
  71. void Explain_FacetRemoved();
  72. void Explain_CanvasChanged();
  73. void Explain_GeometryChanged();
  74.  
  75. // IMAGING
  76. void Explain_Draw();
  77. void Explain_CanvasUpdated();
  78. void Explain_HighlightChanged();
  79. void Explain_GetPrintResolution();
  80.  
  81. // LINKING
  82. void Explain_CreateLink();
  83. void Explain_LinkUpdated();
  84. void Explain_RevealLink();
  85. void Explain_LinkStatusChanged();
  86.  
  87. // UNDO
  88. void Explain_UndoAction();
  89. void Explain_RedoAction();
  90. void Explain_DisposeActionState();
  91. void Explain_WriteActionState();
  92. void Explain_ReadActionState();
  93.  
  94. // BINDING
  95. void Explain_ExternalizeKinds();
  96. void Explain_ChangeKind();
  97.  
  98. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  99. // PART
  100. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  101.  
  102. void Explain_Constructor() {}
  103.  
  104. //----------------------------------------------------------------------------------------
  105.  
  106. void Explain_Destructor() {}
  107.  
  108. //----------------------------------------------------------------------------------------
  109.  
  110. void Explain_InitPart() {}
  111.  
  112. //----------------------------------------------------------------------------------------
  113.  
  114. void Explain_InitPartFromStorage() {}
  115.  
  116. //----------------------------------------------------------------------------------------
  117.  
  118. void Explain_Externalize() {}
  119.  
  120. //----------------------------------------------------------------------------------------
  121.  
  122. void Explain_Open() {}
  123.  
  124. // Creates and opens a presentation of the part in a frame
  125. // in a new window.
  126. //
  127. // This method adds this part as the root part of the window.
  128. // It bases the presentation in the new frame on the presentation
  129. // in the old frame, or on a default presentation if there
  130. // is no old frame.
  131.  
  132. //----------------------------------------------------------------------------------------
  133.  
  134. void Explain_Release() {}
  135.  
  136. // If you are using RegisterIdle on the part, not on frames, then
  137. // the RefCount is bumped up by one by OpenDoc.  OpenDoc keeps a
  138. // reference to all parts that register idle time.  ALL OF THESE MUST
  139. // BE RESOLVED BEFORE THE DESTRUCTOR IS CALLED.  This is
  140. // the place to do that.
  141.  
  142. // The logic below, assuming that CPCreditNowDemo has registered for idle
  143. // time, is that if the RefCount is 1, then we are here to unregister
  144. // the idle.  When the part is being removed, OpenDoc must decrement
  145. // the RefCount and call Release until the part gets messaged with
  146. // a RefCount of 0.  Once you return from here with a RefCount of 0,
  147. // OpenDoc will call the destructor.
  148.  
  149. // This means that if you have registered for idle time, Release will
  150. // be called TWICE when closing down your part.  The first time the
  151. // RefCount is 1.  This is when you should unregister the idle time.
  152. // When you are called with a RefCount of 0, that when it gets really
  153. // serious.  This is when you detach from the draft.
  154.  
  155. //----------------------------------------------------------------------------------------
  156.  
  157. void Explain_ReleaseAll() {}
  158.  
  159. //----------------------------------------------------------------------------------------
  160.  
  161. void Explain_IncrementRefCount() {}
  162.  
  163. //----------------------------------------------------------------------------------------
  164.  
  165. void Explain_CloneInto() {}
  166.  
  167. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  168. // EXTENSIONS
  169. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  170.  
  171. void Explain_HasExtension() {}
  172.  
  173. //----------------------------------------------------------------------------------------
  174.  
  175. void Explain_GetExtension() {}
  176.  
  177. //----------------------------------------------------------------------------------------
  178.  
  179. void Explain_ReleaseExtension() {}
  180.  
  181. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  182. // IMAGING
  183. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  184.  
  185. void Explain_Draw() {}
  186.  
  187. // Draws the part in the facet, updating the portion of the
  188. // facet in the invalidShape.
  189. //
  190. // Called by the facet object.
  191. //
  192. // The part should draw itself on the facet's canvas. The part
  193. // must examine its canvas' isDynamic flag to determine if it
  194. // will be drawing on the screen or to a printer, and then draw
  195. // itself appropriately.
  196. //
  197. // Draw the part in the given facet. Only the portion in the
  198. // invalidShape needs to be drawn.
  199. //
  200. // There are several steps a part needs to take to perform the
  201. // imaging.
  202. // 1) The part should look at the given facet and its frame.
  203. //    Both the frame and the facet may have some partInfo that
  204. //    the part has placed there, which the part can use to
  205. //    decide how it will display itself.  The frame also has
  206. //    viewType and presentation fields, which indicate what kind
  207. //    of view of the part should display.
  208. // 2) The part should examine its canvas to see how it should
  209. //    be imaged. The canvas can be obtained from the facet via
  210. //    ODFacet::GetCanvas(). If the canvas’ isDynamic flag is
  211. //    kODTrue, the part is imaging onto a dynamic device like
  212. //    a CRT; otherwise, it is imaging to a static device like
  213. //    a printer. The part will probably display its content
  214. //    differently for static and dynamic views. For instance,
  215. //    it should not display scroll bars on a static canvas.
  216. // 3) The part must make sure the platform graphics system is
  217. //    prepared to draw into the correct context for the facet.
  218. //    On the Macintosh using QuickDraw, it is necessary to call
  219. //    SetPort() for the appropriate canvas, and set up other
  220. //    attributes of the drawing environment. A FocusLib library
  221. //    is supplied to help focus drawing commands to a facet.
  222. //    Make sure to clip to the facet’s clipShape (FocusLib
  223. //    does this for you).
  224. // 4) Draw the part’s contents.
  225. // 5) Restore the old graphics environment.
  226. //
  227. // Part editors may sometimes need to display their parts
  228. // asynchronously, that is, not in response to a ::Draw() call.
  229. // This process is very similar to the basic drawing recipe,
  230. // with minor modifications.
  231. // 1) Determine which of the part’s frames should be drawn. A part
  232. //    may have multiple display frames, and more than one may need
  233. //    updating. Parts store their display frames in whatever way
  234. //    they want, so we can’t tell you how to find them here.
  235. // 2) For each frame being displayed, all facets must be drawn.
  236. //    ODFrame::CreateFrameFacetIterator() returns an iterator
  237. //    which will list all the facets of a frame. Draw the part’s
  238. //    contents in each of these facets, using the recipe above.
  239. // 3) After drawing in a facet, call ODFacet::DrawnIn() on it to
  240. //    tell it you’ve drawn in it asynchronously. If the facet is
  241. //    on an offscreen canvas, this lets it get copied into the window.
  242.  
  243. //----------------------------------------------------------------------------------------
  244.  
  245. void Explain_CanvasUpdated() {}
  246.  
  247. // Notifies the part that a canvas that it owns has been
  248. // updated and that its contents need to be copied to its
  249. // parent canvas.
  250. //
  251. // Called by the facet object.
  252. //
  253. // The data must be copied from an off-screen canvas,
  254. // transformed, and then placed in the containing canvas.
  255.  
  256. //----------------------------------------------------------------------------------------
  257.  
  258. void Explain_HighlightChanged() {}
  259.  
  260. // Notifies the part that the highlight state of one of its
  261. // frames has been changed.
  262. //
  263. // Called by the frame object.
  264. //
  265. // It adjusts this part's presentation in the facet to its
  266. // new highlight state. New state may be found by calling
  267. // facet->GetHighlight(). It passes notification to embedded
  268. // parts.
  269.  
  270. //----------------------------------------------------------------------------------------
  271.  
  272. void Explain_GetPrintResolution() {}
  273.  
  274. // Returns the minimum desired resolution in dots per inch
  275. // that this part requires for printing the contents of the
  276. // specified frame.
  277. //
  278. // Called by part or the application and is used in performing
  279. // printing.
  280.  
  281. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  282. // DRAG AND DROP
  283. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  284.  
  285. void Explain_DragLeave() {}
  286.  
  287. // Signals that the drag operation is complete, and so
  288. // deactivates the part from drag tracking.
  289. //
  290. // This method un-highlights any content previously highlighted
  291. // during drag tracking. It also removes the drag target border.
  292. // Before calling this method you must ensure that the part was
  293. // previously activated via DragEnter().  After executing this
  294. // method successfully, the part is no longer active, and cannot
  295. // receive further DragWithin() or Drop() messages.
  296. //
  297. // DragLeave() is called when the mouse leaves a droppable frame.
  298. // This allows the part to clean up after a drag within it
  299. // (e.g., removing adornment on the frame, changing the cursor
  300. // back to its original form).
  301.  
  302. //----------------------------------------------------------------------------------------
  303.  
  304. void Explain_Drop() {}
  305.  
  306. // Transfers the dragged data into this part.
  307. //
  308. // Called by the facet object.
  309. //
  310. // Respond to the Drop operation. This might involve moving or
  311. // copying data in to the part, or some other response entirely.
  312. // However, the response should use the data returned from the
  313. // dropInfo iterator to perform the operation. Before calling
  314. // this method, you must ensure that the part was previously
  315. // activated via DragEnter().
  316. //
  317. // Don't forget whether the drop is a move or a copy.
  318. //
  319. // Drop() is called when the mouse is released within a part which
  320. // owns the facet. The part can then figure out whether it can
  321. // receive the dragged object using the ODDragItemIterator passed
  322. // in. The following is a sample code fragment for incorporating
  323. // text into a part.
  324. //
  325. // The destination part should return an appropriate ODDropResult
  326. // from Drop(). This result tells the source part (via the system)
  327. // whether the drop is accepted.
  328.  
  329. //----------------------------------------------------------------------------------------
  330.  
  331. void Explain_DragWithin() {}
  332.  
  333. // Tracks the drag operation, and provides graphical feedback
  334. // regarding possible drop targets.
  335. //
  336. // This method highlights the appropriate content to provide
  337. // feedback about potential drop targets, based on type of dragged
  338. // data. It gets the type information out of the dragInfo. During
  339. // drag tracking (DragEnter, DragWithin) the part should never
  340. // attempt to read data from any of the storage units supplied by
  341. // the iterator. The part should only inspect the type of the
  342. // dragged data. Before calling tis method, you must ensure that
  343. // the part was previously activated via DragEnter().
  344. //
  345. // DragWithin() is called continuously when the mouse is still in
  346. // the facet. This allows the part to do any processing desired.
  347. // One good example is when the frame has several hot spots where
  348. // objects can be dropped. If the mouse is not over these hot spots,
  349. // the cursor may need to be changed to reflect that the no
  350. // dropping can be done there even though it is still in a
  351. // droppable frame. Again, a ODDragItemIterator is passed in so
  352. // that the part can examine the availabe data types of the dragged
  353. // objects.
  354. //
  355. // DragWithin() also provides a chance for the part to examine the
  356. // state of the machine. For example, some part may want to find
  357. // out whether the modifier keys are down or not.
  358.  
  359. //----------------------------------------------------------------------------------------
  360.  
  361. void Explain_DragEnter() {}
  362.  
  363. // Activates the part used to track the drag.
  364. //
  365. // Called by the facet object.
  366. //
  367. // The part should display a drag target border within the facet.
  368. // During drag tracking (DragEnter, DragWithin) the part should
  369. // never attempt to read data from any of the storage units supplied
  370. // by the iterator. The part should only inspect the type of the
  371. // dragged data. Before calling this method, you must ensure that
  372. // the part is ready to receive DrawWithin messages.
  373. //
  374. // DragEnter() is called when the mouse enters a facet.  The part
  375. // should examine the available data types of the dragged items
  376. // using the ODDragItemIterator passed in.  If the part can handle
  377. // a drop of the dragged object, it should provide the appropriate
  378. // feedback (e.g., adorning the droppable frame, changing the cursor).
  379. // If the destination part cannot handle the data types, nothing
  380. // should be done.
  381.  
  382. //----------------------------------------------------------------------------------------
  383.  
  384. void Explain_DropCompleted() {}
  385.  
  386. // Notifies the part that the drop is completed.
  387. //
  388. // Called by the dragAndDrop object.
  389. //
  390. // DropCompleted is a peculiar method. If DragAndDrop::StartDrag is
  391. // synchronous, the return code to DragAndDrop::StartDrag is the
  392. // drop result. Part::DropCompleted does not need to be called.
  393. // However, if it is required that DragAndDrop::StartDrag returns
  394. // immediately, there needs to be a way to notify the result of the
  395. // drop. Before calling this method, you must ensure that the part
  396. // previously started an asynchronous drag.
  397.  
  398. //----------------------------------------------------------------------------------------
  399.  
  400. void Explain_FulfillPromise() {}
  401.  
  402. // Fulfills a previously made promise by providing the actual
  403. // data the promise represents.
  404. //
  405. // The promiseSUView is a view into the same storage unit value
  406. // that is created by SetPromiseValue. The information about the
  407. // promise is encoded in the promiseSUView in the Part Handler's
  408. // own internal format. The promise data is written into the
  409. // promiseSUView replacing the data stored in the part handler's
  410. // format.
  411. //
  412. // When the promise was made, a record of it was kept by this part.
  413. // The promiseSUView contains the part's information for that promise.
  414. // The part uses the data in the promiseSUView to determine which
  415. // data to move/copy. The part then writes the data into the
  416. // promiseSUView.
  417. //
  418. // The format of a promise is determined by the part. The only
  419. // restriction is that a promise must be able to be written to
  420. // a Storage Unit Value.
  421. //
  422. // The destination part does not even know that the fulfilment
  423. // of a promise is taking place.
  424.  
  425. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  426. // EMBEDDING
  427. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  428.  
  429. void Explain_ContainingPartPropertiesChanged() {}
  430.  
  431. // Used by ContainingPart to inform the contained part of
  432. // changes to the content properties of that object within
  433. // the containing part’s content model that encapsulates the
  434. // embedded frame.
  435. //
  436. // This method inspects “propertyUnit” for properties that this
  437. // part can understand. Where applicable, it incorporate those
  438. // properties into part's content data. It ignores inapplicable
  439. // properties, without signalling an error.
  440.  
  441. //----------------------------------------------------------------------------------------
  442.  
  443. void Explain_GetContainingPartProperties() {}
  444.  
  445. // Used by an embedded part to create a storage unit and write
  446. // properties that the containing part associates with the
  447. // embedded frame into it, before returning it.
  448. //
  449. // Called by an embedded part.
  450.  
  451. //----------------------------------------------------------------------------------------
  452.  
  453. void Explain_RevealFrame() {}
  454.  
  455. // Asks a part to make an embedded frame visible.
  456. //
  457. // Called by an embedded part.
  458. //
  459. // This method scrolls one of this part's display frame's to make
  460. // the embedded frame visible therein. If this part has no visible
  461. // frames, it asks a containing part to reveal one of them. If no
  462. // display frames for the part currently exist, or if this part's
  463. // containing frame can't reveal the display frame, it opens a frame
  464. // in a new window.
  465.  
  466. //----------------------------------------------------------------------------------------
  467.  
  468. void Explain_EmbeddedFrameSpec() {}
  469.  
  470. // Creates an object specifier for the embedded frame.
  471. //
  472. // If this part is itself embedded, this method asks its containing
  473. // part for the specifier for the part's display frame, then
  474. // concatenates the specifier for that embedded frame.
  475.  
  476. //----------------------------------------------------------------------------------------
  477.  
  478. void Explain_CreateEmbeddedFramesIterator() {}
  479.  
  480. // Creates an object that will iterate over the frames that
  481. // are embedded within a display frame of this part.
  482. //
  483. // To indicate all the display frames, use kODNull for the frame
  484. // parameter.
  485.  
  486. //----------------------------------------------------------------------------------------
  487.  
  488. void Explain_EmbeddedFrameChanged() {}
  489.  
  490. // Notifies the containing part that the content displayed
  491. // in the argument “embedded frame” has changed.
  492. //
  493. // Called by an frame object belonging to an embedded part when
  494. // the frame object's ContentChanged method is called.
  495. //
  496. // The part should call the ContentChanged method of any of its
  497. // frames that would be interested in this information. This
  498. // method should only be called by frame objects. The part is
  499. // not responsible for passing this notification on to its
  500. // containing part. The part may ignore this notification if it
  501. // is uninterested in changes to embedded content. A part should
  502. // wait a certain length of time (a second perhaps) before
  503. // updating its display so that subsequent calls to
  504. // EmbeddedFrameChanged with the same ODChangeID don’t result
  505. // in multiple updates for the same change.After executing this
  506. // method successfully, the ContentChanged method of any of the
  507. // part's frames may have been called and the part may have
  508. // taken action to update its display.
  509.  
  510. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  511. // EVENTS
  512. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  513.  
  514. void Explain_HandleEvent() {}
  515.  
  516. // Below is some documentation for this method.  If you don't care for
  517. // being here, then just delete it.
  518. //
  519. // The frame and facet parameters of HandleEvent() may be
  520. // kODNULL, depending on the kind of event.
  521. //
  522. // Parts must handle the following events, which correspond to
  523. // standard Macintosh events:
  524. //
  525. //    kODEvtNull
  526. //     kODEvtMouseDown
  527. //     kODEvtMouseUp
  528. //     kODEvtKeyDown
  529. //     kODEvtKeyUp
  530. //     kODEvtAutoKey
  531. //     kODEvtUpdate
  532. //     kODEvtActivate
  533. //     kODEvtOS
  534. //
  535. // Null Events --
  536. // In order to receive null events (i.e. idle time), parts must call
  537. // ODDispatcher::RegisterIdle(), specifying the part, a frame
  538. // (optional) and idle frequency. The part will receive a null event
  539. // for each frame registered. ODDispatcher::GetSleepTime() is called
  540. // by the shell, and the value passed to WaitNextEvent. An appropriate
  541. // sleep time is computed based on the idle frequencies of registered
  542. // idle frames.
  543. //
  544. // Mouse Events --
  545. // Unmodified mouse events are delivered to the facet under the mouse
  546. // location using Part::HandleEvent().
  547. //
  548. // Shift-Click and Command-Click go to the frame with the selection
  549. // focus.  Mouse events in window title bars are converted to window
  550. // events. (See below)  Mouse down events in the menu bar are converted
  551. // to menu events. (See below)
  552. //
  553. // Keyboard Events --
  554. // Keyboard events go to the frame with the keyboard focus, with the
  555. // exception of the Page Up, Page Down, Home and End keys, which will
  556. // go to the frame with the scrolling focus, if there is one.
  557. //
  558. // Update Events --
  559. // Update events are not passed to Part::HandleEvent(). Rather
  560. // Part::Draw() will be called for each facet in the window.
  561. //
  562. // Activate Events --
  563. // Activate events are also delivered to each facet, using
  564. // Part::HandleEvent().
  565. //
  566. // Disk Events --
  567. // Currently, disk events are not distributed to parts.
  568. // But where do they go???
  569. //
  570. // OS Events --
  571. // Suspend/Resume events are delivered to each facet in each
  572. // window using Part::HandleEvent().
  573. //
  574. // Mouse Moved events are not passed to Part::HandleEvent().
  575. // They are handled by the dispatcher, and translated into calls
  576. // to Part::MouseEnter(), MouseWithin() and MouseLeave().
  577. // See Cursor Tracking below.
  578. //
  579. // Menu Events --
  580. // OpenDoc converts a mouse down in the menu bar, or its
  581. // command-key equivalent, into a menu event of type kODEvtMenu.
  582. //
  583. // The message field of the event record contains the result
  584. // returned by MenuSelect() or MenuKey(). i.e. the menu is in
  585. // the high word, and the item in the low word. The part can
  586. // obtain a command number using ODMenuBar::GetCommand().
  587. //
  588. // Window Events --
  589. // Events in the title bar of a window (eg. clicking in the
  590. // close box) are usually handled by the shell, but are first
  591. // offered to the root part of the window. Parts which wish to
  592. // intercept these events (perhaps to hide rather than close a
  593. // window) must handle the following event: kODEvtWindow
  594. // The message field of the event contains the part code, as
  595. // returned by FindWindow().
  596. //
  597. // Events in Embedded Frames --
  598. // Parts which support embedding may also receive the following events:
  599. //
  600. //    kODEvtMouseDownEmbedded
  601. //    kODEvtMouseUpEmbedded
  602. //    kODEvtMouseDownBorder
  603. //    kODEvtMouseUpBorder
  604. //
  605. // If the user clicks in the active border, the containing
  606. // facet/frame/part will receive a kODEvtMouseDownBorder event.
  607. // The message field of the event record contains the embedded facet.
  608. //
  609. // Similarly, if the user clicks in an embedded frame with the
  610. // “frozen” or “selected” property set, a kODEvtMouseDownEmbedded
  611. // event is directed to the containing frame.
  612. //
  613. // If the user shift-clicks or command-clicks in a frame which is
  614. // embedded in the frame with the selection focus, then the latter
  615. // frame gets a kODEvtMouseDownEmbedded event.
  616. //
  617. // Cursor Tracking --
  618. // OpenDoc tracks cursor movement (with the mouse button up), and
  619. // calls MouseEnter() when the cursor first moves into a facet, and
  620. // MouseLeave() when the cursor leaves the facet. A part can change
  621. // the cursor on MouseEnter, and set it to the arrow on MouseLeave.
  622. //
  623. // This process is triggered by the shell calling
  624. // ODDispatcher::GetMouseRegion() and passing the result to
  625. // WaitNextEvent(). The region is only recomputed when necessary.
  626. // If the cursor is motionless within a facet, the shell application
  627. // goes to sleep because OpenDoc computes a mouse region containing
  628. // just the cursor location. The part can make this region larger
  629. // by calling ODDispatcher::SetMouseRegion(). In a future release,
  630. // OpenDoc will also compute a suitably large sleep region if the
  631. // cursor is not within any facet.
  632. //
  633. // Modal Focus --
  634. // Some events are constrained by the modal focus. For example a
  635. // mouse click outside the frame with the modal focus will be sent
  636. // to the modal focus frame, but a click in an embedded frame
  637. // within the modal focus frame will go to the embedded frame.
  638. //
  639. // Propagating Events --
  640. // If a containing part sets the “DoesPropagateEvents” property of
  641. // an embedded frame, the containing part will receive events not
  642. // handled by the embedded frame. A part which does this will have
  643. // to inspect the frame passed to HandleEvent() to determine if it
  644. // is one of its display frames.
  645.  
  646. //----------------------------------------------------------------------------------------
  647.  
  648. void Explain_AdjustMenus() {}
  649.  
  650. // Not complete.
  651.  
  652. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  653. // FOCUSING
  654. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  655.  
  656. void Explain_BeginRelinquishFocus() {}
  657.  
  658. //----------------------------------------------------------------------------------------
  659.  
  660. void Explain_CommitRelinquishFocus() {}
  661.  
  662. // No choices to be made here.  It's too late to say no.  We are
  663. // losing the focus if we are here.  Getting called here means
  664. // that BeginRelinquishFocus has already agreed that losing focus
  665. // is okay.  If you don't want this to be happening, then you need
  666. // to do something in BeginRelinquishFocus.
  667. //
  668. // The way that some other samples are currently written I believe
  669. // to be in error.  The recipes say that when this is called, it
  670. // has already been decided that, focus-wise, you lose.  Therefore
  671. // there should be no conditions on calling FocusLost.
  672.  
  673. //----------------------------------------------------------------------------------------
  674.  
  675. void Explain_AbortRelinquishFocus() {}
  676.  
  677. // Being here means that BeginRelinquishFocus said no to one of the foci.
  678. // You are being informed of this because you may have already taken action
  679. // based on a previous focus.  Note that if foci are managed as a set, if
  680. // BeginRelinquishFocus says false to any of the foci, then no action is
  681. // taken.  If however the foci are tested one at a time, it is possible that
  682. // the part has already taken action based on the first foci, and therefore
  683. // needs to undo something once a foci says no thanks.
  684.  
  685. //----------------------------------------------------------------------------------------
  686.  
  687. void Explain_FocusAcquired() {}
  688.  
  689. // Not complete.
  690.  
  691. //----------------------------------------------------------------------------------------
  692.  
  693. void Explain_FocusLost() {}
  694.  
  695. // Not complete.
  696.  
  697. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  698. // FRAME
  699. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  700.  
  701. void Explain_DisplayFrameAdded() {}
  702.  
  703. // Tells a part to add “frame” as one of its display frames.
  704. //
  705. // This method is only called by frame objects during their
  706. // initialization.  Same for RemoveDisplayFrame() and
  707. // CloseDisplayFrame().
  708. //
  709. // The part must record “frame” in whatever internal structures it
  710. // uses to remember its display frames. The new frame will carry a
  711. // suggested viewType and presentation information. The part should
  712. // look at those settings, and decide if it can support them; if not,
  713. // it should update those settings in the frame to reflect a default
  714. // presentation that it can support. Note that the part must support
  715. // the required set of standard viewTypes (frame, icon, small icon,
  716. // thumbnail, etc.). The part will then create the appropriate
  717. // partInfo data and store it in the frame. This data allows the part
  718. // to distinguish the frame from its other display frames, and is
  719. // also a handy place to store other view-related information.
  720. //
  721. // Add the new display frame to the part’s list of its display frames.
  722. // This list, like the part’s other internal structures, is completely
  723. // hidden from OpenDoc. The developer may represent this list any way
  724. // he chooses. The simplest of parts may be able to do without such a
  725. // list, but most parts will require it.
  726. //
  727. // Validate the viewType and presentation of the new frame. The part
  728. // must support the required set of view types. Other kinds of view
  729. // types or presentations are optional. The part should inspect these
  730. // values and correct them if necessary. See the recipe for View Types
  731. // and Presentations for more detail.
  732. //
  733. // Add partInfo to the frame. The partInfo field of a frame is a
  734. // convenient place for a part to store information about that view of
  735. // itself. It can be anything from a simple ID to a pointer to a
  736. // complicated structure or a helper object. The partInfo for a frame
  737. // is stored in the storage unit for the frame, not the part. If the
  738. // part has many frames of which only a few are internalized, only the
  739. // partInfo of those frames will be internalized and take up memory.
  740. //
  741. // The display frames need not be internalized until needed and will be
  742. // done by the containing part. ???
  743.  
  744. //----------------------------------------------------------------------------------------
  745.  
  746. void Explain_DisplayFrameConnected() {}
  747.  
  748. //----------------------------------------------------------------------------------------
  749.  
  750. void Explain_DisplayFrameRemoved() {}
  751.  
  752. // Will remove the frame from the list of display frames.
  753. //
  754. // Called by Frame::Remove().
  755. //
  756. // This method makes whatever other adjustments are necessary
  757. // to deal with removing one of the presentations. This includes
  758. // removing any frames embedded within this display frame.
  759. // Before calling this method, you must ensure that the frame
  760. // has no facets.
  761.  
  762. //----------------------------------------------------------------------------------------
  763.  
  764. void Explain_DisplayFrameClosed() {}
  765.  
  766.  
  767. // Informs a part that one of its display frames is closing.
  768. //
  769. // Called by the frame object.
  770. // The part should remove “frame” from its list of display frames,
  771. // call Frame::Close() on any frames that are embedded within that
  772. // frame, and then release the frame.
  773.  
  774. //----------------------------------------------------------------------------------------
  775.  
  776. void Explain_FrameShapeChanged() {}
  777.  
  778.  
  779. // Notifies the part that the frame shape of one of its
  780. // display frames has been changed by its containing part.
  781. //
  782. // Called by Frame::ChangeFrameShape.
  783. //
  784. // The part should take whatever actions are necessary to respond
  785. // to the new shape. It may need to re-layout its content, change
  786. // its used shape, resize its embedded frames, or something else.
  787. // It also has the option of turning around and asking the frame
  788. // for a different frame shape via RequestFrameShape, though it
  789. // must be able to handle the shape it is given. If the size of
  790. // the frame is not sufficient, the part may ask the containing
  791. // part for a continuation frame via CreateEmbeddedFrame.
  792.  
  793. //----------------------------------------------------------------------------------------
  794.  
  795. void Explain_AttachSourceFrame() {}
  796.  
  797. // Called by the object that requested creation of a frame,
  798. // immediately after the creation of the frame.
  799. //
  800. // Calling this method associates a “source frame” with a display
  801. // frame of a part. This tells the part to keep two or more of its
  802. // display frames synchronized.
  803. //
  804. // A part will receive this call just after a display frame has
  805. // been added. Attaching a source frame should cause the display
  806. // frame to look identical to it. If presentations differ, it
  807. // causes the display frame to be equivalent to it. This causes
  808. // duplication of the embedded frames, and ensures that the view
  809. // in one frame is updated when content in the other is changed.
  810. // Before calling this method, you must ensure that both frame
  811. // and sourceFrame are display frames of the part.
  812. //
  813. // The part being displayed should take whatever action necessary
  814. // to synchronize the frames. As a minimum, if the two frames are
  815. // the same kind of presentation, it should duplicate embedded
  816. // frames in one frame into the other.
  817.  
  818. //----------------------------------------------------------------------------------------
  819.  
  820. void Explain_ViewTypeChanged() {}
  821.  
  822. // Notifies the part that the viewType of one of its
  823. // frames has been changed.
  824. //
  825. // Parts must support all standard view types.
  826. // And they are ... ???
  827.  
  828. //----------------------------------------------------------------------------------------
  829.  
  830. void Explain_PresentationChanged() {}
  831.  
  832. // Notifies the part that the presentation kind of one
  833. // of its frames has been changed.
  834. //
  835. // Called by Frame::ChangeViewType().
  836. //
  837. // The part should examine the new view type via
  838. // frame->GetViewType(). If the part does not support that kind
  839. // of view type, it should correct the frame's viewType using
  840. // frame->SetViewType(). Note that parts MUST support the
  841. // standard set of view types (se HI spec). The part should then
  842. // adjust its display in the display frame to be of the new view
  843. // type.
  844.  
  845. //----------------------------------------------------------------------------------------
  846.  
  847. void Explain_SequenceChanged() {}
  848.  
  849. // Informs the part that the sequencing of a group of its
  850. // display frames has been changed.
  851. //
  852. // Called by containing part.
  853. //
  854. // The containing part of frame should call this when adding a new
  855. // frame to the group or re-ordering the frames in the group. A
  856. // single frame of the group is passed as an argument to indicate
  857. // which group of which containing frame has been changed.
  858.  
  859. //----------------------------------------------------------------------------------------
  860.  
  861. void Explain_WritePartInfo() {}
  862.  
  863. // Externalizes the frame's partInfo data onto the frame's
  864. // storage unit.
  865. //
  866. // Called by the frame object.
  867. //
  868. // Duh???
  869.  
  870. //----------------------------------------------------------------------------------------
  871.  
  872. void Explain_ClonePartInfo() {}
  873.  
  874. // Not complete.
  875.  
  876. //----------------------------------------------------------------------------------------
  877.  
  878. void Explain_ReadPartInfo() {}
  879.  
  880. // Internalizes the partInfo for a display frame of this part.
  881. //
  882. //
  883. // Called by the frame object.
  884. //
  885. // The data for the partInfo is stored in a value in the frame's
  886. // storage unit, specified by the suView parameter. It gets the
  887. // data from out of the value, and places it in a block of memory.
  888. // It then returns the memory block to the frame for it to hold.
  889.  
  890. //----------------------------------------------------------------------------------------
  891.  
  892. void Explain_RequestEmbeddedFrame() {}
  893.  
  894. // Asks the part to create a new frame and embed a part in it.
  895. //
  896. // This is only requested by embedded parts which want additional
  897. // frames in which to display in the same containing part.
  898. //
  899. // If this part is a containing part, it should ask the draft to
  900. // create a new frame, and embed the frame in its content.
  901. // “baseFrame” is another display frame of the same part, already
  902. // embedded in the same containing part. The frameShape parameter
  903. // is relative to the frame coordinate system of the baseFrame.
  904. // The containing part decides if it can fulfill the requests for
  905. // frameShape. - if not, it can create the frame where it wants
  906. // and with the shape it chooses. The containing part should assign
  907. // the new frame to the same frameGroup as the baseFrame. If
  908. // isOverlaid is true, the new frame should float above the part's
  909. // content, and should not have to negotiate for space with the part.
  910. // The viewType and presentation are just passed through to
  911. // Draft::CreateFrame().
  912. //
  913. // Note that RequestEmbeddedFrame should only be called by an embedded
  914. // part on its containing part in order to get a sibling frame.  That
  915. // is why this call takes a baseFrame parameter.  The baseFrame must
  916. // already be embedded inside the part receiving the
  917. // RequestEmbeddedFrame message.
  918.  
  919. //----------------------------------------------------------------------------------------
  920.  
  921. void Explain_RemoveEmbeddedFrame() {}
  922.  
  923. // Removes a frame used for viewing an embedded part.
  924. //
  925. // Called by an embedded part.
  926. //
  927. // It is called by an embedded part to indicate it no longer
  928. // needs the frame to display itself.
  929.  
  930. //----------------------------------------------------------------------------------------
  931.  
  932. void Explain_RequestFrameShape() {}
  933.  
  934. // Used by an embedded part to ask for a change in the
  935. // shape of its frame.
  936. //
  937. // Called by Frame::RequestFrameShape().
  938. //
  939. // This method decides what new shape to give the embedded frame,
  940. // using the requested “frameShape” as a guideline. It then
  941. // answers with what shape is actually granted as the return value.
  942. // The requestor must abide by the returned shape, though it may
  943. // make further requests for different shapes or additional frames.
  944.  
  945. //----------------------------------------------------------------------------------------
  946.  
  947. void Explain_UsedShapeChanged() {}
  948.  
  949. // Informs a containing part that the used shape of one of
  950. // its embedded frames has changed.
  951. //
  952. // Called by Frame::ChangeUsedShape().
  953. //
  954. // Containing parts that have arranged their content to conform
  955. // to the used shape of an embedded frame (as in text wrapping)
  956. // will need to adjust the layout of that content for the new
  957. // used shape.
  958.  
  959. //----------------------------------------------------------------------------------------
  960.  
  961. void Explain_AdjustBorderShape() {}
  962.  
  963. // Adjusts the shape of the active frame border of an embedded
  964. // frame.
  965. //
  966. // Called by the arbitrator object.
  967. //
  968. // The “shape” parameter specifies the requested shape. The
  969. // return value specifies that shape as it is obscured by the
  970. // other contents of this part.
  971.  
  972. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  973.  
  974. void Explain_FacetAdded() {}
  975.  
  976. //----------------------------------------------------------------------------------------
  977.  
  978. void Explain_FacetRemoved() {}
  979.  
  980. //----------------------------------------------------------------------------------------
  981.  
  982. void Explain_CanvasChanged() {}
  983.  
  984. // Notifies the part that one of its facets has been moved to
  985. // image on a different canvas.
  986. //
  987. // Called by the facet object.
  988. //
  989. // The part must update any internal state necessary for
  990. // compliance with this method.
  991.  
  992. //----------------------------------------------------------------------------------------
  993.  
  994. void Explain_GeometryChanged() {}
  995.  
  996. // Called by a facet of the part to inform it that the clipping
  997. // shape and/or external transform of that facet has changed.
  998. //
  999. // Called by the facet object.
  1000. //
  1001. // The part should use the new clip shape for display from now
  1002. // on. Parts that display only in response to update events don't
  1003. // need to do anything special, provided they check the clip
  1004. // shape each time they draw. Parts that display asynchronously
  1005. // (like clocks, movies, etc.) must notice their new clipping and
  1006. // limit their display accordingly.
  1007.  
  1008. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1009. // LINKING
  1010. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1011.  
  1012. void Explain_CreateLink() {}
  1013.  
  1014. // Creates a new link object.
  1015. //
  1016. // If a link already exists to the content identified by the data
  1017. // and size arguments, this method returns the link object;
  1018. // otherwise, it creates a new link object, puts in the initial
  1019. // data and returns it to the caller.
  1020. //
  1021. // This method identifies the content to be linked (by resolving
  1022. // the object specifier saved in the data parameter, or by some
  1023. // other means). It then creates a link object to represent the
  1024. // content data. The part must maintain information about what
  1025. // portion of its contents have been linked to it, so that it may
  1026. // notify link clients when that data has been changed. The link
  1027. // created is returned to the caller. Before calling this method,
  1028. // you must ensure that the data identifies some portion of this
  1029. // part's contents. After calling this method successfully, this
  1030. // part maintains a link to the identified content.
  1031.  
  1032. //----------------------------------------------------------------------------------------
  1033.  
  1034. void Explain_LinkUpdated() {}
  1035.  
  1036. // Retrieves the data from the link and incorporates it into
  1037. // this part at the link's destination, thereby replacing any
  1038. // previous content of the link.
  1039.  
  1040. //----------------------------------------------------------------------------------------
  1041.  
  1042. void Explain_RevealLink() {}
  1043.  
  1044.  
  1045. // Reveals data that was previously linked in a window, making it
  1046. // available for viewing in a display frame.
  1047. //
  1048. // Called by ODLinkSource objects.  Should not be called by parts.
  1049. // In some display frame for this part, this method selects the
  1050. // content linked by the linkSource argument, and scrolls it into
  1051. // view. That display frame is made the active frame. If no display
  1052. // frames for the part currently exist, or if this part's containing
  1053. // frame can't reveal the display frame, it opens a frame in a new
  1054. // window.
  1055.  
  1056. //----------------------------------------------------------------------------------------
  1057.  
  1058. void Explain_LinkStatusChanged() {}
  1059.  
  1060. // Allows the part to set the link status of any embedded frames.
  1061. //
  1062. // Called by a part's frame when that frame's ChangeLinkStatus
  1063. // method is called.
  1064. //
  1065. // Frames notify their owner parts that their link status has
  1066. // changed whenever ChangeLinkStatus is called. After this
  1067. // method executes successfully, the part will call
  1068. // ChangeLinkStatus on any embedded frames that are involved
  1069. // in the link in question.
  1070.  
  1071. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1072. // UNDO
  1073. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1074.  
  1075. void Explain_UndoAction() {}
  1076.  
  1077. // Tells the part to undo the action that is described by actionState.
  1078. //
  1079. // Called by the undo object.
  1080.  
  1081. //----------------------------------------------------------------------------------------
  1082.  
  1083. void Explain_RedoAction() {}
  1084.  
  1085. // Tells the part to Redo the action described by actionState.
  1086. //
  1087. // Called by the undo object.
  1088.  
  1089. //----------------------------------------------------------------------------------------
  1090.  
  1091. void Explain_DisposeActionState() {}
  1092.  
  1093. // Tells the part to dispose of the action data.
  1094. //
  1095. // Before calling this method, you must ensure that “actionState”
  1096. // is an action data block previously logged by this part. After
  1097. // calling this method successfully, memory for “actionState” has
  1098. // been reclaimed. It is no longer usable to perform undo operations.
  1099.  
  1100. //----------------------------------------------------------------------------------------
  1101.  
  1102. void Explain_WriteActionState() {}
  1103.  
  1104. // Writes out the actionState data onto a StorageUnitView,
  1105. // and externalizes the undoAction data to the storage unit.
  1106. //
  1107. // Called by the undo object.
  1108.  
  1109. //----------------------------------------------------------------------------------------
  1110.  
  1111. void Explain_ReadActionState() {}
  1112.  
  1113. // Internalizes the undoAction data from the storage unit.
  1114. //
  1115. // This method reads the actionState data from a view on a
  1116. // StorageUnit. It then allocates the memory and passes ownership
  1117. // of the storage to the caller.
  1118.  
  1119. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1120. // BINDING
  1121. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1122.  
  1123. void Explain_ExternalizeKinds() {}
  1124.  
  1125. // Externalizes a representation for each 'kind' that it supports.
  1126. //
  1127. // The part should iterate through all the kinds in 'kindList',
  1128. // and externalize a representation for each that it supports.
  1129. // This call does not specify anything about the ordering of those
  1130. // kinds in the contents property. Before calling this method,
  1131. // you must ensure that the part supports a subset of the kinds
  1132. // in 'kindList'. After executing this method successfully, the
  1133. // contents property of the part has a value and representation
  1134. // for each kind in kindListsupported.
  1135.  
  1136. //----------------------------------------------------------------------------------------
  1137.  
  1138. void Explain_ChangeKind() {}
  1139.  
  1140. // Asks a part to change into a new kind of content,
  1141. // i.e. ask an ASCII Text part to change into a Styled Text part.
  1142. //
  1143. // The part should begin using the given kind as its primary kind
  1144. // if it is supported. The first type of the first value in the
  1145. // content property of the part's storage unit should become the
  1146. // given kind. Before calling this method, you must ensure that the
  1147. // part supports the specified kind. After this method is executed
  1148. // successfully, the part's primary kind is the one that was
  1149. // specified in the parameter, and the first type of the first
  1150. // value in the content property of the part's storage unit is of
  1151. // the specified type. When it reads in data, the part uses this
  1152. // representation.
  1153.  
  1154. //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  1155.  
  1156.