Add IMmcStorageManagerServiceListener
authorHyunbin Lee <hyunbin.lee@samsung.com>
Thu, 25 Jul 2013 06:23:47 +0000 (15:23 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Mon, 29 Jul 2013 02:40:36 +0000 (11:40 +0900)
Change-Id: I4646aa7b48c32712edc4d4198a0e5bba711dad31
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
inc/FIo_IMmcStorageManagerServiceListener.h [new file with mode: 0644]
inc/FIo_MmcStorageManagerService.h
inc/FIo_MmcStorageManagerStub.h
src/FIo_MmcStorageManagerService.cpp

diff --git a/inc/FIo_IMmcStorageManagerServiceListener.h b/inc/FIo_IMmcStorageManagerServiceListener.h
new file mode 100644 (file)
index 0000000..c12bff2
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file       FIo_IMmcStorageManagerServiceListener.h
+ * @brief      This is the header file for the _IMmcStorageManagerServiceListener class.
+ */
+
+#ifndef _FIO_INTERNAL_IMMC_STORAGE_MANAGER_SERVICE_LISTENER_H_
+#define _FIO_INTERNAL_IMMC_STORAGE_MANAGER_SERVICE_LISTENER_H_
+
+#include <FBaseResult.h>
+#include <FBaseRtIEventListener.h>
+
+namespace Tizen { namespace Io
+{
+
+/**
+ * @interface _IMmcStorageManagerServiceListener
+ * @brief      This interface defines the listener for the events from _MmcStorageManagerService
+ * @since 2.2
+ *
+ * Application should not implement this interface.
+ */
+class _OSP_EXPORT_ _IMmcStorageManagerServiceListener
+       : virtual public Tizen::Base::Runtime::IEventListener
+{
+
+public:
+       ~_IMmcStorageManagerServiceListener(void) {}
+
+       virtual void OnMmcMountResponseReceived(result r) = 0;
+
+       virtual void OnMmcUnmountResponseReceived(result r) = 0;
+
+       virtual void OnMmcFormatResponseReceived(result r) = 0;
+
+}; // _MmcStorageManagerServiceListener
+
+}} // Tizen::Io
+
+#endif // _FIO_INTERNAL_IMMC_STORAGE_MANAGER_SERVICE_LISTENER_H_
+
index 4999669..6d18e02 100644 (file)
@@ -41,7 +41,7 @@
 namespace Tizen { namespace Io  {
 
 static const int _MAX_PATH_LENGTH = 256;
-class _IMmcStorageManagerListener;
+class _IMmcStorageManagerServiceListener;
 
 /**
  * @class      _MmcStorageManagerService
@@ -56,7 +56,7 @@ class _MmcStorageManagerService
        typedef std::pair< std::string, Tizen::Base::String* > _AppListPair;
 
 public:
-       result Construct(_IMmcStorageManagerListener* pStub);
+       result Construct(_IMmcStorageManagerServiceListener* pStub);
 
        result Mount(void);
 
@@ -83,7 +83,7 @@ private:
 
 private:
        static _MmcStorageManagerService* __pMmcStorageManagerService;
-       _IMmcStorageManagerListener* __pStub;
+       _IMmcStorageManagerServiceListener* __pStub;
        _AppList __appList;
        Tizen::Base::Collection::HashMap* __pVirtualRootList;
        friend class Tizen::App::_ContextManager;
index 8c843dd..5321bab 100644 (file)
@@ -28,7 +28,7 @@
 #include <FBaseString.h>
 
 #include <FIo_IIpcServerEventListener.h>
-#include <FIo_IMmcStorageManagerListener.h>
+#include <FIo_IMmcStorageManagerServiceListener.h>
 
 
 namespace Tizen { namespace Io {
@@ -38,7 +38,7 @@ class _MmcStorageManagerService;
 class _MmcStorageManagerStub :
        public Tizen::Base::Object,
        public Tizen::Io::_IIpcServerEventListener,
-       public Tizen::Io::_IMmcStorageManagerListener
+       public Tizen::Io::_IMmcStorageManagerServiceListener
 {
 
 public:
index 6fc66a9..82f3511 100644 (file)
@@ -96,7 +96,7 @@ MmcMountCb(int response, void* data)
 
        ospResult = _MmcStorageManagerService::ConvertNativeErrorToResult(response);
        SysTryLog(NID_IO, !IsFailed(ospResult), "[%s] Failed to mount MMC, errno: %d (%s)", GetErrorMessage(ospResult), response, strerror(response));
-       ((_IMmcStorageManagerListener*)data)->OnMmcMountResponseReceived(ospResult);
+       ((_IMmcStorageManagerServiceListener*)data)->OnMmcMountResponseReceived(ospResult);
 }
 
 static void
@@ -107,7 +107,7 @@ MmcUnmountCb(int response, void* data)
 
        ospResult = _MmcStorageManagerService::ConvertNativeErrorToResult(response);
        SysTryLog(NID_IO, !IsFailed(ospResult), "[%s] Failed to unmount MMC, errno: %d (%s)", GetErrorMessage(ospResult), response, strerror(response));
-       ((_IMmcStorageManagerListener*)data)->OnMmcUnmountResponseReceived(ospResult);
+       ((_IMmcStorageManagerServiceListener*)data)->OnMmcUnmountResponseReceived(ospResult);
 }
 
 static void
@@ -118,7 +118,7 @@ MmcFormatCb(int response, void* data)
 
        ospResult = _MmcStorageManagerService::ConvertNativeErrorToResult(response);
        SysTryLog(NID_IO, !IsFailed(ospResult), "[%s] Failed to format MMC, errno: %d (%s)", GetErrorMessage(ospResult), response, strerror(response));
-       ((_IMmcStorageManagerListener*)data)->OnMmcFormatResponseReceived(ospResult);
+       ((_IMmcStorageManagerServiceListener*)data)->OnMmcFormatResponseReceived(ospResult);
 }
 
 _MmcStorageManagerService::_MmcStorageManagerService(void)
@@ -147,7 +147,7 @@ _MmcStorageManagerService::GetInstance(void)
 }
 
 result
-_MmcStorageManagerService::Construct(_IMmcStorageManagerListener* pStub)
+_MmcStorageManagerService::Construct(_IMmcStorageManagerServiceListener* pStub)
 {
        __pStub = pStub;