mmuifw_plat/alf_widgetmodel_api/inc/alf/alfgridlayoutmanager.h
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
equal deleted inserted replaced
25:4ea6f81c838a 26:0e9bb658ef58
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  grid layout manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFGRIDLAYOUTMANAGER_H
       
    20 #define ALFGRIDLAYOUTMANAGER_H
       
    21 
       
    22 #include <osn/osndefines.h>
       
    23 #include <osn/osntypes.h>
       
    24 #include <memory>
       
    25 #include <alf/alflayoutmanager.h>
       
    26 #include <alf/alflayout.h>
       
    27 
       
    28 using std::auto_ptr;
       
    29 
       
    30 namespace Alf
       
    31     {
       
    32 class IAlfWidgetControl;
       
    33 class AlfGridLayoutManagerImpl;
       
    34 class AlfGridLayoutPolicyImpl;
       
    35 
       
    36 /**
       
    37  * @class AlfGridLayoutManager alfgridlayoutmanager.h "alf/alfgridlayoutmanager.h"
       
    38  * Grid layout manager
       
    39  * Layout manager handles the layouting of child widgets in the container widget.
       
    40  * It uses IAlfLayoutPreferences-interface (@see IAlfLayoutPreferences) 
       
    41  * of child widgets as a guide for laying out the widgets. The layoutmanager 
       
    42  * is set to the IAlfHostApi- interface (@see IAlfHostApi::setBaseLayout)
       
    43  * createLayout-method should be the first call after creating the layoutmanager. 
       
    44  * @see IAlfLayoutPreferences
       
    45  * @see IAlfGridLayoutPolicy
       
    46  *
       
    47  * @lib alfwidgetmodel.lib
       
    48  * @since S60 ?S60_version
       
    49  * @status Draft
       
    50  * @interfaces IAlfLayoutManager, IAlfLayoutPreferences, IAlfGridLayoutPolicy
       
    51  */
       
    52 class AlfGridLayoutManager : public AlfLayoutManager
       
    53     {
       
    54     friend class AlfGridLayoutManagerImpl;
       
    55     friend class AlfGridLayoutPolicyImpl;
       
    56 public:
       
    57 
       
    58     /**
       
    59      * Layout manager constructor
       
    60      * @exception std::bad_alloc
       
    61      */
       
    62     OSN_IMPORT AlfGridLayoutManager();
       
    63         
       
    64     /**
       
    65      * virtual destructor
       
    66      */
       
    67     OSN_IMPORT virtual ~AlfGridLayoutManager();
       
    68     
       
    69 public:
       
    70     //from IAlfLayoutManager
       
    71             
       
    72     /**
       
    73      * from IAlfLayoutManager
       
    74      * Notifies the layout manager, that the child control's layout
       
    75      * must be updated
       
    76      * 
       
    77      * @param aControl control, which size has changed.
       
    78      * @throw AlfVisualException(EInvalidVisual), if layout is not created.
       
    79      */
       
    80      virtual void updateChildLayout(CAlfWidgetControl* aControl);
       
    81     
       
    82     /**
       
    83      * from IAlfLayoutManager
       
    84      * Notifies the layout manager, that the control's has been
       
    85      * removed from the layout.
       
    86      * 
       
    87      * @param aControl control, which has been removed from the layout.
       
    88      * @throw AlfVisualException(EInvalidVisual), if layout is not created.
       
    89      */    
       
    90     virtual void childRemoved(CAlfWidgetControl* aControl);
       
    91 public:
       
    92 protected:
       
    93  
       
    94     OSN_IMPORT void doUpdateChildLayout(CAlfWidgetControl* aControl);
       
    95 // from base class IAlfInterfaceBase
       
    96     
       
    97     /**
       
    98      * Interface getter. 
       
    99      * @see IAlfInterfaceBase::MakeInterface
       
   100      *
       
   101      * @since S60 ?S60_version
       
   102      * @param aType The type id of the queried interface.
       
   103      * @return The queried interface, or NULL if the interface is not
       
   104      *         supported or available.
       
   105      */    
       
   106     OSN_IMPORT virtual IAlfInterfaceBase* makeInterface( const IfId& aType );
       
   107 
       
   108 private: // data
       
   109     auto_ptr<AlfGridLayoutManagerImpl> mData;
       
   110     auto_ptr<AlfGridLayoutPolicyImpl> mDataPolicy;
       
   111     };
       
   112 
       
   113     } // namespace Alf
       
   114 
       
   115 #endif // ALFGRIDLAYOUTMANAGER_H