Class: TMediaView

Declaration: MediaUI.h

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.

Member Function: TMediaView::TMediaView

  1. TMediaView (const TPresenterReference &, TView * boxViewToAdopt)
  2. TMediaView ()

Interface Category:

API.

Purpose:

  1. Creates a TMediaView wrapper view from the designated view object for the specified media presenter.
  2. Default constructor.

Calling Context:

  1. Called to create an instance of TMediaView.
  2. Called by the stream-in operators and derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMediaView::~TMediaView

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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.