2 // Open Service Platform
\r
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
5 // Licensed under the Flora License, Version 1.0 (the License);
\r
6 // you may not use this file except in compliance with the License.
\r
7 // You may obtain a copy of the License at
\r
9 // http://www.tizenopensource.org/license
\r
11 // Unless required by applicable law or agreed to in writing, software
\r
12 // distributed under the License is distributed on an AS IS BASIS,
\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 // See the License for the specific language governing permissions and
\r
15 // limitations under the License.
\r
17 #ifndef _MAIN_FORM_H_
\r
18 #define _MAIN_FORM_H_
\r
22 #include "ConnectionManager.h"
\r
25 class FriendListForm;
\r
27 #define FRIEND_FINDER_IMAGE_DIR L"data/Image"
\r
28 #define FRIEND_FINDER_USER_INFO_PATH L"data/FriendFinderInfo.txt"
\r
29 #define FRIEND_FINDER_DEVICE_NAME_PREFIX L"FriendFinder_"
\r
33 FORM_ID_PROFILE_FORM,
\r
34 FORM_ID_FRIEND_LIST_FORM
\r
35 }FriendFinderFormId;
\r
38 public Osp::Ui::Controls::Form,
\r
39 public Osp::Ui::IActionEventListener,
\r
40 public Osp::Ui::ITouchEventListener
\r
45 virtual ~MainForm(void);
\r
47 bool Initialize(void);
\r
51 virtual result OnInitializing(void);
\r
53 // from IActionEventListener
\r
54 virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
\r
56 // from ITouchEventListener
\r
57 virtual void OnTouchPressed (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo);
\r
58 virtual void OnTouchDoublePressed (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
59 virtual void OnTouchFocusIn (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
60 virtual void OnTouchFocusOut (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
61 virtual void OnTouchLongPressed (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
62 virtual void OnTouchMoved (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
63 virtual void OnTouchReleased (const Osp::Ui::Control& source, const Osp::Graphics::Point& currentPosition, const Osp::Ui::TouchEventInfo &touchInfo){}
\r
66 void ShowMainForm(FriendFinderFormId formId, Osp::Base::Object* pData);
\r
67 void ShowFriendProfile(const Osp::Base::String& userName, const Osp::Base::String& imagePath, const Osp::Base::String& deviceName);
\r
68 void ClearFriendProfile(void);
\r
69 void ShowRequestPopup(const Osp::Base::String& targetName);
\r
70 void CloseRequestPopup(void);
\r
71 void ShowConnectingPopup(const Osp::Base::String& targetName);
\r
72 void CloseConnectingPopup(void);
\r
73 void UpdateProgressBar(int progress);
\r
74 void EnableCancelButton(void);
\r
75 void DisableCancelButton(void);
\r
76 void ShowTimeoutMessageBox(const Osp::Base::String& title, const Osp::Base::String& text, unsigned long timeout);
\r
77 void ShowNoticePopup(const Osp::Base::String& title, const Osp::Base::String& description);
\r
78 void CloseNoticePopup(void);
\r
81 void ShowSubForm(FriendFinderFormId formId);
\r
84 static const int ID_BUTTON_ACCEPT_CONNECTION = 101;
\r
85 static const int ID_BUTTON_REJECT_CONNECTION = 102;
\r
86 static const int ID_BUTTON_CANCEL_CONNECTION = 103;
\r
87 static const int ID_BUTTON_NOTICE_POPUP_CLOSE = 104;
\r
88 static const int ID_OPTION_FIND_FRIEND = 105;
\r
89 static const int ID_OPTION_PROFILE = 106;
\r
91 Osp::Ui::Controls::Panel* __pProfilePanel;
\r
92 Osp::Ui::Controls::Label* __pFriendProfileLabel;
\r
93 Osp::Ui::Controls::Label* __pConnectionStatusLabel;
\r
95 Osp::Ui::Controls::Popup* __pRequestPopup;
\r
97 Osp::Ui::Controls::Popup* __pConnectingPopup;
\r
98 Osp::Ui::Controls::Button* __pConnectingCancelButton;
\r
99 Osp::Ui::Controls::Progress* __pConnectingProgress;
\r
101 Osp::Ui::Controls::Popup* __pNoticePopup;
\r
103 ProfileForm* __pProfileForm;
\r
104 FriendListForm* __pFriendListForm;
\r
105 ConnectionManager __connManager;
\r
107 Osp::Base::String __friendImagePath;
\r
110 #endif //_MAIN_FORM_H_
\r