inc/alf/alfanchorlayoutattributesetter.h
branchRCL_3
changeset 19 4ea6f81c838a
parent 17 514d98f21c43
child 20 0e9bb658ef58
equal deleted inserted replaced
17:514d98f21c43 19:4ea6f81c838a
     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 layout attribute setter header.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFANCHORLAYOUTATTRIBUTESETTER_H
       
    20 #define ALFANCHORLAYOUTATTRIBUTESETTER_H
       
    21 
       
    22 //includes
       
    23 
       
    24 //widget model includes
       
    25 #include "alf/alfcommonlayoutattributesetter.h"
       
    26 
       
    27 //osn includes
       
    28 #include <osn/osndefines.h>
       
    29 
       
    30 
       
    31 namespace Alf
       
    32     {
       
    33 
       
    34 /**
       
    35  *  @class AlfAnchorLayoutAttributeSetter alfanchorlayoutattributesetter.h "alf/alfanchorlayoutattributesetter.h"
       
    36  *  The implementation of the attribute setter for setting anchor layout attributes.
       
    37  *  @see IAlfAttributeSetter
       
    38  *
       
    39  *  @lib alfwidgetmodel.lib
       
    40  *  @since S60 ?S60_version
       
    41  *  @status Draft
       
    42  *  @interfaces IAlfAttributeSetter
       
    43  */
       
    44 class AlfAnchorLayoutAttributeSetter : public AlfCommonLayoutAttributeSetter
       
    45     {
       
    46 
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Constructor.
       
    51      *
       
    52      */
       
    53     OSN_IMPORT AlfAnchorLayoutAttributeSetter();
       
    54 
       
    55     /**
       
    56      * Destructor.
       
    57      */
       
    58     OSN_IMPORT virtual ~AlfAnchorLayoutAttributeSetter();
       
    59 
       
    60     /**
       
    61      * Sets the attribute values to the target visual.
       
    62      * @exception osncore::AlfVisualException Thrown with error code osncore::EInvalidVisual if aVisual is not 
       
    63      *                                        an anchor layout.
       
    64      * @exception osncore::AlfVisualException Thrown with Symbian error code if anchor point attachment fails.
       
    65      * @exception std::bad_alloc
       
    66      *
       
    67      * @since S60 ?S60_version
       
    68      * @param aVisual The target visual. Doesn't take ownership
       
    69      * @param aContainer The container holding the value of the attributes.
       
    70      *        Ownership of the object is not transferred.
       
    71      * @param aData Used with data attributes to fetch the data.
       
    72      */
       
    73     OSN_IMPORT virtual void setAttributeValue (
       
    74         CAlfVisual &aVisual,
       
    75         AlfAttributeContainer* aContainer,
       
    76         IAlfMap* aData );
       
    77 
       
    78     /**
       
    79      * Depracated! Do not use!
       
    80      * Creates a command to change the value of an attribute in the target visual gradually with a transition.
       
    81      *
       
    82      * @param aVisual The target visual. Doesn't take ownership
       
    83      * @param aContainer The container holding the new value of the attribute. Ownership of the object is not transferred.
       
    84      * @param aData Not used currently.
       
    85      * @param aTransitionTime Time used for the transition.
       
    86      * @param aRefVisual Optional reference visual. If not NULL, the target value of the attribute is defined by adding
       
    87      * the value specific by aContainer to the corresponding attribute value in the reference visual.
       
    88      * @ret The command to gradually change the attribute in the target visual.
       
    89      */
       
    90     OSN_IMPORT virtual TAlfCommand* createCommand (
       
    91         CAlfVisual& aVisual,
       
    92         AlfAttributeContainer* aContainer,
       
    93         IAlfMap* aData,
       
    94         int aTransitionTime = 0,
       
    95         CAlfVisual* aRefVisual = NULL );
       
    96 
       
    97     /**
       
    98      * Creates commands to change the given attribute values in the target visual gradually with a transition.
       
    99      * Then sends the commands via the ALF environment.
       
   100      *
       
   101      * @param aVisual The target visual. Doesn't take ownership
       
   102      * @param aContainer The attribute container holding the attribute value(s)
       
   103      * used by the attribute setter. Ownership is not transferred. The container
       
   104      * can hold new values for multiple different attributes, in which case several
       
   105      * commands are executed.
       
   106      * @param aRefVisual Optional reference visual. If not NULL, the target value of the attribute is defined by adding
       
   107      * the value specific by aContainer to the corresponding attribute value in the reference visual.
       
   108      */
       
   109     OSN_IMPORT virtual void createAndSendCommands (
       
   110         CAlfVisual& aVisual,
       
   111         AlfAttributeContainer* aContainer,
       
   112         CAlfVisual* aRefVisual = NULL );
       
   113 
       
   114 
       
   115 protected:
       
   116     /**
       
   117      * Sets an dynamic attribute value in the target visual using transitions defined in attributes
       
   118      *
       
   119      * @param aVisual The target visual. Doesn't take ownership
       
   120      * @param aAttr The attribute to process. Doesn't take ownership
       
   121      * @param aContainer The container holding attributes. Ownership of the object is not transferred.
       
   122      */
       
   123     void handleDynamicAttribute ( CAlfVisual &aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer);
       
   124 
       
   125     /**
       
   126      * Sets an value for static attribute in the target visual immediately without a transition using data in map.
       
   127      *
       
   128      * @param aVisual The target visual. Doesn't take ownership
       
   129      * @param aAttr The attribute to process. Doesn't take ownership
       
   130      * @param aContainer The container holding attributes. Ownership of the object is not transferred.
       
   131      * @param aData
       
   132      */
       
   133     void handleStaticDataAttribute ( CAlfVisual &aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer, IAlfMap* aData );
       
   134 
       
   135     /**
       
   136      * Sets an value for dynamic attribute value in the target visual using transitions and data in map.
       
   137      *
       
   138      * @param aVisual The target visual. Doesn't take ownership
       
   139      * @param aAttr The attribute to process. Doesn't take ownership
       
   140      * @param aContainer The container holding attributes. Ownership of the object is not transferred.
       
   141      * @param aData
       
   142      */
       
   143     void handleDynamicDataAttribute ( CAlfVisual &aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer, IAlfMap* aData );
       
   144 
       
   145     /**
       
   146      * Sets an value of a static attribute to target visual immediately without a transition.
       
   147      *
       
   148      * @param aVisual The target visual. Doesn't take ownership
       
   149      * @param aAttr The attribute to process. Doesn't take ownership
       
   150      * @param aContainer The container holding attributes. Ownership of the object is not transferred.
       
   151      * @param aData
       
   152      */
       
   153     void handleStaticAttribute( CAlfVisual &aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer);
       
   154 
       
   155 private:
       
   156 
       
   157     /**
       
   158      * Sets an value of a static attribute to target visual immediately without a transition.
       
   159      *
       
   160      * @param aVisual The target visual. Doesn't take ownership
       
   161      * @param aAttr The attribute to process. Doesn't take ownership
       
   162      * @param aContainer The container holding attributes. Ownership of the object is not transferred.
       
   163      * @param aData Contains data. if not NULL, attribute value is fetched from the map.
       
   164      *        Ownership of the object is not transferred.
       
   165      */
       
   166     bool doHandleStaticAttribute(CAlfVisual &aVisual, AlfAttribute& aAttr, AlfAttributeContainer& aContainer, IAlfMap* aData);
       
   167 
       
   168 private: // data
       
   169     };
       
   170 
       
   171     } // namespace Alf
       
   172 
       
   173 #endif // C_ALFANCHORLAYOUTATTRIBUTESETTER_H
       
   174 // End of file
       
   175 
       
   176