mtpdataproviders/mtpplaybackcontroldp/mtpplaybackinterface/inc/cmtpplaybackcommand.h
branchRCL_3
changeset 20 4a793f564d72
parent 19 0aa8cc770c8a
child 21 74aa6861c87d
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPPLAYBACKCOMMAND_H
       
    22 #define CMTPPLAYBACKCOMMAND_H
       
    23 
       
    24 #include "mtpdebug.h"
       
    25 #include "mmtpplaybackinterface.h"
       
    26 #include "cmtpplaybackparam.h"
       
    27 
       
    28 class TMTPPbDataVolume
       
    29     {
       
    30 public:
       
    31     TMTPPbDataVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep);
       
    32     TMTPPbDataVolume(const TMTPPbDataVolume& aVol);
       
    33 
       
    34     void SetVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep);
       
    35     void operator =(const TMTPPbDataVolume& aVol);
       
    36     TUint32 MaxVolume() const;
       
    37     TUint32 MinVolume() const;
       
    38     TUint32 DefaultVolume() const;
       
    39     TUint32 CurrentVolume() const;
       
    40     TUint32 Step() const;
       
    41 
       
    42 private:
       
    43     TUint32 iMaxVolume;
       
    44     TUint32 iMinVolume;
       
    45     TUint32 iDefaultVolume;
       
    46     TUint32 iCurrentVolume;
       
    47     TUint32 iStep;
       
    48     };
       
    49 
       
    50 /**
       
    51 * Encapsulates parameter for command EPlaybackCmdInitObject
       
    52 */
       
    53 class CMTPPbCmdParam : public CMTPPbParamBase
       
    54     {
       
    55 public:
       
    56     static CMTPPbCmdParam* NewL(TMTPPbCategory aCategory, const TDesC& aSuid);
       
    57     static CMTPPbCmdParam* NewL(TInt32 aValue);
       
    58     static CMTPPbCmdParam* NewL(TUint32 aValue);
       
    59     static CMTPPbCmdParam* NewL(const CMTPPbCmdParam& aParam);
       
    60     static CMTPPbCmdParam* NewL(const TMTPPbDataVolume& aVolume);
       
    61     ~CMTPPbCmdParam();
       
    62 
       
    63 public:
       
    64     const TMTPPbDataVolume& VolumeSetL() const;
       
    65 
       
    66 private:
       
    67     /**
       
    68      * The constuctor.
       
    69      * @param aCategory, category of object for initialization,
       
    70      */
       
    71     CMTPPbCmdParam();
       
    72     CMTPPbCmdParam(TMTPPbCategory aCategory, const TDesC& aSuid);
       
    73     CMTPPbCmdParam(TInt32 aValue);
       
    74     CMTPPbCmdParam(TUint32 aValue);
       
    75     CMTPPbCmdParam(const TMTPPbDataVolume& aVolume);
       
    76     
       
    77     void ConstructL(TMTPPbCategory aCategory, const TDesC& aSuid);
       
    78     void ConstructL(TInt32 aValue);
       
    79     void ConstructL(TUint32 aValue);
       
    80     void ConstructL(const TMTPPbDataVolume& aVolume);
       
    81     void ConstructL(const CMTPPbCmdParam& aParam);
       
    82     };
       
    83 
       
    84 
       
    85 /** 
       
    86 Implements the CMTPPlaybackCommand.
       
    87 @internalComponent
       
    88 */
       
    89 class CMTPPlaybackCommand : public CBase
       
    90     {
       
    91 public:
       
    92     static CMTPPlaybackCommand* NewL(TMTPPlaybackCommand aCmd, CMTPPbCmdParam* aParam);
       
    93     static CMTPPlaybackCommand* NewL(const CMTPPlaybackCommand& aCmd);
       
    94     
       
    95     void SetParam(CMTPPbCmdParam* aParam);
       
    96     const CMTPPbCmdParam& ParamL() const;
       
    97     TMTPPlaybackCommand PlaybackCommand() const;
       
    98     TBool HasParam() const;
       
    99     
       
   100     ~CMTPPlaybackCommand();
       
   101    
       
   102 private:
       
   103     CMTPPlaybackCommand(TMTPPlaybackCommand aCmd, CMTPPbCmdParam* aParam);
       
   104     void ConstructL(const CMTPPlaybackCommand& aParam);
       
   105     void ConstructL();
       
   106 
       
   107 private: // Owned.
       
   108     __FLOG_DECLARATION_MEMBER;
       
   109     const TMTPPlaybackCommand iPbCmd;
       
   110     CMTPPbCmdParam* iParam;
       
   111     };
       
   112 
       
   113 #endif //CMTPPLAYBACKCOMMAND_H
       
   114