javauis/amms_qt/mmacontrol/inc/cammsvolumecontrol.h
branchRCL_3
changeset 18 9ac0a0a7da70
parent 17 0fd27995241b
child 19 71c436fe3ce0
equal deleted inserted replaced
17:0fd27995241b 18:9ac0a0a7da70
     1 /*
       
     2 * Copyright (c) 2005 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:  Controls the volume of a CMMAVolumeControl.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMMSVOLUMECONTROL_H
       
    20 #define CAMMSVOLUMECONTROL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "cammscontrol.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CMMAVolumeControl;
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KAMMSMAXVolume = 100;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *
       
    36 *  Controls the volume of a CMMAVolumeControl.
       
    37 *  This class delegates SetVolumeL method calls to CMMAVolumeControl
       
    38 *  given in constructor.
       
    39 *
       
    40 *  @since 3.0
       
    41 */
       
    42 NONSHARABLE_CLASS(CAMMSVolumeControl): public CAMMSControl
       
    43 {
       
    44 public:  // Constructors and destructor
       
    45 
       
    46     /**
       
    47     * Two-phased constructor.
       
    48     * @param aControlName Class name for this control.
       
    49     * @param aVolumeControl Delegated control.
       
    50     * @param aPlayer Player that has this control.
       
    51     */
       
    52     static CAMMSVolumeControl* NewLC(const TDesC& aControlName,
       
    53     CMMAVolumeControl* aVolumeControl,
       
    54     CMMAPlayer* aPlayer);
       
    55 
       
    56     /**
       
    57     * Destructor.
       
    58     */
       
    59     ~CAMMSVolumeControl();
       
    60 
       
    61 public: // New functions
       
    62     /**
       
    63     * Sets the volume..
       
    64     *
       
    65     * @param aVolume The new volume to be set.
       
    66     */
       
    67     void SetVolumeL(TInt aVolume);
       
    68 
       
    69 public: // Functions from base classes
       
    70     const TDesC& ClassName() const;
       
    71 
       
    72 private:
       
    73     /**
       
    74     * C++ constructor.
       
    75     * @param aControlName Class name for this control.
       
    76     * @param aVolumeControl Delegated control.
       
    77     * @param aPlayer Player that has this control.
       
    78     */
       
    79     CAMMSVolumeControl(const TDesC& aControlName,
       
    80                        CMMAVolumeControl* aVolumeControl,
       
    81                        CMMAPlayer* aPlayer);
       
    82 
       
    83     /**
       
    84     * By default Symbian 2nd phase constructor is private.
       
    85     */
       
    86     void ConstructL();
       
    87 
       
    88 private:  // Data
       
    89     const TDesC& iClassName;
       
    90 
       
    91     // Not owned mma volume control.
       
    92     CMMAVolumeControl* iVolumeControl;
       
    93 
       
    94     // Index in iVolumeControl
       
    95     TInt iControlLevelIndex;
       
    96 };
       
    97 
       
    98 #endif // CAMMSVOLUMECONTROL_H
       
    99 
       
   100