struct CCL::IView

Overview

View interface. More…

#include <iview.h>

struct IView: public CCL::IUnknown
{
    // typedefs

    typedef int AttrID;

    // enums

    enum MouseStates;
    enum SizeModes;
    enum ViewAttributes;

    // methods

    virtual tbool CCL_API getViewAttribute (Variant& value, AttrID id) const = 0;
    virtual tbool CCL_API setViewAttribute (AttrID id, VariantRef value) = 0;
    virtual const IVisualStyle&CCL_API getVisualStyle () const = 0;
    virtual StyleRef CCL_API getStyle () const = 0;
    virtual RectRef CCL_API getSize () const = 0;
    virtual void CCL_API setSize (RectRef size, tbool invalidate = true) = 0;
    virtual tbool CCL_API getVisibleClient (Rect& r) const = 0;
    virtual void CCL_API setSizeLimits (const SizeLimit& sizeLimits) = 0;
    virtual const SizeLimit&CCL_API getSizeLimits () = 0;
    virtual tbool CCL_API hasExplicitSizeLimits () const = 0;
    virtual Point&CCL_API clientToWindow (Point& p) const = 0;
    virtual Point&CCL_API windowToClient (Point& p) const = 0;
    virtual Point&CCL_API clientToScreen (Point& p) const = 0;
    virtual Point&CCL_API screenToClient (Point& p) const = 0;
    virtual IView*CCL_API getParentView () const = 0;
    virtual IView*CCL_API getParentByClass (UIDRef cid) const = 0;
    virtual IWindow*CCL_API getIWindow () const = 0;
    virtual IViewChildren&CCL_API getChildren () const = 0;
    virtual void CCL_API autoSize (tbool horizontal = true, tbool vertical = true) = 0;
    virtual void CCL_API redraw () = 0;
    virtual void CCL_API invalidate (RectRef rect) = 0;
    virtual void CCL_API updateClient (RectRef rect) = 0;
    virtual void CCL_API scrollClient (RectRef rect, PointRef delta) = 0;
    virtual tbool CCL_API makeVisible (RectRef rect, tbool relaxed = false) = 0;
    virtual tbool CCL_API takeFocus (tbool directed = true) = 0;
    virtual tbool CCL_API killFocus () = 0;
    virtual void CCL_API setCursor (IMouseCursor* cursor) = 0;
    virtual tbool CCL_API detectDrag (const MouseEvent& event) = 0;
    virtual tbool CCL_API detectDoubleClick (const MouseEvent& event) = 0;
    virtual IUnknown*CCL_API getController () const = 0;
    virtual IGraphicsLayer*CCL_API getParentLayer (Point& offset) const = 0;
    virtual void CCL_API setZoomFactor (float factor) = 0;
    virtual float CCL_API getZoomFactor () const = 0;
    DECLARE_STRINGID_MEMBER (kHelpId);
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

View interface.

Typedefs

typedef int AttrID

View attribute id.

Methods

virtual tbool CCL_API getViewAttribute (Variant& value, AttrID id) const = 0

Set view attribute.

virtual tbool CCL_API setViewAttribute (AttrID id, VariantRef value) = 0

Get view attribute.

virtual const IVisualStyle&CCL_API getVisualStyle () const = 0

Get the visual style.

virtual StyleRef CCL_API getStyle () const = 0

Get the style flags.

virtual RectRef CCL_API getSize () const = 0

Get size in parent coordinates.

virtual void CCL_API setSize (RectRef size, tbool invalidate = true) = 0

Set size in parent coordinates.

virtual tbool CCL_API getVisibleClient (Rect& r) const = 0

Get size of visible client rectangle.

virtual void CCL_API setSizeLimits (const SizeLimit& sizeLimits) = 0

Set size limits.

virtual const SizeLimit&CCL_API getSizeLimits () = 0

Get size limits.

virtual tbool CCL_API hasExplicitSizeLimits () const = 0

Check if size limits were set explicitly from outside (e.g.

from skin).

virtual Point&CCL_API clientToWindow (Point& p) const = 0

Convert client to window coordinates.

virtual Point&CCL_API windowToClient (Point& p) const = 0

Convert window to client coordinates.

virtual Point&CCL_API clientToScreen (Point& p) const = 0

Convert client to screen coordinates.

virtual Point&CCL_API screenToClient (Point& p) const = 0

Convert screen to client coordinates.

virtual IView*CCL_API getParentView () const = 0

Get parent view.

virtual IView*CCL_API getParentByClass (UIDRef cid) const = 0

Get parent view of given class.

virtual IWindow*CCL_API getIWindow () const = 0

Get window.

virtual IViewChildren&CCL_API getChildren () const = 0

Get view children.

virtual void CCL_API autoSize (tbool horizontal = true, tbool vertical = true) = 0

Adjust size to content.

virtual void CCL_API redraw () = 0

Redraw invalidated area.

virtual void CCL_API invalidate (RectRef rect) = 0

Invalidate part of client area.

virtual void CCL_API updateClient (RectRef rect) = 0

Update part of client area (invalidate + redraw or direct update).

virtual void CCL_API scrollClient (RectRef rect, PointRef delta) = 0

Scroll pixel data in client area.

virtual tbool CCL_API makeVisible (RectRef rect, tbool relaxed = false) = 0

Try to make part of client view visible (e.g.

by scrolling); relaxed: don’t scroll if the rect is already partly visible.

virtual tbool CCL_API takeFocus (tbool directed = true) = 0

Request keyboard focus.

virtual tbool CCL_API killFocus () = 0

Remove keyboard focus (if view currently owns it).

virtual void CCL_API setCursor (IMouseCursor* cursor) = 0

Set mouse cursor (reset when mouse leaves client area).

virtual tbool CCL_API detectDrag (const MouseEvent& event) = 0

Detect drag at given location.

virtual tbool CCL_API detectDoubleClick (const MouseEvent& event) = 0

Detect double click at given location.

virtual IUnknown*CCL_API getController () const = 0

Get associated controller.

virtual IGraphicsLayer*CCL_API getParentLayer (Point& offset) const = 0

Get parent layer, create a root layer if necessary.

virtual void CCL_API setZoomFactor (float factor) = 0

Set zoom factor: factor between original and current “zoomed” size.

virtual float CCL_API getZoomFactor () const = 0

Get zoom factor.