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
26 using namespace Osp::Net;
\r
27 using namespace Osp::Net::Sockets;
\r
28 using namespace Osp::Base;
\r
30 public Osp::Ui::Controls::Form,
\r
31 public Osp::Ui::IActionEventListener,
\r
32 public Osp::Net::Sockets::ISocketEventListener,
\r
33 public Osp::Ui::Controls::IFormBackEventListener
\r
41 ChatFrm(Ip4Address *add, int port, bool server, bool protocol,Osp::Ui::Controls::Form* prv);
\r
42 virtual ~ChatFrm(void);
\r
43 bool Initialize(void);
\r
47 static const int ID_BUTTON_SEND = 101;
\r
48 static const int ID_LABEL_WAIT = 102;
\r
49 static const int ID_BUTTON_CLOSE_POPUP = 103;
\r
50 Osp::Ui::Controls::Form *__pFormme;
\r
51 Osp::Ui::Controls::Button *__pButtonSend;
\r
52 Osp::Ui::Controls::Label *__pLabelWait;
\r
53 Osp::Ui::Controls::EditArea *__pEditAreaData;
\r
54 Osp::Ui::Controls::EditField *__pEditFieldtext;
\r
56 Osp::Net::Ip4Address *__pip_clientip;
\r
58 bool b_protocol; // true = tcp false = udp
\r
61 Osp::Net::Sockets::Socket* __pSocket;
\r
62 Osp::Net::Sockets::Socket* __pTcpOrgSocket;
\r
63 Osp::Net::NetEndPoint* __pUdpEndpoint;
\r
64 Osp::Ui::Controls::Form* __pPreviousForm;
\r
65 Osp::Ui::Controls::Popup* __pPopup;
\r
66 Osp::Ui::Controls::Footer* __pFooter;
\r
68 virtual result OnInitializing(void);
\r
69 virtual result OnTerminating(void);
\r
70 virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
\r
72 void OnSocketAccept(Socket& socket);
\r
73 void OnSocketClosed(Socket& socket1, NetSocketClosedReason reason);
\r
74 void OnSocketConnected(Socket& socket1);
\r
75 void OnSocketReadyToReceive(Socket& socket);
\r
76 void OnSocketReadyToSend(Socket& socket1);
\r
77 virtual void OnFormBackRequested (Osp::Ui::Controls::Form &source);
\r
78 void EnableControl(bool val);
\r
81 result ReceiveData();
\r
84 result ReceiveDataUDP();
\r
85 result ReceiveDataTCP();
\r
86 result DisplayText(ByteBuffer &txBuffer,unsigned long buflen);
\r
87 result SendDataCommand(String command);
\r
88 result SocketServer();
\r
89 result SocketClient();
\r
90 result CreateSocket(NetSocketType type, NetSocketProtocol protocol);
\r
93 void WaitAndHidePopup();
\r
97 #endif //_CHATFRM_H_
\r