diff options
Diffstat (limited to 'src/controls/FWebCtrl_WebEventArg.h')
-rwxr-xr-x | src/controls/FWebCtrl_WebEventArg.h | 234 |
1 files changed, 234 insertions, 0 deletions
diff --git a/src/controls/FWebCtrl_WebEventArg.h b/src/controls/FWebCtrl_WebEventArg.h new file mode 100755 index 0000000..6c636fe --- /dev/null +++ b/src/controls/FWebCtrl_WebEventArg.h @@ -0,0 +1,234 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FWebCtrl_WebEventArg.h + * @brief The file contains the declaration of _WebEventArg class. + * + * The file contains the declaration of _WebEvent class. + */ +#ifndef _FWEB_CTRL_INTERNAL_WEB_EVENT_ARG_H_ +#define _FWEB_CTRL_INTERNAL_WEB_EVENT_ARG_H_ + +#include <unique_ptr.h> +#include <FBaseColAllElementsDeleter.h> +#include <FBaseColHashMap.h> +#include <FBaseObject.h> +#include <FBaseByteBuffer.h> +#include <FBaseString.h> +#include <FBaseRtIEventArg.h> + + + + +namespace Tizen { namespace Web { namespace Controls +{ + +enum _WebEventType +{ + WEB_EVENT_REQUEST_SERVICE = 0x000, + WEB_EVENT_REQUEST_RTSP, + WEB_EVENT_REQUEST_EMAIL, + WEB_EVENT_REQUEST_TEL, + WEB_EVENT_REQUEST_SMS, + WEB_EVENT_REQUEST_MMS, + WEB_EVENT_REQUEST_UNKNOWN, + + WEB_EVENT_DELIVER_JSBRIDGE_REQUEST = 0x100, + + WEB_EVENT_LOADINGLISTENER = 0x200, + WEB_EVENT_LOADINGLISTENER_STARTED, + WEB_EVENT_LOADINGLISTENER_PROGRESS, + WEB_EVENT_LOADINGLISTENER_PAGETITLE_RECEIVED, + WEB_EVENT_LOADINGLISTENER_CANCELED, + WEB_EVENT_LOADINGLISTENER_ERROR_OCCURRED, + WEB_EVENT_LOADINGLISTENER_COMPLETED, + WEB_EVENT_LOADINGLISTENER_AUTHENTICATION_REQUESTED, + WEB_EVENT_LOADINGLISTENER_AUTHENTICATION_CANCELED, + + WEB_EVENT_WEBDOWNLOADLISTENER = 0x300, + WEB_EVENT_WEBDOWNLOADLISTENER_DATA_RECEIVED, + WEB_EVENT_WEBDOWNLOADLISTENER_COMPLETED, + WEB_EVENT_WEBDOWNLOADLISTENER_FAILED, + + WEB_EVENT_WEBUIEVENTLISTENER = 0x400, + WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED, + WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED, + WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED, + + WEB_EVENT_TEXTSEARCHLISTENER = 0x500, + WEB_EVENT_TEXTSEARCHLISTENER_TEXT_FOUND +}; + +class _WebEventArg + : public Tizen::Base::Object + , public Tizen::Base::Runtime::IEventArg +{ +public: + _WebEventArg(int eventType, const Tizen::Base::String& message); + virtual ~_WebEventArg(void); + + int GetEventType(void) const; + int GetEventGroup(void) const; + Tizen::Base::String GetEventMessage(void) const; + +private: + int __eventType; + Tizen::Base::String __message; +}; // _WebEventArg + +class _JsBridgeArg + : public _WebEventArg +{ +public: + _JsBridgeArg(void); + virtual ~_JsBridgeArg(void); + + result Construct(const char* pJsonText); + + const Tizen::Base::ByteBuffer* GetJsonData(void) const; + +private: + // Copy constructor + _JsBridgeArg(const _JsBridgeArg& bridge); + + // Assignment operator + _JsBridgeArg& operator =(const _JsBridgeArg& bridge); + +private: + std::unique_ptr<Tizen::Base::ByteBuffer> __pJsonText; +}; // _JsBridgeArg + +class _LoadingEventArg + : public _WebEventArg +{ +public: + _LoadingEventArg(int loadingEvent); + virtual ~_LoadingEventArg(void); + + enum EventInfoKey + { + ESTIMATED_PROGRESS, + PAGE_TITLE, + ERROR_TYPE, + ERROR_MESSAGE, + AUTHENTICATION_HOST, + AUTHENTICATION_REALM, + AUTHENTICATION_CHALLENGE + }; + + result SetEventInfo(EventInfoKey key, const Tizen::Base::Object& value); + const Tizen::Base::Object* GetEventInfo(EventInfoKey key) const; + +private: + // Copy constructor + _LoadingEventArg(const _LoadingEventArg& rhs); + + // Assignment operator + _LoadingEventArg& operator =(const _LoadingEventArg& rhs); + +private: + std::unique_ptr<Tizen::Base::Collection::HashMap, Tizen::Base::Collection::AllElementsDeleter> __pEventInfo; + +}; // _LoadingEventArg + +class _WebDownloadEventArg + : public _WebEventArg +{ +public: + _WebDownloadEventArg(int webDownloadEvent); + virtual ~_WebDownloadEventArg(void); + + enum EventInfoKey + { + CHUNKED_DATA, + ERROR_TYPE + }; + + result SetEventInfo(EventInfoKey key, const Tizen::Base::Object& value); + const Tizen::Base::Object* GetEventInfo(EventInfoKey key) const; + +private: + // Copy constructor + _WebDownloadEventArg(const _WebDownloadEventArg& rhs); + + // Assignment operator + _WebDownloadEventArg& operator =(const _WebDownloadEventArg& rhs); + +private: + std::unique_ptr<Tizen::Base::Collection::HashMap, Tizen::Base::Collection::AllElementsDeleter> __pEventInfo; + +}; // _WebDownloadEventArg + +class _WebUiEventArg + : public _WebEventArg +{ +public: + _WebUiEventArg(int webUiEvent); + virtual ~_WebUiEventArg(void); + + enum EventInfoKey + { + BLOCK_START, + BLOCK_END + }; + + result SetEventInfo(EventInfoKey key, const Tizen::Base::Object& value); + const Tizen::Base::Object* GetEventInfo(EventInfoKey key) const; + +private: + // Copy constructor + _WebUiEventArg(const _WebUiEventArg& rhs); + + // Assignment operator + _WebUiEventArg& operator =(const _WebUiEventArg& rhs); + +private: + std::unique_ptr<Tizen::Base::Collection::HashMap, Tizen::Base::Collection::AllElementsDeleter> __pEventInfo; + +}; // _WebUiEventArg + +class _TextSearchEventArg + : public _WebEventArg +{ +public: + _TextSearchEventArg(int textFoundEvent); + virtual ~_TextSearchEventArg(void); + + enum EventInfoKey + { + TOTAL_COUNT, + CURRENT_ORDINAL + }; + + result SetEventInfo(EventInfoKey key, const Tizen::Base::Object& value); + const Tizen::Base::Object* GetEventInfo(EventInfoKey key) const; + +private: + // Copy constructor + _TextSearchEventArg(const _TextSearchEventArg& rhs); + + // Assignment operator + _TextSearchEventArg& operator =(const _TextSearchEventArg& rhs); + +private: + std::unique_ptr<Tizen::Base::Collection::HashMap, Tizen::Base::Collection::AllElementsDeleter> __pEventInfo; + +}; // _TextSearchEventArg + +}}} // Tizen::Web::Controls +#endif // _FWEB_CTRL_INTERNAL_WEB_EVENT_ARG_H_ |