inc/alf/ialfattributesetter.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:   Attribute setter Interface header.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef I_ALFATTRIBUTESETTER_H
       
    20 #define I_ALFATTRIBUTESETTER_H
       
    21 
       
    22 #include <alf/ialfinterfacebase.h>
       
    23 #include <alf/alftypes.h>
       
    24 #include "alf/alfsettertype.h"
       
    25 #include <alf/alfvisual.h>
       
    26 #include <alf/alfvarianttype.h>
       
    27 #include <alf/alfcommand.h>
       
    28 #include <osn/osntypes.h>
       
    29 
       
    30 namespace Alf
       
    31     {
       
    32 
       
    33 class CAlfWidgetControl;
       
    34 class AlfAttribute;
       
    35 class AlfAttributeContainer;
       
    36 namespace alfattributesetter
       
    37     {
       
    38 static const IfId ident =
       
    39     {
       
    40     0, "alfattributesetter"
       
    41     };
       
    42     }
       
    43 /**
       
    44  * The interface for attribute setters used by widget controls.
       
    45  *
       
    46  * @lib alfwidgetmodel.lib
       
    47  * @since S60 ?S60_version
       
    48  * @status Draft
       
    49  */
       
    50 class IAlfAttributeSetter : public IAlfInterfaceBase
       
    51     {
       
    52 public:
       
    53 
       
    54     static inline const IfId& type()
       
    55         {
       
    56         return alfattributesetter::ident;
       
    57         }
       
    58 
       
    59     virtual inline ~IAlfAttributeSetter() {}
       
    60 
       
    61     /**
       
    62      * Returns the type of the attribute setter.
       
    63      *
       
    64      * @return The type of the attribute setter.
       
    65      */
       
    66     virtual SetterType setterType() = 0;
       
    67 
       
    68     /**
       
    69      * Sets an attribute value in the target visual immediately without a transition.
       
    70      *
       
    71      * @param aVisual The target visual. Doesn't take ownership
       
    72      * @param aContainer The container holding the new value of the attribute. Ownership of the object is not transferred.
       
    73      * @param aData Not used currently.
       
    74      */
       
    75     virtual void setAttributeValue(
       
    76         CAlfVisual& aVisual, AlfAttributeContainer* aContainer, IAlfMap* aData ) = 0;
       
    77 
       
    78     /**
       
    79      * Creates a command to change the value of an attribute in the target visual gradually with a transition.
       
    80      *
       
    81      * @deprecated USE CREATEANDSENDCOMMANDS INSTEAD!!!
       
    82      *
       
    83      * @param aVisual The target visual. Doesn't take ownership
       
    84      * @param aContainer The container holding the new value of the attribute. Ownership of the object is not transferred.
       
    85      * @param aData Not used currently.
       
    86      * @param aTransitionTime Time used for the transition.
       
    87      * @param aRefVisual Optional reference visual. If not NULL, the target value of the attribute is defined by adding
       
    88      * the value specific by aContainer to the corresponding attribute value in the reference visual.
       
    89      * @ret The command to gradually change the attribute in the target visual.
       
    90      */
       
    91     virtual  TAlfCommand* createCommand(
       
    92         CAlfVisual& aVisual,
       
    93         AlfAttributeContainer* aContainer,
       
    94         IAlfMap* aData,
       
    95         int aTransitionTime = 0,
       
    96         CAlfVisual* aRefVisual = NULL ) = 0;
       
    97 
       
    98     /**
       
    99      * Creates commands to change the given attribute values in the target visual gradually with a transition.
       
   100      * Then sends the commands via the ALF environment.
       
   101      *
       
   102      * @param aVisual The target visual. Doesn't take ownership
       
   103      * @param aContainer The attribute container holding the attribute value(s)
       
   104      * used by the attribute setter. Ownership is not transferred. The container
       
   105      * can hold new values for multiple different attributes, in which case several
       
   106      * commands are executed.
       
   107      * @param aRefVisual Optional reference visual. If not NULL, the target value of the attribute is defined by adding
       
   108      * the value specific by aContainer to the corresponding attribute value in the reference visual.
       
   109      */
       
   110     virtual void createAndSendCommands(
       
   111         CAlfVisual& aVisual,
       
   112         AlfAttributeContainer* aContainer,
       
   113         CAlfVisual* aRefVisual = NULL ) = 0;
       
   114 
       
   115     };
       
   116 
       
   117     } // namespace Alf
       
   118 
       
   119 #endif // I_ALFATTRIBUTESETTER_H
       
   120 
       
   121 // End of File