mmuifw_plat/alf_customlayoutmanagers_api/inc/alf/ialflctanchorlayoutpolicy.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2008 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:  interface for layout policy
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef I_ALFLCTANCHORLAYOUTMANAGER
       
    20 #define I_ALFLCTANCHORLAYOUTMANAGER
       
    21 
       
    22 #include <alf/ialfinterfacebase.h>
       
    23 #include <alf/alftypes.h>
       
    24 
       
    25 namespace osncore
       
    26     {
       
    27 class UString;
       
    28     }
       
    29     
       
    30 class CAlfControl;
       
    31 class TAknLayoutHierarchyComponentHandle;
       
    32 
       
    33 namespace Alf
       
    34     {
       
    35 
       
    36 class CAlfWidgetControl;
       
    37 
       
    38 namespace ialflctanchorlayoutpolicy
       
    39     {
       
    40      static const IfId Ident =
       
    41         {
       
    42         0, "lctanchorlayoutpolicy"
       
    43         };
       
    44     }
       
    45 
       
    46 using namespace osncore;    
       
    47 using Alf::CAlfWidgetControl;
       
    48 
       
    49 
       
    50 
       
    51 /**
       
    52  * The interface for grid layout policy
       
    53  *
       
    54  * Provides grid specific layout APIs
       
    55  * 
       
    56  * @code
       
    57  * // Create layout manager interface.
       
    58  * IAlfLayoutManager* layoutManager = IAlfInterfaceBase::makeInterface<IAlfLayoutManager>(control);
       
    59  *
       
    60  * // See if layout policy is supported in the given layout manager.
       
    61  * IAlfLCTAnchorLayoutPolicy* layoutPolicy = IAlfInterfaceBase::makeInterface<IAlfLCTAnchorLayoutPolicy>(layoutManager);
       
    62  *
       
    63  * if(layoutPolicy != 0)
       
    64  *     {
       
    65  *     int rows = layoutPolicy->Attach(componentHandle);
       
    66  *     }
       
    67  * @endcode
       
    68  *
       
    69  * @lib alfwidgetmodel.lib
       
    70  * @since S60 ?S60_version
       
    71  */
       
    72 class IAlfLCTAnchorLayoutPolicy : public IAlfInterfaceBase
       
    73     {
       
    74 public:
       
    75        
       
    76     static inline const IfId& type()
       
    77         {       
       
    78         return ialflctanchorlayoutpolicy::Ident;
       
    79         }
       
    80         
       
    81     virtual inline ~IAlfLCTAnchorLayoutPolicy() {}
       
    82 
       
    83 
       
    84    /**
       
    85     * attach the anchors needed for a child visual, according to the layout data 
       
    86     * corresponding to the component handle.
       
    87     *
       
    88     * @note this should can be used for layout text components, but also use IAlfLCTTextLayoutPolicy 
       
    89     * with the contained text visual to set the text style and alignment
       
    90     *
       
    91     * @param aOrdinal the child visual index
       
    92     * @param aComponentHandle the layout data to use
       
    93     */ 
       
    94     virtual void Attach (int aOrdinal, const UString& aLCTString, int aVarietyIndex) = 0;
       
    95     
       
    96 
       
    97 // from base class IAlfInterfaceBase
       
    98     
       
    99     /**
       
   100      * Interface getter. 
       
   101      * @see IAlfInterfaceBase::MakeInterface
       
   102      *
       
   103      * @param aType The type id of the queried interface.
       
   104      * @return The queried interface, or NULL if the interface is not
       
   105      *         supported or available.
       
   106      */    
       
   107     virtual IAlfInterfaceBase* makeInterface( const IfId& aType ) = 0;
       
   108     };
       
   109 
       
   110     } // namespace Alf
       
   111 
       
   112 #endif // I_ALFLCTANCHORLAYOUTMANAGER