2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FCntContentTransferEvent.h
19 * @brief This is the header file for the %ContentTransferEvent class.
22 #ifndef _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_
23 #define _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_
25 #include <unique_ptr.h>
26 #include <FBaseRt_Event.h>
27 #include <FBaseRtIEventArg.h>
29 namespace Tizen { namespace Content
33 // @enum ContentTransferEventType
34 // @brief This represents ContentTransfer's event type.
36 enum ContentTransferEventType
38 CONTENT_TRANSFER_EVENT_NONE, // Event None
39 CONTENT_TRANSFER_EVENT_DOWNLOAD_COMPLETED, // Event None
40 CONTENT_TRANSFER_EVENT_CANCELED,
41 CONTENT_TRANSFER_EVENT_DOWNLOAD_TO_BUFFER_COMPLETED,
42 CONTENT_TRANSFER_EVENT_TRANSFER_IN_PROGRESS
45 class _ContentTransferEvent
46 : public Tizen::Base::Runtime::_Event
49 _ContentTransferEvent(void);
50 virtual ~_ContentTransferEvent(void);
54 * Finds out and invokes the method of listener corresponding to the specified event argument.
56 * @return The error code.
57 * @param[in] pListener An event listener to be invoked. This must be an instance of ICameraEventListener.
58 * @param[in] arg An argument to be fired.
59 * @exception E_SUCCESS - This method is successful.
60 * @exception E_OUT_OF_MEMORY - Failed to allocate the required/requested memory.
61 * @exception E_INVALID_STATE - The current state of the camera is inappropriate or invalid for this method.
62 * @exception E_INVALID_ARG - The argument passed to a method contains an invalid value.
64 virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
67 _ContentTransferEvent(const _ContentTransferEvent& rhs);
68 _ContentTransferEvent& operator =(const _ContentTransferEvent& rhs);
70 }; // class _ContentTransferEvent
73 class _ContentTransferEventArg
74 : public Tizen::Base::Runtime::IEventArg
77 _ContentTransferEventArg(void);
78 virtual ~_ContentTransferEventArg(void);
84 * @return ContentTransfer Event type of this argument.
86 ContentTransferEventType GetEventType(void) const;
88 result GetResult(void) const;
90 Tizen::Base::String GetErrorMsg(void) const;
92 Tizen::Base::String GetErrorCode(void) const;
94 RequestId GetRequestId(void) const;
96 ContentId GetContentId(void) const;
98 int GetTotalTransferedSize(void) const;
100 Tizen::Base::ByteBuffer* GetBuffer(void) const;
103 * Set the event type.
105 void SetEventType(ContentTransferEventType eType);
107 void SetResult(result res);
109 void SetErrorMsg(const Tizen::Base::String& ErrorCode, const Tizen::Base::String& ErrorMsg);
111 void SetRequestId(RequestId requestId);
113 void SetContentId(const ContentId& contentId);
115 void SetTotalTransferedSize(int totalSize);
117 void SetBuffer(Tizen::Base::ByteBuffer* pBuffer);
120 _ContentTransferEventArg(const _ContentTransferEventArg& rhs);
121 _ContentTransferEventArg& operator =(const _ContentTransferEventArg& rhs);
124 RequestId __requestId;
125 ContentId __contentId;
126 ContentTransferEventType __contentTransferEventType;
129 Tizen::Base::String __errorMsg;
130 Tizen::Base::String __errorCode;
131 std::unique_ptr<Tizen::Base::ByteBuffer> __pBuffer;
132 }; // class _ContentTransferEventArg
136 #endif // _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_