Global Object Functions
[Global defines]

Defines

Typedefs

Functions


Define Documentation

#define CHECKOBJ ( obj   )     ncsIsValidObj((mObject*)obj)

the wrapper of ncsIsValidObj

See also:
ncsIsValidObj

Definition at line 422 of file mobject.h.

#define INSTANCEOF ( obj,
clss   )     ncsInstanceOf((mObject*)(obj), (mObjectClass*)(void*)(&Class(clss)))

A wrapper of ncsInstanceOf, just like java's instanceof.

Example: Test a object is mComponentClass: INSTANCEOF(obj, mComponent)

Definition at line 402 of file mobject.h.

Referenced by ncsIsValidObj().

#define SAFE_CAST ( Type,
obj   )     TYPE_CAST(Type, ncsSafeCast((mObject*)obj,(mObjectClass*)(void*)(&(Class(Type)))))

wrapper of ncsSafeCast, check the class type before cast.

Note:
this macro is same as dynamic_cast in C++
See also:
ncsSafeCast

Definition at line 450 of file mobject.h.

#define SAFE_CAST_CLASS ( Clss,
ClssCast   )     ((ClassType(ClssCast)*)(ncsSafeCastClass((mObjectClass*)Clss, (mObjectClass*)(void*)(&Class(ClssCast)))))

the wrapper of ncsSafeCastClass

Definition at line 468 of file mobject.h.

#define TYPE_CAST ( Type,
obj   )     ((Type*)(obj))

unsafe cast. donot check the type of class

Definition at line 441 of file mobject.h.

#define TYPENAME ( obj   )     ((obj)?(((obj)->_class)?((obj)->_class)->typeName:""):"")

Get the class name form a Object pointer.

Definition at line 379 of file mobject.h.


Typedef Documentation

typedef BOOL(* NCS_CB_ONOBJEVENT)(mObject *self, mObject *sender, int eventId, DWORD param)

The Callback of connection.

Note:
For widgets, only support notification
Parameters:
self The listener pointer
sender The sender of event
eventId the id of event
param the param of event
Returns:
TRUE - continue dispatch the event; FALSE - stop the event.

Definition at line 485 of file mobject.h.


Function Documentation

void deleteObject ( mObject obj  ) 

delete a object intance, like delete operator in C++

Parameters:
obj - the object want to delete
BOOL ncsAddEventListener ( mObject sender,
mObject listener,
NCS_CB_ONOBJEVENT  eventProc,
int  eventId 
)

connect sender object to listener object

Parameters:
sender The sender of event
listener The listener of event
eventProc The processing callback of event
eventId The id of event
Returns:
TRUE - Sucessed, FALSE - Failed
See also:
ncsAddEventListener, ncsAddEventListeners, NCS_CB_ONOBJEVENT
MGNCS_EXPORT BOOL ncsAddEventListeners ( mObject sender,
mObject listener,
NCS_CB_ONOBJEVENT  eventProc,
int *  eventIds 
)

connect a group of events from sender to listener

BOOL ncsAddEventListeners(mObject *sender, \ mObject* listener, \ NCS_CB_ONOBJEVENT eventProc, \ int* eventIds);

Parameters:
sender The sender of events
listener The listener of events
eventProc The processing callback of events
eventIds The id array of events, end by 0
Returns:
TRUE - Sucessed, FALSE - Failed
See also:
ncsAddEventListener, ncsAddEventListeners, NCS_CB_ONOBJEVENT
BOOL ncsInstanceOf ( mObject object,
mObjectClass clss 
)

check an object is the class instance or not, same as instanceof operator in Java

Parameters:
object - the pointer of object being to test
clss - the pointer of class for test
Returns:
TRUE - object is instance of clss, FALSE - not
static inline mObject * ncsIsValidObj ( mObject obj  )  [inline, static]

Check a pointer is a valid mObject or not.

Parameters:
obj - the excpeted object pointer
Returns:
mObject * the pointer of obj or other NULL if obj is an invalid mObject pointer

Definition at line 412 of file mobject.h.

References INSTANCEOF.

void ncsRaiseEvent ( mObject sender,
int  event_id,
DWORD  param 
)

raise an event to listeners

Note:
it will call the callback of NCS_CB_ONOBJEVENT add by ncsAddEventListeners, or ncsAddEventListener
Parameters:
sender event sender
event_id the id of event
param the event param
See also:
NCS_CB_ONOBJEVENT, ncsAddEventListener, ncsAddEventListeners
BOOL ncsRemoveEventConnect ( mObject listener,
mObject source,
int  event 
)

remove a special event connect

Parameters:
listener the listener object
source the source object
event the special event want to remove
BOOL ncsRemoveEventListener ( mObject listener  ) 

remove the connections which are listened by the object

Note:
this function is called when a listener is destroied
Parameters:
listener the object pointer of listener
Returns:
TRUE - sucessed; FALSE - failed
BOOL ncsRemoveEventSource ( mObject sender  ) 

remove the connections when a sender is destroied

Note:
this function is called when a sender is destroied
Parameters:
sender the sender of events
Returns:
TRUE - sucessed; FALSE - failed
mObject * ncsSafeCast ( mObject obj,
mObjectClass clss 
)

safe type cast function, like the dynamic_cast operator in C++

Parameters:
obj - the mObject pointer being casted
clss - the target type to cast
Returns:
mObject * - the object pointer if cast safe, NULL otherwise
See also:
ncsInstanceOf
mObjectClass * ncsSafeCastClass ( mObjectClass clss,
mObjectClass castCls 
)

cast from a supper class to derived class type safely

Parameters:
clss - the supper type class pointer
castCls - the derived class type pointer
Note:
use SAFE_CAST_CLASS
Returns:
mObjectClass * - the pointer of clss if cast safe, otherwise NULL
mObject * newObject ( mObjectClass _class  ) 

new a object instance, like new operator in C++

Parameters:
_class - the class of the object
Returns:
the new pointer of object
Generated on Fri Jun 10 11:18:06 2011 for New Control Set V1.0.0 API Reference by  doxygen 1.6.3