sync with master
[apps/osp/Call.git] / inc / CallErrorMsgPopup.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (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                CallErrorMsgPopup.h
19  * @brief               This is the header file for the %ErrorMsgPopup class.
20  *
21  * This header file contains the declarations for %ErrorMsgPopup class.
22  */
23 #ifndef _PHN_ERROR_MSG_POPUP_H_
24 #define _PHN_ERROR_MSG_POPUP_H_
25
26 #include <FBase.h>
27 #include <FUi.h>
28
29 /**
30  * @class IPopupClosedEventListener
31  * @brief This interface is used to notify the popup is closed event to Scenes.
32  *
33  */
34 class IPopupClosedEventListener
35 {
36 public:
37         virtual ~IPopupClosedEventListener(void){};
38         // Called when the error message Pop-up is closed.
39         virtual void HandlePopupClosed(void) = 0;
40 };
41
42 /**
43  * @class ErrorMsgPopup
44  * @brief This class shows message popup in error condition.
45  *
46  */
47 class ErrorMsgPopup: public Tizen::Ui::Controls::Popup
48                                         ,public Tizen::Base::Runtime::ITimerEventListener
49 {
50 public:
51         ErrorMsgPopup(IPopupClosedEventListener* pEventListener);
52         virtual ~ErrorMsgPopup(void);
53         /**
54          * Function is used to show error message popup
55          * based on the error code received.
56          */
57         void ShowErrorMsgPopupN(int errorCode);
58
59         //From ITimerEventListener
60         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
61
62 private:
63         void ConstructPopup(int errorCode);
64         //Function is used to fetch error messages based on error code
65         Tizen::Base::String FetchErrorMessage(int errorCode);
66         //draws and shows the popup on screen
67         void ShowPopup(void);
68
69 private:
70         //Timer used to show message
71         Tizen::Base::Runtime::Timer* __pTimer;
72         //Listener to popup closed event.
73         IPopupClosedEventListener* __pEventListener;
74         //used to close the popup
75         int __popupModalResult;
76 };
77
78 #endif // _PHN_ERROR_MSG_POPUP_H_