videocollection/hgmyvideos/inc/vcxhgmyvideosupnpinterface.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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:      CVcxuPnPInterface class declaration*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVCXHGUPNPINTERFACE_H
       
    21 #define CVCXHGUPNPINTERFACE_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <upnpcommandobserver.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CUpnpShowCommand;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * CVcxHgMyVideosUPnPInterface declares an interface for myvideos UI 
       
    36  * to show videos and images via upnp framework's command api
       
    37  * 
       
    38  */
       
    39 NONSHARABLE_CLASS( CVcxHgMyVideosUPnPInterface ) : public CBase,
       
    40                                                    public MUpnpCommandObserver
       
    41     {
       
    42 public: // Constructors and destructor
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~CVcxHgMyVideosUPnPInterface();
       
    48 
       
    49     /**
       
    50      * Two-phased constructor.
       
    51      * 
       
    52      * @param aExtObserver pointer to external command observer
       
    53      */
       
    54     static CVcxHgMyVideosUPnPInterface* NewL( MUpnpCommandObserver* aExtObserver = 0 );
       
    55 
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      * 
       
    59      * @param aExtObserver pointer to external command observer
       
    60      */
       
    61     static CVcxHgMyVideosUPnPInterface* NewLC( MUpnpCommandObserver* aExtObserver = 0 );
       
    62     
       
    63 public: // new methods
       
    64     
       
    65     /**
       
    66      * Returns ETrue, if home network functionality
       
    67      * is usable via upnp
       
    68      * 
       
    69      * @return TBool ETrue is usable
       
    70      */
       
    71     TBool IsApplicable();
       
    72     
       
    73     /**
       
    74      * Returns ETrue, upnp has been started succesfully
       
    75      * by the Strat() -call
       
    76      * 
       
    77      * @return TBool ETrue if started
       
    78      */
       
    79     TBool IsStarted();
       
    80     
       
    81     /**
       
    82      * Starts upnp framework for video / image showing
       
    83      * 
       
    84      * @return TInt     KErrNone if ok, KErrGeneral if start is not yet called 
       
    85      *                  succesfully. Otherwise a systemwide error code.
       
    86      */
       
    87     TInt Start( );
       
    88     
       
    89     /**
       
    90      * Shows a video in remote upnp device.
       
    91      * 
       
    92      * @param aVideoPath full path for the video including video file name
       
    93      * 
       
    94      * @return TInt     KErrNone if ok, KErrGeneral if start is not yet called 
       
    95      *                  succesfully. Otherwise a systemwide error code.
       
    96      */
       
    97     TInt ShowVideo( const TDesC& aVideoPath );
       
    98     
       
    99     /**
       
   100      * Shows an image in remote upnp device.
       
   101      * 
       
   102      * @param aPath full path for the image including image file name
       
   103      * 
       
   104      * @return TInt KErrNone if ok, other a systemwide error
       
   105      */
       
   106     TInt ShowThumbnail( const TDesC& aPath );
       
   107     
       
   108     /**
       
   109      * Notifies framework to stop showing
       
   110      * 
       
   111      * @return TInt KErrNone if ok, otherwise a systemwide error
       
   112      */
       
   113     TInt Stop();
       
   114     
       
   115 public: // from MUpnpCommandObserver
       
   116 
       
   117     /**
       
   118      * Upnp framework calls this to return a result from 
       
   119      * Asynchronous method -calls. Only async methods are the one 
       
   120      * related to showing of image of video. In case there is external
       
   121      * observer defined, message is to it.
       
   122      * This method handles only KErrDisconnected status, where 
       
   123      * we set iStarted flag EFalse. 
       
   124      * 
       
   125      * @param aStatusCode  statuscode from the upnp framework
       
   126      */
       
   127     void CommandComplete( TInt aStatusCode );
       
   128     
       
   129 private:
       
   130 
       
   131     /**
       
   132      * Constructor for performing 1st stage construction
       
   133      */
       
   134     CVcxHgMyVideosUPnPInterface();
       
   135 
       
   136     /**
       
   137      * EPOC default constructor for performing 2nd stage construction
       
   138      */
       
   139     void ConstructL();
       
   140     
       
   141     /**
       
   142      * Method creates CUpnpShowCommand object if not yet created.
       
   143      * Creation unsuuceeds, if platform does not yet support home networking
       
   144      * via upnp (Home media setup not yet done). In this case pointer to
       
   145      * CUpnpShowCommand remains NULL.  
       
   146      * 
       
   147      * @return TBool  ETrue, creation ok
       
   148      */
       
   149     TBool TryCreateCmd();
       
   150 
       
   151 private:
       
   152     
       
   153     /**
       
   154      * pointer to Upnp Show -command interface. Owned.
       
   155      */
       
   156     CUpnpShowCommand* iShowCommand;
       
   157     
       
   158     /**
       
   159      * pointer to external Upnp command observer. Not Owned.
       
   160      */
       
   161     MUpnpCommandObserver* iExtObserver;
       
   162     
       
   163     /**
       
   164      * ETrue:  Start has been called succesfully.
       
   165      * EFalse: Start not yet called succesfully
       
   166      */
       
   167     TBool iStarted;
       
   168     
       
   169     };
       
   170 
       
   171 #endif // CVCXHGUPNPINTERFACE_H