Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TSimpleView, MActionTarget, MViewActionHandler, MMouseEventHandler, MDropAcceptor
Inherited By:
None.
Purpose:
Objects of the TMediaView class are created by TMediaPresenter. TMediaView is responsible for delegating the processing of all actions from the player controls to the media presenter. It functions as the wrapper view for any media-specific display subviews and a player control subview. It also handles the drag-and-drop of all the different media types.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TMediaView (const TPresenterReference &, TView * boxViewToAdopt)
- TMediaView ()
Interface Category:
API.
Purpose:
- Creates a TMediaView wrapper view from the designated view object for the specified media presenter.
- Default constructor.
Calling Context:
- Called to create an instance of TMediaView.
- Called by the stream-in operators and derived classes.
Parameters:
- const TPresenterReference & -A reference to the media presenter.
- TView * boxViewToAdopt -A pointer to a layout view object.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TMediaView ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::Hash
virtual long Hash () const
Interface Category:
API.
Purpose:
Returns the hash value that uniquely identifies this object within its type. Hash values are used to build dictionaries of objects.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the hash value that uniquely identifies this object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::operator==
bool operator ==(const TMediaView &) const
Interface Category:
API.
Purpose:
Tests for equality between the specified TMediaView object and this TMediaView object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the two objects are equal; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::operator!=
bool operator != (const TMediaView &) const
Interface Category:
API.
Purpose:
Tests for inequality between the specified TMediaView object and this TMediaView object.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the two objects are different; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::DropAccepted
virtual void DropAccepted()
Interface Category:
API.
Purpose:
Indicates that the drag-and-drop selection was valid and accepted and the implied operation has been carried out.
Calling Context:
Called directly by derived classes.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::AdoptIconView
virtual void AdoptIconView(const TGArea &)
Interface Category:
API.
Purpose:
Adopts an icon view into the media view.
Calling Context:
Called by derived classes to add the icon view to the media view.
Parameters:
- const TGArea & -A reference to the allocated area for the icon.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::AdoptLayoutView
virtual void AdoptLayoutView(TView * view)
Interface Category:
API.
Purpose:
Adopts a layout view to the media view.
Calling Context:
Called directly to add the layout view to the media view.
Parameters:
- TView * view -A pointer to the layout view that is to be added to the media view.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::HandleAllocatedAreaChanged
virtual void HandleAllocatedAreaChanged(const TGArea &)
Interface Category:
API.
Purpose:
Handles a change to the allocated area for the view.
Calling Context:
Called by derived classes when there is a change to the allocated area of the view. Derived classes can override this member function when they want to know when things have changed.
Parameters:
- const TGArea & -A reference to the new TGArea object for the allocated area.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::HandleViewAction
virtual bool HandleViewAction (TViewAction & action)
Interface Category:
API.
Purpose:
Handles actions generated by the view and its subviews and passes them to the media presenter.
Calling Context:
Called to signal that a view action that occurred has been handled.
Parameters:
- TViewAction & action -The action generated by a view or a subview.
Return Value:
Returns true if the action is handled; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::MouseDown
virtual bool MouseDown (TMouseDownEvent &)
Interface Category:
API.
Purpose:
Called when a mouse button has been pressed. The coordinates of the mouse click are given in the handler's view's coordinate system. It is the start of a possible drag-and-drop operation.
Calling Context:
Call this function directly.
Parameters:
- TMouseDownEvent & -The mouse-down event that caused this function to be called.
Return Value:
Returns true if the event was handled; otherwise, returns false .
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function overrides the MMouseEventHandler::MouseDown function to implement the media-specific mouse-down handling behavior.
Member Function: TMediaView::ChoosePreferredType
virtual bool ChoosePreferredType (const TGPoint & whereDropped, const TSequenceOf < TTypeDescription > & availableTypes, TTypeDescription & chosenType) const
Interface Category:
API.
Purpose:
This implements the MDragAcceptor protocol. The function checks for a match on either a clock item type or a media component type that can be accepted by the media view. The clock item type or the component type is checked against the list of available types.
Calling Context:
Call this function directly
Parameters:
- const TGPoint & whereDropped -The TGPoint view coordinates for the location of the item upon which this component has been dropped.
- const TSequenceOf < TTypeDescription > & availableTypes -The list of available types.
- TTypeDescription & chosenType -The type of the item that the component has been dropped on.
Return Value:
Returns true if the component type is found in the list of available component types; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::AcceptDrop
virtual bool AcceptDrop (const TGPoint & whereDropped, const TTypeDescription & theType, const TScrapItem & theItem)
Interface Category:
API.
Purpose:
Indicates whether the drag-and-drop selection was valid and accepted. If accepted, the implied operation has been carried out.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint & whereDropped -The view coordinate location that identifies the item upon which the component was dropped.
- const TTypeDescription & theType -The type of the item.
- const TScrapItem & theItem -The scrap item (the item that was dragged and subsequently dropped).
Return Value:
Returns true if the drop operation is successful; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TMediaView::DrawContents
virtual void DrawContents (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws the icon representing the media data being displayed in the middle of the view.
Calling Context:
It's called the view system, which passes in a grafport to draw into. You do not call this member function.
Parameters:
- TGrafPort & port -The caller must provide the grafport for the DrawContents to draw into.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.