mmuifw_plat/alf_customlayoutmanagers_api/inc/alf/alflctanchorlayoutmanager.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     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 ALFLCTANCHORLAYOUTMANAGER_H
       
    20 #define ALFLCTANCHORLAYOUTMANAGER_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 AlfLCTAnchorLayoutPreferencesImpl;
       
    34 class AlfLCTAnchorLayoutPolicyImpl;
       
    35 
       
    36 /**
       
    37  * Grid layout manager
       
    38  *
       
    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  *
       
    45  * @lib alfwidgetmodel.lib
       
    46  * @since S60 ?S60_version
       
    47  */
       
    48 class AlfLCTAnchorLayoutManager : public AlfLayoutManager
       
    49     {
       
    50     friend class AlfLCTAnchorLayoutPreferencesImpl;
       
    51     friend class AlfLCTAnchorLayoutPolicyImpl;
       
    52 
       
    53 public:
       
    54 
       
    55     /**
       
    56      * layout manager constructor
       
    57      *
       
    58      */
       
    59     AlfLCTAnchorLayoutManager();
       
    60         
       
    61     /**
       
    62      * virtual destructor
       
    63      */
       
    64     virtual ~AlfLCTAnchorLayoutManager();
       
    65     
       
    66 public:
       
    67     //from IAlfLayoutManager
       
    68             
       
    69     /**
       
    70      * from IAlfLayoutManager
       
    71      * Notifies the layout manager, that the child control's layout
       
    72      * must be updated
       
    73      * 
       
    74      * @param aControl control, which size has changed.
       
    75      * @throw AlfVisualException(EInvalidVisual), if layout is not created.
       
    76      */
       
    77      virtual void updateChildLayout(CAlfWidgetControl* aControl);
       
    78     
       
    79     /**
       
    80      * from IAlfLayoutManager
       
    81      * Notifies the layout manager, that the control's has been
       
    82      * removed from the layout.
       
    83      * 
       
    84      * @param aControl control, which has been removed from the layout.
       
    85      * @throw AlfVisualException(EInvalidVisual), if layout is not created.
       
    86      */    
       
    87     virtual void childRemoved(CAlfWidgetControl* aControl);
       
    88 public:
       
    89 protected:
       
    90  
       
    91     void doUpdateChildLayout(CAlfWidgetControl* aControl);
       
    92 // from base class IAlfInterfaceBase
       
    93     
       
    94     /**
       
    95      * Interface getter. 
       
    96      * @see IAlfInterfaceBase::MakeInterface
       
    97      *
       
    98      * @since S60 ?S60_version
       
    99      * @param aType The type id of the queried interface.
       
   100      * @return The queried interface, or NULL if the interface is not
       
   101      *         supported or available.
       
   102      */    
       
   103     virtual IAlfInterfaceBase* makeInterface( const IfId& aType );
       
   104 
       
   105 private: // data
       
   106     auto_ptr<AlfLCTAnchorLayoutPreferencesImpl> mDataPreferences;
       
   107     auto_ptr<AlfLCTAnchorLayoutPolicyImpl> mDataPolicy;
       
   108     };
       
   109 
       
   110     } // namespace Alf
       
   111 
       
   112 #endif // ALFLCTANCHORLAYOUTMANAGER_H