class CCL::AbstractUserControl

Overview

Base class to implement a user control. More…

#include <usercontrolbase.h>

class AbstractUserControl:
    public CCL::ViewBox,
    public CCL::IUserControl
{
public:
    // methods

    void dispose ();
    virtual tbool CCL_API onViewEvent (const GUIEvent& event);
    virtual IMouseHandler*CCL_API createMouseHandler (const MouseEvent& event);
    virtual ITouchHandler*CCL_API createTouchHandler (const TouchEvent& event);
    virtual IDragHandler*CCL_API createDragHandler (const DragEvent& event);
    virtual IUnknown*CCL_API getController () const;
    virtual IAccessibilityProvider*CCL_API getCustomAccessibilityProvider () const;
    virtual void onViewsChanged ();
    virtual void attached (IView* parent);
    virtual void removed (IView* parent);
    virtual void onActivate (bool state);
    virtual void onSize (PointRef delta);
    virtual void onMove (PointRef delta);
    virtual void onChildSized (IView* child, PointRef delta);
    virtual void onVisualStyleChanged ();
    virtual void onDisplayPropertiesChanged (const DisplayChangedEvent& event);
    virtual void onColorSchemeChanged (const ColorSchemeEvent& event);
    virtual void draw (const DrawEvent& event);
    virtual bool onMouseDown (const MouseEvent& event);
    virtual bool onMouseUp (const MouseEvent& event);
    virtual bool onMouseEnter (const MouseEvent& event);
    virtual bool onMouseMove (const MouseEvent& event);
    virtual bool onMouseLeave (const MouseEvent& event);
    virtual bool onMouseWheel (const MouseWheelEvent& event);
    virtual bool onContextMenu (const ContextMenuEvent& event);
    virtual bool onTrackTooltip (const TooltipEvent& event);
    void setMouseHandler (IMouseHandler* handler);
    virtual bool onGesture (const GestureEvent& event);
    virtual bool onFocus (const FocusEvent& event);
    virtual bool onKeyDown (const KeyEvent& event);
    virtual bool onKeyUp (const KeyEvent& event);
    virtual bool onDragEnter (const DragEvent& event);
    virtual bool onDragOver (const DragEvent& event);
    virtual bool onDragLeave (const DragEvent& event);
    virtual bool onDrop (const DragEvent& event);
    operator IUnknown * ();
};

Inherited Members

public:
    // structs

    struct StyleModifier;

    // methods

    UIDRef getClassID () const;
    void setName (StringRef name);
    String getName () const;
    void setTitle (StringRef title);
    String getTitle () const;
    void setTooltip (StringRef title);
    String getTooltip () const;
    void setTooltipTrackingEnabled (bool state);
    bool isTooltipTrackingEnabled () const;
    StyleRef getStyle () const;
    void setStyle (StyleRef style);
    ITheme& getTheme () const;
    void setTheme (ITheme* theme);
    const IVisualStyle& getVisualStyle () const;
    void setVisualStyle (IVisualStyle* visualStyle);
    void setVisualStyle (const IVisualStyle& visualStyle);
    IUnknown* getController () const;
    bool isAttached () const;
    IWindow* getWindow () const;
    int getSizeMode () const;
    void setSizeMode (int flags);
    void disableSizeMode (bool state = true);
    bool isEnabled () const;
    void enable (bool state);
    int getMouseState () const;
    void setMouseState (int state);
    int getThemeElementState () const;
    bool wantsFocus () const;
    void wantsFocus (bool state);
    bool isLayerBackingEnabled () const;
    void setLayerBackingEnabled (bool state);
    IGraphicsLayer* getGraphicsLayer () const;
    bool isAccessibilityEnabled () const;
    void setAccessibilityEnabled (bool state);
    bool getAttribute (Variant& value, const char* id) const;
    bool setAttribute (const char* id, VariantRef value);
    bool setHelpIdentifier (StringRef id);
    RectRef getSize () const;
    void setSize (RectRef size);
    Rect& getClientRect (Rect& r) const;
    bool getVisibleClient (Rect& r) const;
    Coord getWidth () const;
    Coord getHeight () const;
    Point getPosition () const;
    void setPosition (PointRef pos);
    void setSizeLimits (const SizeLimit& sizeLimits);
    const SizeLimit& getSizeLimits () const;
    void setZoomFactor (float factor);
    float getZoomFactor () const;
    Point& clientToWindow (Point& p) const;
    Point& windowToClient (Point& p) const;
    Point& clientToScreen (Point& p) const;
    Point& screenToClient (Point& p) const;
    IView* getParent () const;
    IView* getParent (UIDRef cid) const;
    IView* getViewAt (int index) const;
    int getViewIndex (const IView* childView) const;
    IViewChildren& getChildren () const;
    void autoSize (tbool horizontal = true, tbool vertical = true);
    void redraw ();
    void invalidate ();
    void invalidate (RectRef rect);
    void updateClient ();
    void updateClient (RectRef rect);
    void scrollClient (RectRef rect, PointRef delta);
    bool makeVisible (RectRef rect, tbool relaxed = false);
    bool takeFocus ();
    bool killFocus ();
    void setCursor (IMouseCursor* cursor);
    bool detectDrag (const MouseEvent& event);
    bool detectDoubleClick (const MouseEvent& event);
    ViewBox& operator = (IView* view);
    operator IView * ();
    IView* operator -> ();

    template  <class T>
    T* as ();

    IView* as ();
    static void setModuleTheme (ITheme* theme);
    static ITheme* getModuleTheme ();
    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;
    virtual tbool CCL_API onViewEvent (const GUIEvent& event) = 0;
    virtual IMouseHandler*CCL_API createMouseHandler (const MouseEvent& event) = 0;
    virtual ITouchHandler*CCL_API createTouchHandler (const TouchEvent& event) = 0;
    virtual IDragHandler*CCL_API createDragHandler (const DragEvent& event) = 0;
    virtual IUnknown*CCL_API getController () const = 0;
    virtual IAccessibilityProvider*CCL_API getCustomAccessibilityProvider () const = 0;

Detailed Documentation

Base class to implement a user control.

Methods

void dispose ()

When attached, the framework view is our owner.

We have to avoid circular references. In general, if the control is passed back to the framework, you do not call dispose. Use this method for clean up if something fails, before passing back the object.

virtual tbool CCL_API onViewEvent (const GUIEvent& event)

Handle view event.

virtual IMouseHandler*CCL_API createMouseHandler (const MouseEvent& event)

Create handler for mouse tracking.

virtual ITouchHandler*CCL_API createTouchHandler (const TouchEvent& event)

Create handler for touch tracking.

virtual IDragHandler*CCL_API createDragHandler (const DragEvent& event)

Create handler for mouse tracking.

virtual IUnknown*CCL_API getController () const

Note: hides ViewBox::getController()!

virtual IAccessibilityProvider*CCL_API getCustomAccessibilityProvider () const

Get custom accessibility provider (optional).

virtual bool onGesture (const GestureEvent& event)

position is in client coordinates

operator IUnknown * ()

Cast to IUnknown (when querying for additional interfaces of a UserControl, e.g.

via UnknownPtr, avoid quering the UserControlHost via ViewBox::operator IView*).