Revert to tizen branch.
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / custom-actor.h
1 /*! \page custom-actor Custom Actor
2  * The Dali::CustomActor is used as a base class for UI controls.  It is a proxy object to enable derived classes access
3  * to a subset of the methods defined in the internal Actor class.
4  *
5  * Classes deriving from Custom Actor should follow the same handle - body design principle as the rest of the Dali API.
6  *
7  * One class of the new UI control should inherit from Dali::CustomActor, while a second should inherit
8  * Dali::CustomActorImpl.  This implementation class contains a number of pure virtual methods that enable the new UI
9  * control to respond to a variety of events such as touch and notification of being added to the stage.
10  *
11  * For example, if creating a new button widget called myNewButton, the user would create two classes, myNewButton which
12  * derives from Dali::CustomActor and an implementation part myNewButtonImpl which would derive from Dali::CustomActorImpl.
13  *
14  * In the New() method for the myNewButton class, the user should then create a new instance of the myNewButtonImpl class
15  * and pass this to the constructor of the myNewButton object.  Internally the connection will be made
16  * between the new widget actor and Dali, thus allowing messages such as OnPropertySet to be received by the new actor.
17  *
18  * It is the responsibility of the implementation of the new UI control to implement the method bodies for the inherited
19  * pure virtual methods from Dali::CustomActorImpl.  Obviously the application won't compile if the methods are not
20  * overidden, but the user does not need to fill in the code for methods they don't want or need to use.
21  *
22  * After the implementation object is created it is passed back to the basic Text View through the constructor,the
23  * constructor uses this passed in object to initialise the internal implementation objects.
24  *
25  * After both the objects are created it calls an init method on the implementation which is used to initialise
26  * objects.  THis is the preferred way to do things so to avoid errors in the constructors.
27  *
28  * If desired, the user can then use the myNewButtonImpl implementation class to handle only the callback message
29  * handler methods, and do all the rest of their widget processing the the main myNewButton class.  Access to the
30  * implementation class can be gained using the GetImpl(*this) method.  For example:
31  *
32  */