diff -r dec420019252 -r cf5481c2bc0b videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/inc/videoservices.h Fri Apr 16 14:59:52 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + +#ifndef __VIDEOSERVICES_H__ +#define __VIDEOSERVICES_H__ + +#include +#include "videoserviceurifetch.h" + +//FORWARD CLASS DECLARATION +class VideoServiceUriFetch; +class VideoServicePlay; +class QVideoPlayerEngine; + +class VideoServices : public QObject +{ + Q_OBJECT + +public: + + /** + * Returns singleton instance for this class. + * + * WARNING! Not safe to call this from destructor of another function scope static object! + * + * @return The singleton instance. + */ + static VideoServices *instance(QVideoPlayerEngine* engine = 0); + + /** + * Decreases the reference count, when count reaches zero cleanup is done. + * + */ + void decreaseReferenceCount(); + + enum TVideoService + { + ENoService, + EUriFetcher, + EPlayback + }; + + /** + * Returns service active status + * + * @return bool true if active, false if not active + * + */ + VideoServices::TVideoService currentService(); + +private: + + /** + * Constructor + */ + VideoServices(); + + /** + * Constructor + */ + VideoServices(QVideoPlayerEngine* engine); + + /** + * Destructor. + */ + virtual ~VideoServices(); + + void setCurrentService(VideoServices::TVideoService service); + + Q_DISABLE_COPY(VideoServices) + +private: + + /** + * Singleton instance. + */ + static VideoServices* mInstance; + + VideoServiceUriFetch* mServiceUriFetch; + + VideoServicePlay* mServicePlay; + + VideoServices::TVideoService mCurrentService; + + friend class VideoServiceUriFetch; + + friend class VideoServicePlay; + +public: + + /** + * Reference count. + */ + static int mReferenceCount; + +}; + +#endif //__VIDEOSERVICES_H__