upnpavcontroller/upnpxmlparser/inc/upnpavtevent.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
       
     1 /*
       
     2 * Copyright (c) 2009 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: Container class for AV Transport events.    
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_UPNPAVTEVENT_INL
       
    19 #define C_UPNPAVTEVENT_INL
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 
       
    26 // CONSTS
       
    27 
       
    28 /**
       
    29  * Details of AVTransport event
       
    30  *
       
    31  * @lib upnpxmlparser.lib
       
    32  */
       
    33 class CUPnPAVTEvent : public CBase
       
    34     {
       
    35 
       
    36 public:
       
    37 
       
    38     /**
       
    39      * AV Transport state.
       
    40      */
       
    41     enum TTransportState
       
    42         {
       
    43         EIdle = 0,
       
    44         EStopped,
       
    45         EPlaying,
       
    46         ETransitioning,
       
    47         EPausedPlayback,
       
    48         EPausedRecording,
       
    49         ERecording,
       
    50         ENoMediaPresent
       
    51         };
       
    52  
       
    53 private:    
       
    54     
       
    55     /**
       
    56      * Default constructor.
       
    57      */
       
    58     CUPnPAVTEvent();
       
    59     
       
    60     /**
       
    61      * 2nd phase constructor.
       
    62      */
       
    63     void ConstructL();
       
    64     
       
    65 public:
       
    66     
       
    67     /**
       
    68      * 1st phase constructor.
       
    69      */
       
    70     static CUPnPAVTEvent* NewL();
       
    71 
       
    72     /**
       
    73      * Default destructor.
       
    74      */
       
    75     ~CUPnPAVTEvent();
       
    76     
       
    77     /**
       
    78      * Copy constructor.
       
    79      * 
       
    80      * @param event object to be copied.
       
    81      * @return a copy of event.
       
    82      */
       
    83     static CUPnPAVTEvent* CloneL( const CUPnPAVTEvent& event );
       
    84     
       
    85 public: // Exported getters 
       
    86     
       
    87     /**
       
    88      * Return instance id
       
    89      * 
       
    90      * @return instance id
       
    91      */
       
    92     IMPORT_C TInt InstanceID() const;
       
    93     
       
    94     /**
       
    95      * Return mute state
       
    96      * 
       
    97      * @return mute
       
    98      */
       
    99     IMPORT_C TInt Mute() const;
       
   100 
       
   101     /**
       
   102      * Return volume
       
   103      * 
       
   104      * @return volume
       
   105      */
       
   106     IMPORT_C TInt Volume() const;
       
   107 
       
   108     /**
       
   109      * Return AV Transport state
       
   110      * 
       
   111      * @return transport state
       
   112      */
       
   113     IMPORT_C TTransportState TransportState() const;
       
   114 
       
   115     /**
       
   116      * Return AV Transport Uri
       
   117      * 
       
   118      * @return uri
       
   119      */
       
   120     IMPORT_C const TDesC8& TransportURI() const;
       
   121 
       
   122 public: // Not exported setters  
       
   123     
       
   124     /**
       
   125      * Set instance id
       
   126      * 
       
   127      * @param instance id
       
   128      */
       
   129     void SetInstanceID( TInt aInstanceID );
       
   130         
       
   131     /**
       
   132      * Set mute
       
   133      * 
       
   134      * @param mute
       
   135      */
       
   136     void SetMute( TInt aMute );
       
   137 
       
   138     /**
       
   139      * Set volume
       
   140      * 
       
   141      * @param volume
       
   142      */
       
   143     void SetVolume( TInt aVolume );
       
   144 
       
   145     /**
       
   146      * Set AV Transport state
       
   147      * 
       
   148      * @param transport state
       
   149      */
       
   150     void SetTransportState( TTransportState aTransportState );
       
   151         
       
   152     /**
       
   153      * Set AV Transport state
       
   154      * 
       
   155      * @param stanport state (as a descriptor)
       
   156      */
       
   157     void SetTransportState( const TDesC8& aData );
       
   158 
       
   159     /**
       
   160      * Set AV Tranport Uri
       
   161      * 
       
   162      * @param Uri
       
   163      */
       
   164     void SetTransportURIL( const TDesC8& aTransportURI );
       
   165  
       
   166 public:    
       
   167     
       
   168     /**
       
   169      * Reset the member variables.
       
   170      */
       
   171     void Reset();
       
   172 
       
   173 private: // data
       
   174     
       
   175     TInt            iInstanceID;
       
   176     
       
   177     TInt            iMute;
       
   178 
       
   179     TInt            iVolume;
       
   180     
       
   181     TTransportState iTransportState;
       
   182     
       
   183     /**
       
   184      * Heap buffer for AV Transport Uri.
       
   185      * Own.
       
   186      */
       
   187     HBufC8*         iTransportURI;
       
   188     };
       
   189 
       
   190 #endif // C_UPNPAVTEVENT
       
   191 
       
   192 // End of File