2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FCntContentTransferEvent.h
18 * @brief This is the header file for the %ContentTransferEvent class.
21 #ifndef _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_
22 #define _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_
24 #include <unique_ptr.h>
25 #include <FBaseRt_Event.h>
26 #include <FBaseRtIEventArg.h>
28 namespace Tizen { namespace Content
32 // @enum ContentTransferEventType
33 // @brief This represents ContentTransfer's event type.
35 enum ContentTransferEventType
37 CONTENT_TRANSFER_EVENT_NONE, // Event None
38 CONTENT_TRANSFER_EVENT_DOWNLOAD_COMPLETED, // Event None
39 CONTENT_TRANSFER_EVENT_CANCELED,
40 CONTENT_TRANSFER_EVENT_DOWNLOAD_TO_BUFFER_COMPLETED,
41 CONTENT_TRANSFER_EVENT_TRANSFER_IN_PROGRESS
44 class _ContentTransferEvent
45 : public Tizen::Base::Runtime::_Event
48 _ContentTransferEvent(void);
49 virtual ~_ContentTransferEvent(void);
53 * Finds out and invokes the method of listener corresponding to the specified event argument.
55 * @return The error code.
56 * @param[in] pListener An event listener to be invoked. This must be an instance of ICameraEventListener.
57 * @param[in] arg An argument to be fired.
58 * @exception E_SUCCESS - This method is successful.
59 * @exception E_OUT_OF_MEMORY - Failed to allocate the required/requested memory.
60 * @exception E_INVALID_STATE - The current state of the camera is inappropriate or invalid for this method.
61 * @exception E_INVALID_ARG - The argument passed to a method contains an invalid value.
63 virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
66 _ContentTransferEvent(const _ContentTransferEvent& rhs);
67 _ContentTransferEvent& operator =(const _ContentTransferEvent& rhs);
69 }; // class _ContentTransferEvent
72 class _ContentTransferEventArg
73 : public Tizen::Base::Runtime::IEventArg
76 _ContentTransferEventArg(void);
77 virtual ~_ContentTransferEventArg(void);
83 * @return ContentTransfer Event type of this argument.
85 ContentTransferEventType GetEventType(void) const;
87 result GetResult(void) const;
89 Tizen::Base::String GetErrorMsg(void) const;
91 Tizen::Base::String GetErrorCode(void) const;
93 RequestId GetRequestId(void) const;
95 ContentId GetContentId(void) const;
97 int GetTotalTransferedSize(void) const;
99 Tizen::Base::ByteBuffer* GetBuffer(void) const;
102 * Set the event type.
104 void SetEventType(ContentTransferEventType eType);
106 void SetResult(result res);
108 void SetErrorMsg(const Tizen::Base::String& ErrorCode, const Tizen::Base::String& ErrorMsg);
110 void SetRequestId(RequestId requestId);
112 void SetContentId(const ContentId& contentId);
114 void SetTotalTransferedSize(int totalSize);
116 void SetBuffer(Tizen::Base::ByteBuffer* pBuffer);
119 _ContentTransferEventArg(const _ContentTransferEventArg& rhs);
120 _ContentTransferEventArg& operator =(const _ContentTransferEventArg& rhs);
123 RequestId __requestId;
124 ContentId __contentId;
125 ContentTransferEventType __contentTransferEventType;
128 Tizen::Base::String __errorMsg;
129 Tizen::Base::String __errorCode;
130 std::unique_ptr<Tizen::Base::ByteBuffer> __pBuffer;
131 }; // class _ContentTransferEventArg
135 #endif // _FCNT_INTERNAL_CONTENT_TRANSFER_EVENT_H_