Tizen 2.1 base
[platform/framework/native/app-service.git] / inc / FIo_MmcStorageManagerStub.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file         FIo_MmcStorageManagerStub.h
20  * @brief       This is the header file of the _MmcStorageManagerStub class.
21  *
22  * This header file contains the declarations of the _MmcStorageManagerStub class.
23  */
24
25 #ifndef _FIO_INTERNAL_MMC_STORAGE_MANAGER_STUB_H_
26 #define _FIO_INTERNAL_MMC_STORAGE_MANAGER_STUB_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30
31 #include <FIo_IIpcServerEventListener.h>
32 #include <FIo_IMmcStorageServiceEventListener.h>
33
34
35 namespace Tizen { namespace Io {
36
37 class _MmcStorageManagerService;
38
39 class _MmcStorageManagerStub :
40         public Tizen::Base::Object,
41         public Tizen::Io::_IIpcServerEventListener,
42         public Tizen::Io::_IMmcStorageServiceEventListener
43 {
44
45 public:
46         _MmcStorageManagerStub(void);
47         virtual ~_MmcStorageManagerStub(void);
48         result Construct(void);
49
50         // ipc handlers.
51         void OnMount(result* pRes);
52         void OnUnmount(result* pRes);
53         void OnFormat(result* pRes);
54
55         // Server to Client messages
56         virtual result OnMmcMountResponseReceived(result response);
57         virtual result OnMmcUnmountResponseReceived(result response);
58         virtual result OnMmcFormatResponseReceived(result response);
59
60 private:
61         _MmcStorageManagerStub(const _MmcStorageManagerStub& value);
62         _MmcStorageManagerStub& operator =(const _MmcStorageManagerStub& source);
63
64         // _IIpcServerEventListener
65         virtual void OnIpcServerStarted(const Tizen::Io::_IpcServer& server);
66         virtual void OnIpcServerStopped(const Tizen::Io::_IpcServer& server);
67         virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
68         virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
69         virtual void OnIpcRequestReceived(Tizen::Io::_IpcServer& server, const IPC::Message& message);
70
71         // internal
72         result StartIpcServer(void);
73
74 private:
75         Tizen::Io::_IpcServer* __pIpcServer;
76         _MmcStorageManagerService* __pMmcStorageManagerService;
77         bool __operationInProgress;
78         int __clientId;
79 };      //_MmcStorageManagerStub
80
81 }} //Tizen::App
82
83 #endif // _FIO_INTERNAL_MMC_STORAGE_MANAGER_STUB_H_