Added IPropagatedListener to the progressing popup
[apps/osp/Gallery.git] / inc / GlTimerBase.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                GlTimerBase.h
19  * @brief               This is the header file for GlTimerBase class.
20  */
21
22 #ifndef _GL_TIMER_BASE_H_
23 #define _GL_TIMER_BASE_H_
24
25 #include <FUi.h>
26 #include "GlFileOpInvalidateListener.h"
27
28 class GlProgressBar;
29
30 class GlTimerBase
31         : public Tizen::Ui::IActionEventListener
32         , public Tizen::Base::Runtime::ITimerEventListener
33         , public Tizen::Ui::IPropagatedKeyEventListener
34 {
35 public:
36
37         GlTimerBase(IFileOpInvalidateListener*, enum FileActionMode actionId);
38         virtual ~GlTimerBase(void);
39
40         bool StartTimer(void);
41         void CancelTimer(void);
42         void SetActionMode(const enum FileActionMode actionId);
43
44         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
45
46         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
47
48         void Cancel(void);
49         bool IsStarted(void);
50
51         int GetMovedCount() const;
52
53         virtual bool OnKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo){ return false; };
54         virtual bool OnKeyReleased(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo);
55         virtual bool OnPreviewKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo){ return false;};
56         virtual bool OnPreviewKeyReleased(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo){ return false;};
57
58
59 protected:
60         virtual Tizen::Base::Collection::IList* TimerStart(void) = 0;
61         virtual result TimerExpired(const Tizen::Base::Object*) = 0;
62         virtual void TimerCancel(int, enum FileActionCancelRes res) = 0;
63         virtual void TimerComplete(int, enum FileActionCompleteRes res) = 0;
64
65 private:
66         void OnOpComplete(enum FileActionCompleteRes);
67         void OnOpCancelled(enum FileActionCancelRes res);
68
69 protected:
70         enum FileActionMode _actionId;
71
72 private:
73         Tizen::Base::Runtime::Timer __moveTimer;
74         Tizen::Base::Collection::IList * __pContentIdList;
75         int __moveToCount;
76         GlProgressBar* __pMoveProBar;
77         IFileOpInvalidateListener* __pInvalidate;
78         bool __isStarted;
79  };
80
81 #endif //_GL_TIMER_BASE_H_