mmuifw_plat/alf_widgetmodel_api/inc/alf/alfflowlayoutmanager.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:  flow layoutmanager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFFLOWLAYOUTMANAGER
       
    20 #define ALFFLOWLAYOUTMANAGER
       
    21 
       
    22 #include <alf/alflayout.h>
       
    23 #include <osn/osndefines.h>
       
    24 #include <osn/osntypes.h>
       
    25 #include <memory>
       
    26 #include <alf/alflayoutmanager.h>
       
    27 
       
    28 using std::auto_ptr;
       
    29 
       
    30 namespace Alf
       
    31     {
       
    32 class AlfFlowLayoutPolicyImpl;
       
    33 class AlfFlowLayoutPreferencesImpl;
       
    34 
       
    35 /** @class AlfFlowLayoutManager alfflowlayoutmanager.h "alf/alfflowlayoutmanager.h"
       
    36  * Flow layout manager positions children next to each other either horizontally or
       
    37  * vertically. The manager sizes the children by using the preferred sizes of the
       
    38  * children. @see IAlfLayoutPreferences::getPreferredSize()  
       
    39  *
       
    40  *
       
    41  * Flow layout manager takes system wide layout mirroring into consideration. 
       
    42  * In western locales the visuals are layed out from left to right whereas
       
    43  * in arabic locale for instance the visuals are layed out from right to left.
       
    44  * Mirroring is considered only when the flow is horizontal. The layout manager
       
    45  * will always lay its children from top to bottom.
       
    46  *
       
    47  * @interfaces IAlfLayoutManager, IAlfLayoutPreferences
       
    48  * @lib alfwidgetmodel.lib
       
    49  * @since S60 ?S60_version
       
    50  * @status Draft
       
    51  */
       
    52  
       
    53 class AlfFlowLayoutManager : public AlfLayoutManager
       
    54     {
       
    55 public:
       
    56     friend class AlfFlowLayoutPolicyImpl;
       
    57     friend class AlfFlowLayoutPreferencesImpl;
       
    58 public:
       
    59 
       
    60     /**
       
    61      * layout manager constructor
       
    62      *
       
    63 	 * @exception std::bad_alloc     
       
    64      * @param aLayoutType type of layout used by this manager.
       
    65      */
       
    66     OSN_IMPORT AlfFlowLayoutManager();
       
    67         
       
    68     /**
       
    69      * virtual destructor
       
    70      */
       
    71     OSN_IMPORT virtual ~AlfFlowLayoutManager();
       
    72     
       
    73 public:
       
    74     //from AlfLayoutManager
       
    75     
       
    76     /**
       
    77      * from AlfLayoutManager
       
    78      * Notifies the layout manager, that the child control's layout
       
    79      * must be updated.
       
    80      * 
       
    81      * @param aControl control, which size has changed.
       
    82      */
       
    83     OSN_IMPORT virtual void updateChildLayout(CAlfWidgetControl* aControl);
       
    84     
       
    85 public:
       
    86 // from base class IAlfInterfaceBase
       
    87     
       
    88     /**
       
    89      * Interface getter. 
       
    90      * @see IAlfInterfaceBase::MakeInterface
       
    91      *
       
    92      * @since S60 ?S60_version
       
    93      * @param aType The type id of the queried interface.
       
    94      * @return The queried interface, or NULL if the interface is not
       
    95      *         supported or available.
       
    96      */    
       
    97     OSN_IMPORT virtual IAlfInterfaceBase* makeInterface( const IfId& aType );
       
    98 protected:
       
    99     
       
   100 private: // data
       
   101 
       
   102     auto_ptr<AlfFlowLayoutPolicyImpl> mData;
       
   103     auto_ptr<AlfFlowLayoutPreferencesImpl> mPrefImpl;
       
   104     };
       
   105 
       
   106     } // namespace Alf
       
   107 
       
   108 #endif // ALFFLOWLAYOUTMANAGER