videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoservices.cpp
changeset 30 4f111d64a341
child 17 69946d1824c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videocollection/videofiledetailsview/tsrc/testplugin/stub/src/videoservices.cpp	Thu Apr 01 22:38:49 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* 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
+*
+*/
+
+#include <videoservices.h>
+#include <videoserviceurifetch.h>
+
+
+VideoServices *VideoServices::mInstance = 0;
+int  VideoServices::mReferenceCount = 0;
+
+// -----------------------------------------------------------------------------
+// VideoServices::instance()
+// -----------------------------------------------------------------------------
+//
+VideoServices* VideoServices::instance()
+{
+    if(!mInstance)
+    {
+        mInstance = new VideoServices();
+    }
+    mInstance->mReferenceCount++;
+    return mInstance;
+}
+
+// -----------------------------------------------------------------------------
+// VideoServices::decreaseReferenceCount()
+// -----------------------------------------------------------------------------
+//
+void VideoServices::decreaseReferenceCount()
+{
+    if(mInstance)
+    {
+        if(--mInstance->mReferenceCount == 0)
+        {
+            delete mInstance;
+            mInstance = NULL;
+        }
+    }
+}
+
+
+// ----------------------------------------------------------------------------
+// VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::VideoServices() :
+mCurrentService(VideoServices::ENoService)
+{
+    mServiceUriFetch = new VideoServiceUriFetch(this);
+}
+
+// ----------------------------------------------------------------------------
+// ~VideoServices()
+// ----------------------------------------------------------------------------
+//
+VideoServices::~VideoServices()
+{
+	delete mServiceUriFetch;
+}
+
+
+// ----------------------------------------------------------------------------
+// currentService()
+// ----------------------------------------------------------------------------
+//
+VideoServices::TVideoService VideoServices::currentService()
+{
+	return mCurrentService;
+}
+
+
+// ----------------------------------------------------------------------------
+// setCurrentService()
+// ----------------------------------------------------------------------------
+//
+void VideoServices::setCurrentService(VideoServices::TVideoService service)
+{
+	mCurrentService = service;
+}
+