widgetmodel/alfwidgetmodel/inc/alfanchorlayoutmanagerimpl.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:  anchor layoutmanager private implementation header.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFANCHORLAYOUTMANAGERIMPL_H
       
    20 #define ALFANCHORLAYOUTMANAGERIMPL_H
       
    21 
       
    22 #include <osn/osndefines.h>
       
    23 #include <alf/alfanchorlayoutmanager.h>
       
    24 #include <alf/ialflayoutpreferences.h>
       
    25 
       
    26 using std::auto_ptr;
       
    27 using Alf::AlfAnchorLayoutManager;
       
    28 
       
    29 class CAlfControl;
       
    30 class CAlfAnchorLayout;
       
    31 
       
    32 namespace Alf
       
    33     {
       
    34     
       
    35 class CAlfWidgetControl;
       
    36 class AlfWidget;
       
    37 class IAlfLayoutPreferences;
       
    38     
       
    39 /**
       
    40  * layoutmanager implementation class
       
    41  *
       
    42  * @lib alfwidgetmodel.lib
       
    43  * @since S60 ?S60_version
       
    44  */
       
    45 class AlfAnchorLayoutManagerImpl : public IAlfLayoutPreferences
       
    46     {
       
    47 public:
       
    48     /**
       
    49      * layout manager constructor
       
    50      *
       
    51      * @param aLayoutType type of layout used by the manager.
       
    52      */
       
    53     AlfAnchorLayoutManagerImpl(AlfAnchorLayoutManager& aAnchorLayoutManager);
       
    54     
       
    55     /**
       
    56      * destructor
       
    57      */
       
    58     ~AlfAnchorLayoutManagerImpl();
       
    59     
       
    60 public:
       
    61 // from base class IAlfLayoutPreferences
       
    62 
       
    63 	/**
       
    64 	 * Returns the minimum size of the layout by combining the minimum sizes of the
       
    65 	 * layed out visuals.
       
    66 	 * 
       
    67 	 * @param aMinSize The minimum size that the object would like to be laid out to
       
    68 	 * @return false iff none of the layed out UI elements do not care about minimum size
       
    69 	 */
       
    70 	virtual bool getMinimumSize( TAlfXYMetric& aMinSize ) const;
       
    71 	
       
    72 	/**
       
    73 	 * Returns the maximum size of the layout by combining the maximum sizes of the
       
    74 	 * layed out visuals.
       
    75 	 *  
       
    76 	 * @param aMaxSize The maximum size that the object would like to be laid out to
       
    77 	 * @return false iff none of the layed out UI elements do not care about maximum size
       
    78 	 */
       
    79 	virtual bool getMaximumSize( TAlfXYMetric& aMaxSize ) const;
       
    80 	
       
    81     /**
       
    82      * Returns the size combined by all preferred sizes of child UI elements in this layout 
       
    83      * when they are being layed out according to the layout manager rules.
       
    84      * 
       
    85      * @param aPreferredSize Filled with the referred area occupied by child elements when
       
    86      * 						 layed out by layouting rules in this layout manager.
       
    87      * @return False if none of the child components report their preferred size. True
       
    88      * 		   otherwise.
       
    89      */
       
    90     virtual bool getPreferredSize(TAlfXYMetric& aPreferredSize) const;
       
    91 	 
       
    92 	/**
       
    93 	 * Set the preferred size into a presentation object.
       
    94 	 * 
       
    95 	 * This is not supported on the layout manager. Users should set preferred sizes of the
       
    96 	 * contained UI elements.
       
    97 	 */
       
    98 	virtual void setPreferredSize( const TAlfXYMetric& aPreferredSize );    
       
    99 
       
   100 public:
       
   101 // from base class IAlfInterfaceBase
       
   102     
       
   103     /**
       
   104      * Interface getter. 
       
   105      * @see IAlfInterfaceBase::MakeInterface
       
   106      *
       
   107      * @since S60 ?S60_version
       
   108      * @param aType The type id of the queried interface.
       
   109      * @return The queried interface, or NULL if the interface is not
       
   110      *         supported or available.
       
   111      */    
       
   112     virtual IAlfInterfaceBase* makeInterface( const IfId& aType );	
       
   113 	
       
   114 private:
       
   115     /**
       
   116      * returns the anchorlayout used by the layoutmanager.
       
   117      */    
       
   118     CAlfAnchorLayout& layout() const;
       
   119 private:
       
   120 
       
   121     AlfAnchorLayoutManager & mAnchorLayoutManager;
       
   122 
       
   123     };
       
   124 
       
   125     } // namespace Alf
       
   126 
       
   127 #endif // ALFANCHORLAYOUTMANAGERIMPL_H