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