Constructing the UI controller in traditional architecture

The call on the first phase constructor method of the UI controller occurs in the CAknDocument-derived class of application. For more information, see Implementing framework requirements.

The methods you need to implement for your CAknAppUI-derived UI controller are as follows:

  • C++ default constructor, which cannot contain any code that might leave. A common implementation is:

    CMyAppAppUi::CMyAppAppUi()
        {
        // No implementation required
        }

    The class declaration for this constructor in the class header file needs to be public to support the construction method required.

  • Symbian 2nd phase constructor with code that might leave. A common implementation is:

    void CMyAppAppUi::ConstructL()
        {
        // Initialise app UI with skins enabled.
        BaseConstructL(EAknEnableSkin);
    
        // Create view object
        iAppView = CMyAppView::NewL( ClientRect() );
    
        }
    

    CEikAppUi::ConstructL() completes the construction of the object. It is a public constructor in the header file.

    CAknAppUi::BaseConstructL() initializes the application with standard Symbian platform UI application values, including the color scheme look and feel for all UI controls, the status pane, and the menus . CAknAppUi::BaseConstructL() can accept flags enumerated in CEikAppUi and CAknAppUi. In particular, the CAknAppUi::EAknEnableSkin() flag enables themes in the application.

    iAppView = CMyAppView::NewL( ClientRect() ) where NewL is a two-phase constructor for the view. The view object is owned by the UI controller and must be included in the class destructor to free the reserved resources.

The UI controller automatically supports scalability.

You must implement other methods to support key event handling, command handling, layout change support, and other possible events, as well as overriding default control pane and status pane behavior.