home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CAProxyPartStubs.cpp
-
- Contains: ODPart methods unimplemented by CAProxyPart. ODPart is purely
- abstract, so subclasses must provide implementations of all
- methods, even if they're just stubs. The stubs aren't all
- completely empty, but the non-empty ones return the appropriate
- "Duh?" response that tells the caller that the action was
- not handled.
-
- Written by: PartMaker
-
- Change History (most recent first):
-
- <8> 4/8/95 RB Moved TProxyPart::AdjustBorderShape() to
- CAProxyPart.cp
- <7> 4/7/95 SJF CreateLink returns an ODLinkSource* now.
- See revision <11> comments in CAProxyPart.h
- <5> 3/15/95 SJF Split out Drag & Drop and Extension support
- methods
- <3> 2/13/95 SJF Interim checkin to update project database
- <0> 11/16/94 SJF first written
-
- To Do:
- */
-
- #define DEBUGSTR_API(A) /* */
- #define DEBUGSTR_ASSERT(A) /* */
-
-
- #ifndef _EXCEPT_
- #include <Except.h>
- #endif
-
- #ifndef _CAPROXYPART_
- #include "CAProxyPart.h"
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- #include <PlfmDef.h>
-
-
- #define DEBUGSTR_API(A) /* */
- #define DEBUGSTR_ASSERT(A) /* */
-
- //#ifdef applec
- #pragma segment CAProxyPart
- //#endif
-
-
- //-------------------------------------------------------------------------
- // Part Extension
- //-------------------------------------------------------------------------
-
-
-
- void CAProxyPart::MouseEnter(Environment* ev, ODFacet* facet, ODPoint* where)
-
- // Called when the mouse is moved over a display frame of this
- // part (mouse button up).
- //
- // Called by the Dispatcher object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::MouseEnter");
- ODUnused(ev);
- ODUnused(facet);
- ODUnused(where);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::MouseEnter - Shouldn't the CA get this event???");
- }
-
-
-
- void CAProxyPart::MouseWithin(Environment* ev, ODFacet* facet, ODPoint* where)
-
- // Called when the mouse is moved within a display frame of this
- // part (mouse button up).
- //
- // Called by the Dispatcher object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::MouseWithin");
- ODUnused(ev);
- ODUnused(facet);
- ODUnused(where);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::MouseWithin - Shouldn't the CA get this event???");
- }
-
- void CAProxyPart::MouseLeave(Environment* ev, ODFacet* facet)
-
- // Called when the mouse is moved out of a display frame of this
- // part (mouse button up).
- //
- // Called by the Dispatcher object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::MouseLeave");
- ODUnused(ev);
- ODUnused(facet);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::MouseLeave - Shouldn't the CA get this event???");
- }
-
-
-
- //-------------------------------------------------------------------------
- // Binding protocol
- //-------------------------------------------------------------------------
-
-
-
- void CAProxyPart::ChangeKind(Environment* ev, ODType kind)
-
- // Asks a part to change into a new kind of content,
- // i.e. ask an ASCII Text part to change into a Styled Text part.
- //
- // The part should begin using the given kind as its primary kind
- // if it is supported. The first type of the first value in the
- // content property of the part's storage unit should become the
- // given kind. Before calling this method, you must ensure that the
- // part supports the specified kind. After this method is executed
- // successfully, the part's primary kind is the one that was
- // specified in the parameter, and the first type of the first
- // value in the content property of the part's storage unit is of
- // the specified type. When it reads in data, the part uses this
- // representation.
-
- {
- DEBUGSTR_API("\pCAProxyPart::ChangeKind");
- ODUnused(ev);
- ODUnused(kind);
- }
-
-
- //-------------------------------------------------------------------------
- // Embedding protocol
- //-------------------------------------------------------------------------
-
-
- void CAProxyPart::ContainingPartPropertiesUpdated(Environment* ev, ODFrame* displayFrame,
- ODStorageUnit* propertyUnit)
-
- // Used by ContainingPart to inform the contained part of
- // changes to the content properties of that object within
- // the containing part’s content model that encapsulates the
- // embedded frame.
- //
- // This method inspects “propertyUnit” for properties that this
- // part can understand. Where applicable, it incorporate those
- // properties into part's content data. It ignores inapplicable
- // properties, without signalling an error.
-
- {
- DEBUGSTR_API("\pCAProxyPart::ContainingPartPropertiesUpdated");
- ODUnused(ev);
- ODUnused(displayFrame);
- ODUnused(propertyUnit);
- }
-
-
-
- ODStorageUnit* CAProxyPart::AcquireContainingPartProperties(Environment *ev,
- ODFrame* frame)
- {
- DEBUGSTR_API("\pCAProxyPart::GetContainingPartProperties");
- ODUnused(ev);
- ODUnused(frame);
-
- return (kODNULL);
-
- }
-
-
-
- ODBoolean CAProxyPart::RevealFrame(Environment* ev, ODFrame* embeddedFrame, ODShape* revealShape)
-
- // Asks a part to make an embedded frame visible.
- //
- // Called by an embedded part.
- //
- // This method scrolls one of this part's display frame's to make
- // the embedded frame visible therein. If this part has no visible
- // frames, it asks a containing part to reveal one of them. If no
- // display frames for the part currently exist, or if this part's
- // containing frame can't reveal the display frame, it opens a frame
- // in a new window.
-
- {
- DEBUGSTR_API("\pCAProxyPart::RevealFrame");
- ODUnused(ev);
- ODUnused(embeddedFrame);
- ODUnused(revealShape);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::RevealFrame -- huh? Who shows the embedded frames???");
-
- return kODFalse;
- }
-
-
-
- void CAProxyPart::EmbeddedFrameSpec(Environment* ev, ODFrame* embeddedFrame, ODObjectSpec* spec)
-
- // Creates an object specifier for the embedded frame.
- //
- // If this part is itself embedded, this method asks its containing
- // part for the specifier for the part's display frame, then
- // concatenates the specifier for that embedded frame.
-
- {
- DEBUGSTR_API("\pCAProxyPart::EmbeddedFrameSpec");
- ODUnused(ev);
- ODUnused(embeddedFrame);
- ODUnused(spec);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::EmbeddedFrameSpec - Who's trying to embed me?");
- }
-
-
-
-
- //-------------------------------------------------------------------------
- // Frame protocol
- //-------------------------------------------------------------------------
-
-
-
- void CAProxyPart::AttachSourceFrame(Environment* ev, ODFrame* frame, ODFrame* sourceFrame)
-
- // Called by the object that requested creation of a frame,
- // immediately after the creation of the frame.
- //
- // Calling this method associates a “source frame” with a display
- // frame of a part. This tells the part to keep two or more of its
- // display frames synchronized.
- //
- // A part will receive this call just after a display frame has
- // been added. Attaching a source frame should cause the display
- // frame to look identical to it. If presentations differ, it
- // causes the display frame to be equivalent to it. This causes
- // duplication of the embedded frames, and ensures that the view
- // in one frame is updated when content in the other is changed.
- // Before calling this method, you must ensure that both frame
- // and sourceFrame are display frames of the part.
- //
- // The part being displayed should take whatever action necessary
- // to synchronize the frames. As a minimum, if the two frames are
- // the same kind of presentation, it should duplicate embedded
- // frames in one frame into the other.
-
- {
- DEBUGSTR_API("\pCAProxyPart::AttachSourceFrame");
- ODUnused(ev);
- ODUnused(frame);
- ODUnused(sourceFrame);
- }
-
-
-
- void CAProxyPart::ViewTypeChanged(Environment* ev, ODFrame* frame)
-
- // Notifies the part that the viewType of one of its
- // frames has been changed.
- //
- // Parts must support all standard view types.
- // And they are ... ???
-
- {
- DEBUGSTR_API("\pCAProxyPart::ViewTypeChanged");
- ODUnused(ev);
- ODUnused(frame);
- }
-
-
-
- void CAProxyPart::PresentationChanged(Environment* ev, ODFrame* frame)
-
- // Notifies the part that the presentation kind of one
- // of its frames has been changed.
- //
- // Called by Frame::ChangeViewType().
- //
- // The part should examine the new view type via
- // frame->GetViewType(). If the part does not support that kind
- // of view type, it should correct the frame's viewType using
- // frame->SetViewType(). Note that parts MUST support the
- // standard set of view types (se HI spec). The part should then
- // adjust its display in the display frame to be of the new view
- // type.
-
- {
- DEBUGSTR_API("\pCAProxyPart::PresentationChanged");
- ODUnused(ev);
- ODUnused(frame);
- }
-
-
-
- void CAProxyPart::SequenceChanged(Environment* ev, ODFrame* frame)
-
- // Informs the part that the sequencing of a group of its
- // display frames has been changed.
- //
- // Called by containing part.
- //
- // The containing part of frame should call this when adding a new
- // frame to the group or re-ordering the frames in the group. A
- // single frame of the group is passed as an argument to indicate
- // which group of which containing frame has been changed.
-
- {
- DEBUGSTR_API("\pCAProxyPart::SequenceChanged");
- ODUnused(ev);
- ODUnused(frame);
- }
-
-
-
- void CAProxyPart::WritePartInfo(Environment* ev, ODInfoType partInfo,
- ODStorageUnitView* storageUnitView)
-
- // Externalizes the frame's partInfo data onto the frame's
- // storage unit.
- //
- // Called by the frame object.
- //
- // Duh???
-
- {
- DEBUGSTR_API("\pCAProxyPart::WritePartInfo");
- ODUnused(ev);
- ODUnused(partInfo);
- ODUnused(storageUnitView);
- }
-
-
-
- ODInfoType CAProxyPart::ReadPartInfo(Environment* ev, ODFrame* frame, ODStorageUnitView* storageUnitView)
-
- // Internalizes the partInfo for a display frame of this part.
- //
- //
- // Called by the frame object.
- //
- // The data for the partInfo is stored in a value in the frame's
- // storage unit, specified by the suView parameter. It gets the
- // data from out of the value, and places it in a block of memory.
- // It then returns the memory block to the frame for it to hold.
-
- {
- DEBUGSTR_API("\pCAProxyPart::ReadPartInfo");
- ODUnused(ev);
- ODUnused(frame);
- ODUnused(storageUnitView);
- return kODNULL;
- }
-
- void CAProxyPart::ClonePartInfo(Environment* ev,
- ODDraftKey key,
- ODInfoType partInfo,
- ODStorageUnitView* storageUnitView,
- ODFrame* scope)
-
- // Internalizes the partInfo for a display frame of this part.
- //
- //
- // Called by the frame object.
- //
- // The data for the partInfo is stored in a value in the frame's
- // storage unit, specified by the suView parameter. It gets the
- // data from out of the value, and places it in a block of memory.
- // It then returns the memory block to the frame for it to hold.
-
- {
- DEBUGSTR_API("\pCAProxyPart::ReadPartInfo");
- ODUnused(ev);
- ODUnused(key);
- ODUnused(partInfo);
- ODUnused(storageUnitView);
- ODUnused(scope);
- }
-
-
- ODFrame* CAProxyPart::RequestEmbeddedFrame(Environment* ev, ODFrame* containingFrame,
- ODFrame* baseFrame,
- ODShape* frameShape,
- ODPart* embedPart,
- ODTypeToken viewType,
- ODTypeToken presentation,
- ODBoolean isOverlaid)
-
- // Asks the part to create a new frame and embed a part in it.
- //
- // This is only requested by embedded parts which want additional
- // frames in which to display in the same containing part.
- //
- // If this part is a containing part, it should ask the draft to
- // create a new frame, and embed the frame in its content.
- // “baseFrame” is another display frame of the same part, already
- // embedded in the same containing part. The frameShape parameter
- // is relative to the frame coordinate system of the baseFrame.
- // The containing part decides if it can fulfill the requests for
- // frameShape. - if not, it can create the frame where it wants
- // and with the shape it chooses. The containing part should assign
- // the new frame to the same frameGroup as the baseFrame. If
- // isOverlaid is true, the new frame should float above the part's
- // content, and should not have to negotiate for space with the part.
- // The viewType and presentation are just passed through to
- // Draft::CreateFrame().
- //
- // Note that RequestEmbeddedFrame should only be called by an embedded
- // part on its containing part in order to get a sibling frame. That
- // is why this call takes a baseFrame parameter. The baseFrame must
- // already be embedded inside the part receiving the
- // RequestEmbeddedFrame message.
-
- {
- DEBUGSTR_API("\pCAProxyPart::RequestEmbeddedFrame");
- ODUnused(ev);
- ODUnused(containingFrame);
- ODUnused(baseFrame);
- ODUnused(frameShape);
- ODUnused(embedPart);
- ODUnused(viewType);
- ODUnused(presentation);
- ODUnused(isOverlaid);
-
- DEBUGSTR_ASSERT("\pCAProxyPart::RequestEmbeddedFrame -- Need to get a frame from the CA");
- return kODNULL;
- }
-
-
-
-
-
- void CAProxyPart::CanvasChanged(Environment* ev, ODFacet* facet)
-
- // Notifies the part that one of its facets has been moved to
- // image on a different canvas.
- //
- // Called by the facet object.
- //
- // The part must update any internal state necessary for
- // compliance with this method.
-
- {
- DEBUGSTR_API("\pCAProxyPart::CanvasChanged");
- ODUnused(ev);
- ODUnused(facet);
- }
-
-
-
- void CAProxyPart::GeometryChanged(Environment* ev, ODFacet* facet,
- ODBoolean clipShapeChanged,
- ODBoolean externalTransformChanged)
-
- // Called by a facet of the part to inform it that the clipping
- // shape and/or external transform of that facet has changed.
- //
- // Called by the facet object.
- //
- // The part should use the new clip shape for display from now
- // on. Parts that display only in response to update events don't
- // need to do anything special, provided they check the clip
- // shape each time they draw. Parts that display asynchronously
- // (like clocks, movies, etc.) must notice their new clipping and
- // limit their display accordingly.
-
- {
- DEBUGSTR_API("\pCAProxyPart::GeometryChanged");
- ODUnused(ev);
- ODUnused(facet);
- ODUnused(clipShapeChanged);
- ODUnused(externalTransformChanged);
- }
-
-
-
- ODULong CAProxyPart::GetPrintResolution(Environment* ev, ODFrame* frame)
-
- // Returns the minimum desired resolution in dots per inch
- // that this part requires for printing the contents of the
- // specified frame.
- //
- // Called by part or the application and is used in performing
- // printing.
-
- {
- DEBUGSTR_API("\pCAProxyPart::GetPrintResolution");
- ODUnused(ev);
- ODUnused(frame);
- return 0;
- }
-
-
-
- //-------------------------------------------------------------------------
- // From Linking protocol
- //-------------------------------------------------------------------------
-
-
-
- ODLinkSource* CAProxyPart::CreateLink(Environment* ev, ODByteArray* data)
-
- // Creates a new link object.
- //
- // If a link already exists to the content identified by the data
- // and size arguments, this method returns the link object;
- // otherwise, it creates a new link object, puts in the initial
- // data and returns it to the caller.
- //
- // This method identifies the content to be linked (by resolving
- // the object specifier saved in the data parameter, or by some
- // other means). It then creates a link object to represent the
- // content data. The part must maintain information about what
- // portion of its contents have been linked to it, so that it may
- // notify link clients when that data has been changed. The link
- // created is returned to the caller. Before calling this method,
- // you must ensure that the data identifies some portion of this
- // part's contents. After calling this method successfully, this
- // part maintains a link to the identified content.
-
- {
- DEBUGSTR_API("\pCAProxyPart::CreateLink");
- ODUnused(ev);
- ODUnused(data);
- return kODNULL;
- }
-
-
-
- void CAProxyPart::LinkUpdated(Environment* ev, ODLink* updatedLink, ODUpdateID id)
-
- // Retrieves the data from the link and incorporates it into
- // this part at the link's destination, thereby replacing any
- // previous content of the link.
-
- {
- DEBUGSTR_API("\pCAProxyPart::LinkUpdated");
- ODUnused(ev);
- ODUnused(updatedLink);
- ODUnused(id);
- }
-
-
-
- void CAProxyPart::RevealLink(Environment* ev, ODLinkSource* linkSource)
-
- // Reveals data that was previously linked in a window, making it
- // available for viewing in a display frame.
- //
- // Called by ODLinkSource objects. Should not be called by parts.
- // In some display frame for this part, this method selects the
- // content linked by the linkSource argument, and scrolls it into
- // view. That display frame is made the active frame. If no display
- // frames for the part currently exist, or if this part's containing
- // frame can't reveal the display frame, it opens a frame in a new
- // window.
-
- {
- DEBUGSTR_API("\pCAProxyPart::RevealLink");
- ODUnused(ev);
- ODUnused(linkSource);
- }
-
-
-
- void CAProxyPart::EmbeddedFrameUpdated(Environment* ev, ODFrame* frame, ODUpdateID change)
-
- // Notifies the containing part that the content displayed
- // in the argument “embedded frame” has changed.
- //
- // Called by an frame object belonging to an embedded part when
- // the frame object's ContentChanged method is called.
- //
- // The part should call the ContentChanged method of any of its
- // frames that would be interested in this information. This
- // method should only be called by frame objects. The part is
- // not responsible for passing this notification on to its
- // containing part. The part may ignore this notification if it
- // is uninterested in changes to embedded content. A part should
- // wait a certain length of time (a second perhaps) before
- // updating its display so that subsequent calls to
- // EmbeddedFrameChanged with the same ODChangeID don’t result
- // in multiple updates for the same change.After executing this
- // method successfully, the ContentChanged method of any of the
- // part's frames may have been called and the part may have
- // taken action to update its display.
-
- {
- DEBUGSTR_API("\pCAProxyPart::EmbeddedFrameChanged");
- ODUnused(ev);
- ODUnused(change);
- ODUnused(frame);
- }
-
-
-
- void CAProxyPart::LinkStatusChanged(Environment* ev, ODFrame* frame)
-
- // Allows the part to set the link status of any embedded frames.
- //
- // Called by a part's frame when that frame's ChangeLinkStatus
- // method is called.
- //
- // Frames notify their owner parts that their link status has
- // changed whenever ChangeLinkStatus is called. After this
- // method executes successfully, the part will call
- // ChangeLinkStatus on any embedded frames that are involved
- // in the link in question.
-
- {
- DEBUGSTR_API("\pCAProxyPart::LinkStatusChanged");
- ODUnused(ev);
- ODUnused(frame);
- }
-
-
-
- //-------------------------------------------------------------------------
- // Undo protocol
- //-------------------------------------------------------------------------
-
-
-
- void CAProxyPart::UndoAction(Environment* ev, ODActionData* actionState)
-
- // Tells the part to undo the action that is described by actionState.
- //
- // Called by the undo object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::UndoAction");
- ODUnused(ev);
- ODUnused(actionState);
- }
-
-
-
- void CAProxyPart::RedoAction(Environment* ev, ODActionData* actionState)
-
- // Tells the part to Redo the action described by actionState.
- //
- // Called by the undo object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::RedoAction");
- ODUnused(ev);
- ODUnused(actionState);
- }
-
-
-
- void CAProxyPart::DisposeActionState(Environment* ev, ODActionData* actionState,
- ODDoneState doneState)
-
- // Tells the part to dispose of the action data.
- //
- // Before calling this method, you must ensure that “actionState”
- // is an action data block previously logged by this part. After
- // calling this method successfully, memory for “actionState” has
- // been reclaimed. It is no longer usable to perform undo operations.
-
- {
- DEBUGSTR_API("\pCAProxyPart::DisposeActionState");
- ODUnused(ev);
- ODUnused(actionState);
- ODUnused(doneState);
- }
-
-
-
- void CAProxyPart::WriteActionState(Environment* ev, ODActionData* actionState,
- ODStorageUnitView* storageUnitView)
-
- // Writes out the actionState data onto a StorageUnitView,
- // and externalizes the undoAction data to the storage unit.
- //
- // Called by the undo object.
-
- {
- DEBUGSTR_API("\pCAProxyPart::WriteActionState");
- ODUnused(ev);
- ODUnused(actionState);
- ODUnused(storageUnitView);
- }
-
-
-
- ODActionData CAProxyPart::ReadActionState(Environment* ev, ODStorageUnitView* storageUnitView)
-
- // Internalizes the undoAction data from the storage unit.
- //
- // This method reads the actionState data from a view on a
- // StorageUnit. It then allocates the memory and passes ownership
- // of the storage to the caller.
-
- {
- ODActionData actionData;
- DEBUGSTR_API("\pCAProxyPart::ReadActionState");
- ODUnused(ev);
- ODUnused(storageUnitView);
- return (actionData);
- }
-
- //-------------------------------------------------------------------------
- //-------------------------------------------------------------------------
- //-------------------------------------------------------------------------
-
-
-
-
-