sync with tizen_2.0
[platform/framework/native/appfw.git] / src / base / runtime / FBaseRt_EventDrivenThreadImpl.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        FBaseRt_EventDrivenThreadImpl.h
20  * @brief       This is the header file for the _EventDrivenThreadImpl class.
21  *
22  * This file contains the declarations of _EventDrivenThreadImpl.
23  */
24
25 #ifndef _FRT_THREAD_INTERNAL_EVENTDRIVEN_THREAD_IMPL_H_
26 #define _FRT_THREAD_INTERNAL_EVENTDRIVEN_THREAD_IMPL_H_
27
28 #include <glib.h>
29
30 #include <FBaseColLinkedListT.h>
31
32 #include "FBaseRt_EventDispatcher.h"
33 #include "FBaseRt_ThreadImpl.h"
34 #include "FBaseRt_EventDrivenThreadEvent.h"
35 #include "FBaseRt_EventDrivenThreadEventArg.h"
36
37
38 namespace Tizen { namespace Base { namespace Runtime
39 {
40
41 class _EventDrivenThreadImpl
42         : public _ThreadImpl
43         , public _IEventDrivenThreadEventListener
44 {
45 public:
46         _EventDrivenThreadImpl(Thread& thread, const String& name, long stackSize, ThreadPriority priority);
47
48         virtual ~_EventDrivenThreadImpl(void);
49
50         virtual result Stop(void);
51
52         virtual Tizen::Base::Object* Run(void);
53
54         virtual result Initialize(void);
55
56         virtual result SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs);
57
58         virtual void OnUserEventReceivedN(RequestId reqId, Tizen::Base::Collection::IList* pArgs);
59
60         virtual void OnStop(void);
61
62 private:
63         _EventDrivenThreadImpl(const _EventDrivenThreadImpl& value);
64
65         _EventDrivenThreadImpl& operator =(const _EventDrivenThreadImpl& value);
66
67 private:
68         GMainLoop* __pGMainLoop;
69         _EventDispatcher* __pEventDispatcher;
70         _EventManager* __pEventManager;
71         _EventDrivenThreadEvent* __pEvent;
72         Tizen::Base::Collection::LinkedListT <_EventDrivenThreadEventArg*> __pendingEvents;
73 };
74
75 } } } // Tizen::Base::Runtime
76
77 #endif  // _FRT_THREAD_INTERNAL_EVENTDRIVEN_THREAD_H_