/usr/include/osp/app
/usr/include/osp/base
/usr/include/osp/security
- /usr/include/messaging
+ /usr/include/msg-service
+ /usr/include/dbus-1.0
+ /usr/lib/dbus-1.0/include
/usr/include/email-service
/usr/include/libxml2
)
TARGET_LINK_LIBRARIES(${this_target} "-lchromium" )
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-json -losp-net -losp-shell-core" )
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-application" )
-TARGET_LINK_LIBRARIES(${this_target} "-lcapi-messaging-email" )
+TARGET_LINK_LIBRARIES(${this_target} "-ldbus-1" )
+TARGET_LINK_LIBRARIES(${this_target} "-ldbus-glib-1" )
TARGET_LINK_LIBRARIES(${this_target} "-lemail-api" )
-TARGET_LINK_LIBRARIES(${this_target} "-lcapi-messaging-messages" )
+TARGET_LINK_LIBRARIES(${this_target} "-lmsg_mapi" )
TARGET_LINK_LIBRARIES(${this_target} "-lpush" )
#ifndef _FMESSAGING_H_
#define _FMESSAGING_H_
-//include
#include <FMsgTypes.h>
#include <FMsgSmsMessage.h>
#include <FMsgMmsMessage.h>
#include <FMsgEmailManager.h>
#include <FMsgPushManager.h>
#include <FMsgRecipientList.h>
+#include <FMsgCbsMessage.h>
+#include <FMsgEtwsPrimaryNotification.h>
#include <FMsgISmsListener.h>
#include <FMsgIMmsListener.h>
#include <FMsgIEmailListener.h>
#include <FMsgISmsMessageEventListener.h>
#include <FMsgIPushEventListener.h>
#include <FMsgIPushManagerListener.h>
+#include <FMsgIEtwsPrimaryNotificationEventListener.h>
/**
* @namespace Tizen::Messaging
// limitations under the License.\r
//\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @file FMsgCbsChannel.h\r
* @brief This is the header file for the %CbsChannel class.\r
*\r
-* @visibility partner-operator\r
-*\r
* This header file contains the declarations of the %CbsChannel class.\r
-*\r
-* @endif\r
*/\r
\r
#ifndef _FMSG_CBS_CHANNEL_H_\r
#define _FMSG_CBS_CHANNEL_H_\r
\r
-#include <FBase.h>\r
+namespace Tizen { namespace Base\r
+{\r
+class String;\r
+} }\r
+\r
+#include <FBaseObject.h>\r
\r
namespace Tizen { namespace Messaging\r
{\r
class _CbsChannelImpl;\r
\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @class CbsChannel\r
* @brief This class provides methods for handling a Cell Broadcast Service (CBS) channel.\r
*\r
*\r
* @final This class is not intended for extension.\r
*\r
-* @visibility partner-operator\r
-*\r
* The %CbsChannel class provides methods for handling a CBS channel. @n\r
* It allows you to get and set the CBS channel information.\r
-*\r
-* @endif\r
*/\r
class _OSP_EXPORT_ CbsChannel\r
: public Tizen::Base::Object\r
public:\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* This destructor overrides Tizen::Base::Object::~Object().\r
*\r
* @since 2.0\r
- *\r
- * @visibility partner-operator\r
- *\r
- * @endif\r
*/\r
virtual ~CbsChannel(void);\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the range of a CBS channel\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
- *\r
* @return An error code\r
* @param[out] from The starting index of the message ID of the channel\r
* @param[out] to The last index of the message ID of the channel\r
* @exception E_INVALID_STATE The range has not been set as yet.\r
* @exception E_SYSTEM A system error has occurred.\r
* @remarks In case of an error, this method sets the negative values for @c from and @c to. For example, @c -1.\r
- *\r
- * @endif\r
*/\r
result GetRange(int& from, int& to) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the name of a CBS channel.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
- *\r
* @return The name of the channel\r
*\r
* @remarks The name can be an empty string.\r
- *\r
- * @endif\r
*/\r
Tizen::Base::String GetName(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Checks whether a CBS channel is activated.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
- *\r
* @return @c true if a CBS channel is activated, @n\r
* else @c false\r
- *\r
- * @endif\r
*/\r
bool IsActivated(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Activates the status of a CBS channel.\r
*\r
* @since 2.0\r
- *\r
- * @visibility partner-operator\r
- *\r
- * @privilege %http://tizen.org/privilege/cellbroadcast\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/cellbroadcast\r
*\r
* @return An error code\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_ILLEGAL_ACCESS The application does not have the permission to activate the CBS channel status.\r
* @exception E_SYSTEM A system error has occurred.\r
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- *\r
- * @endif\r
*/\r
result Activate(void);\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Deactivates the status of a CBS channel.\r
- *\r
- * @privilege %http://tizen.org/privilege/cellbroadcast\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/cellbroadcast\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return An error code\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_ILLEGAL_ACCESS The application does not have the permission to activate the CBS channel status.\r
* @exception E_SYSTEM A system error has occurred.\r
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- *\r
- * @endif\r
*/\r
result Deactivate(void);\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Updates the name of a CBS channel.\r
- *\r
- * @privilege %http://tizen.org/privilege/cellbroadcast\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/cellbroadcast\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return An error code\r
* @param[in] name The name of the CBS channel to update\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_ILLEGAL_ACCESS The application does not have the permission to update the CBS channel name.\r
* @exception E_SYSTEM A system error has occurred.\r
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- *\r
- * @endif\r
*/\r
result UpdateName(const Tizen::Base::String& name);\r
\r
* - The specified @c to parameter is smaller than @c from. @n\r
* - The specified @c to or @c from parameter is a negative value. @n\r
* - The specified @c to parameter exceeds the limit (0xFFFF). @n\r
- * - The range (@c to - @c from) exceeds the limit (900). @n\r
+ * - The range (@c to - @c from) exceeds the limit (0xFFFF). @n\r
* - The specified @c name string length is greater than @c 32. @n\r
* @exception E_SYSTEM A system error has occurred.\r
*/\r
-//
-// Open Service Platform
-// Copyright (c) 2012-2013 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.
-//
-/**
-* @if VISPARTNER-OPERATOR
-*
-* @file FMsgCbsMessage.h
-* @brief This is the header file for the %CbsMessage class.
-*
-* @visibility partner-operator
-*
-* This header file contains the declarations of the %CbsMessage class.
-*
-* @endif
-*/
-
-#ifndef _FMSG_CBS_MESSAGE_H_
-#define _FMSG_CBS_MESSAGE_H_
-
-#include <FBase.h>
-#include <FApp.h>
-#include <FMsgTypes.h>
-
-namespace Tizen { namespace Messaging
-{
-
-class _CbsMessageImpl;
-
-/**
-* @if VISPARTNER-OPERATOR
-*
-* @class CbsMessage
-*
-* @brief This class provides methods for handling a CBS message.
-*
-* @since 2.0
-*
-* @final This class is not intended for extension.
-*
-* @visibility partner-operator
-*
-* The %CbsMessage class provides methods for handling a CBS message (including the ETWS secondary notification). It allows you to get the serial number,
-* message ID, body text, and received time of a CBS message.
-*
-* @endif
-*/
-class _OSP_EXPORT_ CbsMessage
- : public Tizen::Base::Object
-{
-public:
- /**
- * @if VISPARTNER-OPERATOR
- *
- * This destructor overrides Tizen::Base::Object::~Object().
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
- */
- virtual ~CbsMessage(void);
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Compares the calling instance with the specified instance.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return @c true if the specified instance of Object is equal to the calling %CbsMessage instance, @n
- * else @c false
- * @param[in] obj An instance of Object to compare
- * @see Object::Equals()
- *
- * @endif
- */
- virtual bool Equals(const Tizen::Base::Object& obj) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Copies the instance of a class.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return An instance of %CbsMessage
- * @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
- *
- * @remarks In case of error, this method returns @c null. @n
- * The specific error code can be accessed using the GetLastResult() method.
- *
- * @endif
- */
- CbsMessage* CloneN(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the hash value of the current instance.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The hash value of the current instance
- *
- * @endif
- */
- virtual int GetHashCode(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Checks whether this message is an ETWS notification.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return @c true if this message is an ETWS notification, @n
- * else @c false
- * @remarks If the return value is @c true, the message is ETWS secondary notification.
- *
- * @endif
- */
- bool IsEtwsNotification(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the serial number of the CBS message.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The serial number of the CBS message
- * @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @remarks The specific error code can be accessed using the GetLastResult() method. @n
- * In case of an error, this method returns null.
- *
- * @endif
- */
- Tizen::Base::ByteBuffer* GetSerialNumberN(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the message ID of the CBS message.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The the message ID of the CBS message
- *
- * @endif
- */
- int GetMessageId(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the body of a message.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The body of a message
- *
- * @endif
- */
- Tizen::Base::String GetText(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the date and time (UTC time) of the message when it is received.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The date and time (UTC time) when the message is received
- *
- * @endif
- */
- Tizen::Base::DateTime GetReceivedTime(void) const;
-
- /**
- * @if VISPARTNER-OPERATOR
- *
- * Gets the Data Coding Scheme of the CBS message.
- *
- * @since 2.0
- *
- * @visibility partner-operator
- *
- * @return The Data Coding Scheme of the CBS message
- * @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_MEMORY The memory is insufficient.
- * @remarks The specific error code can be accessed using the GetLastResult() method. @n
- * In case of an error, this method returns null. @n
- * The alphabet/coding and the language applied to CBS messages are defined in 3GPP TS 23.038
- *
- * @endif
- */
- byte GetDataCodingScheme(void) const;
-
-private:
- /**
- * This default constructor is intentionally declared as private so that only the platform can create an instance.
- *
- * @since 2.0
- */
- CbsMessage(void);
-
- /**
- * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
- *
- * @since 2.0
- *
- * @param[in] rhs An instance of %CbsMessage
- */
- CbsMessage(const CbsMessage& rhs);
-
- /**
- * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. @n
- * - Use CloneN() to get an exact copy of the instance.
- * - Use Equals() to compare the contents of one instance with the other.
- *
- * @since 2.0
- *
- * @return A reference to this instance
- * @param[in] rhs An instance of %CbsMessage
- */
- CbsMessage& operator =(const CbsMessage& rhs);
-
-private:
- _CbsMessageImpl* __pCbsMessageImpl;
-
- friend class _CbsMessageImpl;
-}; // CbsMessage
-
-} } // Tizen::Messaging
-#endif // _FMSG_CBS_MESSAGE_H_
+//\r
+// Open Service Platform\r
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+/**\r
+* @file FMsgCbsMessage.h\r
+* @brief This is the header file for the %CbsMessage class.\r
+*\r
+* This header file contains the declarations of the %CbsMessage class.\r
+*/\r
+\r
+#ifndef _FMSG_CBS_MESSAGE_H_\r
+#define _FMSG_CBS_MESSAGE_H_\r
+\r
+namespace Tizen { namespace Base\r
+{\r
+class ByteBuffer;\r
+class String;\r
+class DateTime;\r
+} }\r
+\r
+#include <FBaseObject.h>\r
+#include <FMsgTypes.h>\r
+\r
+namespace Tizen { namespace Messaging\r
+{\r
+\r
+class _CbsMessageImpl;\r
+\r
+/**\r
+* @class CbsMessage\r
+*\r
+* @brief This class provides methods for handling a CBS message.\r
+*\r
+* @since 2.0\r
+*\r
+* @final This class is not intended for extension.\r
+*\r
+* The %CbsMessage class provides methods for handling a CBS message (including the ETWS secondary notification). It allows you to get the serial number,\r
+* message ID, body text, and received time of a CBS message.\r
+*/\r
+class _OSP_EXPORT_ CbsMessage\r
+ : public Tizen::Base::Object\r
+{\r
+public:\r
+ /**\r
+ * This destructor overrides Tizen::Base::Object::~Object().\r
+ *\r
+ * @since 2.0\r
+ */\r
+ virtual ~CbsMessage(void);\r
+\r
+ /**\r
+ * Compares the calling instance with the specified instance.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return @c true if the specified instance of Object is equal to the calling %CbsMessage instance, @n\r
+ * else @c false\r
+ * @param[in] obj An instance of Object to compare\r
+ * @see Object::Equals()\r
+ */\r
+ virtual bool Equals(const Tizen::Base::Object& obj) const;\r
+\r
+ /**\r
+ * Copies the instance of a class.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return An instance of %CbsMessage\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.\r
+ *\r
+ * @remarks In case of error, this method returns @c null. @n\r
+ * The specific error code can be accessed using the GetLastResult() method.\r
+ */\r
+ CbsMessage* CloneN(void) const;\r
+\r
+ /**\r
+ * Gets the hash value of the current instance.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return The hash value of the current instance\r
+ */\r
+ virtual int GetHashCode(void) const;\r
+\r
+ /**\r
+ * Checks whether this message is an ETWS notification.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return @c true if this message is an ETWS notification, @n\r
+ * else @c false\r
+ * @remarks If the return value is @c true, the message is ETWS secondary notification.\r
+ */\r
+ bool IsEtwsNotification(void) const;\r
+\r
+ /**\r
+ * Gets the serial number of the CBS message.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return The serial number of the CBS message\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method. @n\r
+ * In case of an error, this method returns null.\r
+ */\r
+ Tizen::Base::ByteBuffer* GetSerialNumberN(void) const;\r
+\r
+ /**\r
+ * Gets the message ID of the CBS message.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return The message ID of the CBS message\r
+ */\r
+ int GetMessageId(void) const;\r
+\r
+ /**\r
+ * Gets the body of a message.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ *\r
+ * @return The body of a message\r
+ */\r
+ Tizen::Base::String GetText(void) const;\r
+\r
+ /**\r
+ * Gets the date and time (UTC time) of the message when it is received.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return The date and time (UTC time) when the message is received\r
+ */\r
+ Tizen::Base::DateTime GetReceivedTime(void) const;\r
+\r
+ /**\r
+ * Gets the Data Coding Scheme of the CBS message.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return The Data Coding Scheme of the CBS message\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method. @n\r
+ * In case of an error, this method returns null. @n\r
+ * The alphabet/coding and the language applied to CBS messages are defined in 3GPP TS 23.038\r
+ */\r
+ byte GetDataCodingScheme(void) const;\r
+\r
+ /**\r
+ * Gets the language type of a message.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @return The language type of a message \r
+ */\r
+ Tizen::Base::String GetLanguageType(void) const;\r
+\r
+private:\r
+ /**\r
+ * This default constructor is intentionally declared as private so that only the platform can create an instance.\r
+ *\r
+ * @since 2.0\r
+ */\r
+ CbsMessage(void);\r
+\r
+ /**\r
+ * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @param[in] rhs An instance of %CbsMessage\r
+ */\r
+ CbsMessage(const CbsMessage& rhs);\r
+\r
+ /**\r
+ * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects. @n\r
+ * - Use CloneN() to get an exact copy of the instance.\r
+ * - Use Equals() to compare the contents of one instance with the other.\r
+ *\r
+ * @since 2.0\r
+ *\r
+ * @return A reference to this instance\r
+ * @param[in] rhs An instance of %CbsMessage\r
+ */\r
+ CbsMessage& operator =(const CbsMessage& rhs);\r
+\r
+private:\r
+ _CbsMessageImpl* __pCbsMessageImpl;\r
+\r
+ friend class _CbsMessageImpl;\r
+}; // CbsMessage\r
+\r
+} } // Tizen::Messaging\r
+#endif // _FMSG_CBS_MESSAGE_H_\r
// limitations under the License.
//
/**
-* @if VISPARTNER-OPERATOR
-*
* @file FMsgDetailedEmailMessage.h
* @brief This is the header file for the %DetailedEmailMessage class.
*
-* @visibility partner-operator
-*
* This header file contains the declarations of the %DetailedEmailMessage class.
-*
-* @endif
*/
#ifndef _FMSG_DETAILED_EMAIL_MESSAGE_H_
#define _FMSG_DETAILED_EMAIL_MESSAGE_H_
-#include <FBase.h>
+namespace Tizen { namespace Base
+{
+class String;
+class DateTime;
+namespace Collection
+{
+ class IList;
+}
+} }
+
#include <FMsgTypes.h>
#include <FMsgEmailAttachment.h>
namespace Tizen { namespace Messaging
{
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailMessageClass
*
* Defines the class of the email messages.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @endif
*/
-enum EmailMessageClass
-{
- EMAIL_MESSAGE_CLASS_UNSPECIFIED = 0, /**<unspecified */
- EMAIL_MESSAGE_CLASS_UNKNOWN, /**<unknown */
- EMAIL_MESSAGE_CLASS_NOTE, /**<Normal email message */
- EMAIL_MESSAGE_CLASS_NOTE_RULES_OOF_TEMPLATE_MICROSOFT, /**<Out-of-office template */
- EMAIL_MESSAGE_CLASS_NOTE_SMIME, /**<The message is encrypted and can also be signed */
- EMAIL_MESSAGE_CLASS_NOTE_SMIME_MULTIPART_SIGNED, /**<The message is clear signed */
- EMAIL_MESSAGE_CLASS_NOTIFICATION_MEETING, /**<Meeting notification */
- EMAIL_MESSAGE_CLASS_OCTEL_VOICE, /**<Octel voice message */
- EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_REQUEST, /**<Meeting request */
- EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_CANCELLED, /**<Meeting cancelled */
- EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_POSITIVE_RESPONSE, /**<Positive meeting response */
- EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_TENTATIVE_RESPONSE, /**<Tentative meeting response */
- EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_NEGATIVE_RESPONSE, /**<Negative meeting response */
- EMAIL_MESSAGE_CLASS_POST, /**<Post */
- EMAIL_MESSAGE_CLASS_INFO_PATH_FORM, /**<An InfoPath form */
- EMAIL_MESSAGE_CLASS_VOICE_NOTES, /**<Electronic voice notes */
- EMAIL_MESSAGE_CLASS_SHARING, /**<Shared message */
- //EMAIL_MESSAGE_CLASS_NOTE_EXCHANGE_ACTIVE_SYNC_REMOTE_WIPE_CONFIRMATION, // should be added
- EMAIL_MESSAGE_CLASS_VOICE_MAIL, /**<Voice mail */
- //EMAIL_MESSAGE_CLASS_SMS,
- //EMAIL_MESSAGE_CLASS_SMART_REPLY = 0x01000000,
- //EMAIL_MESSAGE_CLASS_SMART_FORWARD = 0x02000000,
- EMAIL_MESSAGE_CLASS_REPORT_NOT_READ_REPORT = 0x10000000, /**<Not read report for a standard message */
- EMAIL_MESSAGE_CLASS_REPORT_READ_REPORT = 0x20000000, /**<Read report for a standard message */
- EMAIL_MESSAGE_CLASS_REPORT_NON_DELIVERY_RECEIPT = 0x40000000, /**<Non-delivery report for a standard message */
- EMAIL_MESSAGE_CLASS_REPORT_DELIVERY_RECEIPT = 0x80000000 /**<Delivery receipt for a standard message */
-};
+ enum EmailMessageClass
+ {
+ EMAIL_MESSAGE_CLASS_UNSPECIFIED = 0, /**<unspecified */
+ EMAIL_MESSAGE_CLASS_UNKNOWN, /**<unknown */
+ EMAIL_MESSAGE_CLASS_NOTE, /**<Normal email message */
+ EMAIL_MESSAGE_CLASS_NOTE_RULES_OOF_TEMPLATE_MICROSOFT, /**<Out-of-office template */
+ EMAIL_MESSAGE_CLASS_NOTE_SMIME, /**<The message is encrypted and can also be signed */
+ EMAIL_MESSAGE_CLASS_NOTE_SMIME_MULTIPART_SIGNED, /**<The message is clear signed */
+ EMAIL_MESSAGE_CLASS_NOTIFICATION_MEETING, /**<Meeting notification */
+ EMAIL_MESSAGE_CLASS_OCTEL_VOICE, /**<Octel voice message */
+ EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_REQUEST, /**<Meeting request */
+ EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_CANCELLED, /**<Meeting cancelled */
+ EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_POSITIVE_RESPONSE, /**<Positive meeting response */
+ EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_TENTATIVE_RESPONSE, /**<Tentative meeting response */
+ EMAIL_MESSAGE_CLASS_SCHEDULE_MEETING_NEGATIVE_RESPONSE, /**<Negative meeting response */
+ EMAIL_MESSAGE_CLASS_POST, /**<Post */
+ EMAIL_MESSAGE_CLASS_INFO_PATH_FORM, /**<An InfoPath form */
+ EMAIL_MESSAGE_CLASS_VOICE_NOTES, /**<Electronic voice notes */
+ EMAIL_MESSAGE_CLASS_SHARING, /**<Shared message */
+ //EMAIL_MESSAGE_CLASS_NOTE_EXCHANGE_ACTIVE_SYNC_REMOTE_WIPE_CONFIRMATION, // should be added
+ EMAIL_MESSAGE_CLASS_VOICE_MAIL, /**<Voice mail */
+ //EMAIL_MESSAGE_CLASS_SMS,
+ //EMAIL_MESSAGE_CLASS_SMART_REPLY = 0x01000000,
+ //EMAIL_MESSAGE_CLASS_SMART_FORWARD = 0x02000000,
+ EMAIL_MESSAGE_CLASS_REPORT_NOT_READ_REPORT = 0x10000000, /**<Not read report for a standard message */
+ EMAIL_MESSAGE_CLASS_REPORT_READ_REPORT = 0x20000000, /**<Read report for a standard message */
+ EMAIL_MESSAGE_CLASS_REPORT_NON_DELIVERY_RECEIPT = 0x40000000, /**<Non-delivery report for a standard message */
+ EMAIL_MESSAGE_CLASS_REPORT_DELIVERY_RECEIPT = 0x80000000 /**<Delivery receipt for a standard message */
+ };
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailDigestType
*
* Defines the digest type of the email messages.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
enum EmailDigestType
{
};
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailSmimeType
*
* Defines the S/MIME type of the email messages.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
enum EmailSmimeType
{
};
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailReturnReceiptType
*
* Defines the return receipt type for an email message.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
enum EmailReturnReceiptType
{
};
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailMessageBodyType
*
* Defines the type of an email message body.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
enum EmailMessageBodyType
{
class _DetailedEmailMessageImpl;
/**
- * @if VISPARTNER-OPERATOR
- *
* @class DetailedEmailMessage
* @brief This class provides methods for handling detailed email messages.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* The %DetailedEmailMessage class provides methods for handling detailed email messages.
- *
- * @endif
*/
class _OSP_EXPORT_ DetailedEmailMessage
: public Tizen::Base::Object
// Life cycle
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the default constructor for this class.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
DetailedEmailMessage(void);
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the destructor for this class.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
virtual ~DetailedEmailMessage(void);
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the copy constructor for the %DetailedEmailMessage class. @n
* Copying of objects using this copy constructor is allowed.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @param[in] rhs An instance of %DetailedEmailMessage
- *
- * @endif
*/
DetailedEmailMessage(const DetailedEmailMessage& rhs);
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* Assigns the value of the specified instance to the current instance of %DetailedEmailMessage. @n
* Copying of objects using this copy assignment operator is allowed.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The reference of this instance
* @param[in] rhs An instance of %DetailedEmailMessage
- *
- * @endif
*/
DetailedEmailMessage& operator =(const DetailedEmailMessage& rhs);
/**
- * @if VISPARTNER-OPERATOR
- *
* Compares the calling instance with the specified instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %DetailedEmailMessage instance, @n
* else @c false
* @param[in] obj An instance of Tizen::Base::Object to compare
- *
- * @endif
*/
virtual bool Equals(const Tizen::Base::Object& obj) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the hash value of the current instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The hash value of the current instance
- *
- * @endif
*/
virtual int GetHashCode(void) const;
// Getters
///////////////////////////////////////////////////////////////
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the message ID.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The message ID
* @see SetMessageId()
- *
- * @endif
*/
Tizen::Base::String GetMessageId(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the subject of an email message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The subject of an email message
* @see SetSubject()
- *
- * @endif
*/
Tizen::Base::String GetSubject(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the time when an email message is created.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The time when an email message is created
* @remarks The creation time may be updated by mail server when an email is sent.
* @see SetCreationTime()
- *
- * @endif
*/
Tizen::Base::DateTime GetCreationTime(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the email address of the specific recipient type.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The email address of the specific recipient type
* @param[in] type The type of recipient
* @exception E_SUCCESS The method is successful.
* The specific error code can be accessed using the GetLastResult() method.
* @see SetAddress()
*
- * @endif
*/
Tizen::Base::String GetAddress(RecipientType type) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the email address of an author.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The email address of an author
* @see SetFromAddress()
- *
- * @endif
*/
Tizen::Base::String GetFromAddress(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the email address used to reply to a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The email address used to reply to a message
* @see SetReplyToAddress()
- *
- * @endif
*/
Tizen::Base::String GetReplyToAddress(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the return path.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The return path
* @see SetReturnPath()
- *
- * @endif
*/
Tizen::Base::String GetReturnPath(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the file path of the specified message body type.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The file path of the message body
* @param[in] type The type of message body
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c type is invalid.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetFilePath()
- *
- * @endif
*/
Tizen::Base::String GetFilePath(EmailMessageBodyType type) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the priority of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The priority of a message
* @see SetPriority()
- *
- * @endif
*/
EmailMessagePriority GetPriority(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the return receipt type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The return receipt type of a message
* @see SetReturnReceiptType()
- *
- * @endif
*/
EmailReturnReceiptType GetReturnReceiptType(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the inline content count of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The inline content count of a message
* @see SetInlineContentCount()
- *
- * @endif
*/
int GetInlineContentCount(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the class of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The class of a message
* @see SetClass()
- *
- * @endif
*/
EmailMessageClass GetClass(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the digest type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The digest type of the message
* @see SetDigestType()
- *
- * @endif
*/
EmailDigestType GetDigestType(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the S/MIME type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The S/MIME type of a message
* @see SetSmimeType()
- *
- * @endif
*/
EmailSmimeType GetSmimeType(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the attachment list of this message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return A pointer to the attachment list
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
* After using the attachment list, you can call Tizen::Base::Collection::IList::RemoveAll(true) to clean up items in the list.
* @see EmailAttachment
* @see SetAttachmentList()
- *
- * @endif
*/
Tizen::Base::Collection::IList* GetAttachmentListN(void);
// Setters
///////////////////////////////////////////////////////////////
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the message ID.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] messageId The message ID
* @exception E_SUCCESS The method is successful.
* @remarks The message ID is an automatically generated field. @n
* It is used to prevent multiple delivery and for reference in In-Reply-To.
* @see GetMessageId()
- *
- * @endif
*/
result SetMessageId(const Tizen::Base::String& messageId);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the subject of an email message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] subject The subject of the email message
* @exception E_SUCCESS The method is successful.
* @exception E_MAX_EXCEEDED The subject length of the message exceeds the maximum limit (Maximum 256 characters).
* @see GetSubject()
- *
- * @endif
*/
result SetSubject(const Tizen::Base::String& subject);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the time when an email message is created.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] dateTime The time when the email message is created
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c dateTime is invalid. @n
* The valid range of the time can be from "January 1 1900 00:00:00" to "December 31 2100 23:59:59".
* @see GetCreationTime()
- *
- * @endif
*/
result SetCreationTime(const Tizen::Base::DateTime& dateTime);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the recipient list of the specific recipient type.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The type of recipient
* @param[in] recipients The recipients string
* @remarks The values for the various recipients can be a string with multiple email addresses separated by semi-colons(;).@n
* The specified @c type contains RECIPIENT_TYPE_TO, RECIPIENT_TYPE_CC, RECIPIENT_TYPE_BCC.
* @see GetAddress()
- *
- * @endif
*/
result SetAddress(RecipientType type, const Tizen::Base::String& recipients);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the email address of an author.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] address The email address of the author
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c address string length is too short (< 5).
* @see GetFromAddress()
- *
- * @endif
*/
result SetFromAddress(const Tizen::Base::String& address);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the email address used to reply to a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] address The email address used to reply to the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c address string length is too short (< 5).
* @see GetReplyToAddress()
- *
- * @endif
*/
result SetReplyToAddress(const Tizen::Base::String& address);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the return path.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] address The return path
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c address string length is too short (< 5).
* @see GetReturnPath()
*
- * @endif
*/
result SetReturnPath(const Tizen::Base::String& address);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the file path of the specified message body type.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The type of message body
* @param[in] filePath The file path of the message body
* @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
* @see GetFilePath()
*
- * @endif
*/
result SetFilePath(EmailMessageBodyType type, const Tizen::Base::String& filePath);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the priority of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] priority The priority of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c priority is invalid.
* @see GetPriority()
- *
- * @endif
*/
result SetPriority(EmailMessagePriority priority);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the return receipt type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The return receipt type of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c type is invalid.
* @see GetReturnReceiptType()
- *
- * @endif
*/
result SetReturnReceiptType(EmailReturnReceiptType type);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the inline content count of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] count The inline content count of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c count is less than @c 0.
* @see GetInlineContentCount()
- *
- * @endif
*/
result SetInlineContentCount(int count);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the class of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] messageClass The class of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c messageClass is invalid.
* @see GetClass()
- *
- * @endif
*/
result SetClass(EmailMessageClass messageClass);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the digest type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The digest type of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c type is invalid.
* @see GetDigestType()
- *
- * @endif
*/
result SetDigestType(EmailDigestType type);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the S/MIME type of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The S/MIME type of the message
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The specified @c type is invalid.
* @see GetSmimeType()
- *
- * @endif
*/
result SetSmimeType(EmailSmimeType type);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the attachment list for this message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] pList A list of EmailAttachment
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The list is not made of EmailAttachment.
* @see EmailAttachment
* @see GetAttachmentListN()
- *
- * @endif
*/
result SetAttachmentList(const Tizen::Base::Collection::IList* pList);
// static methods
///////////////////////////////////////////////////////////////
/**
- * @if VISPARTNER-OPERATOR
- *
* Parses the MIME file to %DetailedEmailMessage format.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] filePath The MIME file path to parse
* @param[out] message The parsed message
* @exception E_PARSING_FAILED The method has failed to parse the MIME file.
* @exception E_SYSTEM A system error has occurred.
* @see WriteToMimeFile()
- *
- * @endif
*/
static result ParseMimeFile(const Tizen::Base::String& filePath, DetailedEmailMessage& message);
/**
- * @if VISPARTNER-OPERATOR
- *
* Writes to the MIME file from %DetailedEmailMessage.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] message The message to read
* @param[in] filePath The file path of the MIME file to write
* @exception E_FILE_ALREADY_EXIST The specified file already exists.
* @exception E_SYSTEM A system error has occurred.
* @see ParseMimeFile()
- *
- * @endif
*/
static result WriteToMimeFile(const DetailedEmailMessage& message, const Tizen::Base::String& filePath);
-
-
private:
_DetailedEmailMessageImpl* __pImpl;
// limitations under the License.
//
/**
-* @if VISPARTNER-OPERATOR
-*
* @file FMsgEmailAttachment.h
* @brief This is the header file for the %EmailAttachment class.
*
-* @visibility partner-operator
-*
* This header file contains the declarations of the %EmailAttachment class.
-*
-* @endif
*/
#ifndef _FMSG_EMAIL_ATTACHMENT_H_
#define _FMSG_EMAIL_ATTACHMENT_H_
-#include <FBase.h>
+namespace Tizen { namespace Base
+{
+class String;
+} }
+
+#include <FBaseObject.h>
#include <FMsgTypes.h>
namespace Tizen { namespace Messaging
class _EmailAttachmentImpl;
/**
- * @if VISPARTNER-OPERATOR
- *
* @class EmailAttachment
* @brief This class provides methods for handling email attachments.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* The %EmailAttachment class provides methods for handling email attachments.
- *
- * @endif
*/
class _OSP_EXPORT_ EmailAttachment
: public Tizen::Base::Object
// Life cycle
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the default constructor for this class.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
EmailAttachment(void);
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the destructor for this class.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
virtual ~EmailAttachment(void);
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the copy constructor for the %EmailAttachment class. @n
* Copying of objects using this copy constructor is allowed.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @param[in] rhs An instance of %EmailAttachment
- *
- * @endif
*/
EmailAttachment(const EmailAttachment& rhs);
-
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* Assigns the value of the specified instance to the current instance of %EmailAttachment. @n
* Copying of objects using this copy assignment operator is allowed.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The reference of this instance
* @param[in] rhs An instance of %EmailAttachment
- *
- * @endif
*/
EmailAttachment& operator =(const EmailAttachment& rhs);
/**
- * @if VISPARTNER-OPERATOR
- *
* Compares the calling instance with the specified instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return @c true if the specified instance of Tizen::Base::Object is equal to the calling %EmailAttachment instance, @n
* else @c false
* @param[in] obj An instance of Tizen::Base::Object to compare
- *
- * @endif
*/
virtual bool Equals(const Tizen::Base::Object& obj) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the hash value of the current instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The hash value of the current instance
- *
- * @endif
*/
virtual int GetHashCode(void) const;
// Getters
///////////////////////////////////////////////////////////////
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the name of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The name of an email attachment
* @see SetName()
- *
- * @endif
*/
Tizen::Base::String GetName(void) const;
/**
- *
- * @if VISPARTNER-OPERATOR
- *
* Gets the file path of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The file path of an email attachment
* @see SetFilePath()
- *
- * @endif
*/
Tizen::Base::String GetFilePath(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the size of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The size of an email attachment
- *
- * @endif
*/
int GetSize(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the inline-content status of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return @c true if an email attachment has inline-content(s), @n
* else @c false
* @see SetInlineContentStatus()
- *
- * @endif
*/
bool GetInlineContentStatus(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the DRM status of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return @c true if an email attachment contains DRM, @n
* else @c false
* @see SetDrmStatus()
- *
- * @endif
*/
bool GetDrmStatus(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the MIME type of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The MIME type of an email attachment
* @see SetMimeType()
- *
- * @endif
*/
Tizen::Base::String GetMimeType(void) const;
// Setters
///////////////////////////////////////////////////////////////
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the name of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] name The name of the email attachment
* @exception E_SUCCESS The method is successful.
* @exception E_MAX_EXCEEDED The length of the name exceeds the maximum limit (Maximum 256 characters).
* @see GetName()
- *
- * @endif
*/
result SetName(const Tizen::Base::String& name);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the file path of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] filePath The file path of the attachment
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The length of the specified @c filePath is too long or @c 0.
* @exception E_FILE_NOT_FOUND The specified file cannot be found or accessed.
* @see GetFilePath()
- *
- * @endif
*/
result SetFilePath(const Tizen::Base::String& filePath);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the inline-content status of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @param[in] status Set to @c true to change the inline-content status of the attachment to true, @n
* else @c false
* @see GetInlineContentStatus()
- *
- * @endif
*/
void SetInlineContentStatus(bool status);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the DRM status of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @param[in] status Set to @c true to change the DRM status of the attachment to true, @n
* else @c false
* @see GetDrmStatus()
- *
- * @endif
*/
void SetDrmStatus(bool status);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the MIME type of an email attachment.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An error code
* @param[in] type The MIME type of the attachment
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG The length of the specified @c type is @c 0.
* @see GetMimeType()
- *
- * @endif
*/
result SetMimeType(const Tizen::Base::String& type);
* Sends the email message.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/messaging.email
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.email
*
* @return An error code
* @param[in] message The message to be sent
// limitations under the License.\r
//\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @file FMsgEtwsPrimaryNotification.h\r
* @brief This is the header file for the %EtwsPrimaryNotification class.\r
*\r
-* @visibility partner-operator\r
-*\r
* This header file contains the declarations of the %EtwsPrimaryNotification class.\r
-*\r
-* @endif\r
*/\r
\r
#ifndef _FMSG_ETWS_PRIMARY_NOTIFICATION_H_\r
#define _FMSG_ETWS_PRIMARY_NOTIFICATION_H_\r
\r
-#include <FBase.h>\r
-#include <FApp.h>\r
+namespace Tizen { namespace Base\r
+{\r
+class DateTime;\r
+class ByteBuffer;\r
+} }\r
+\r
+#include <FBaseObject.h>\r
#include <FMsgTypes.h>\r
\r
namespace Tizen { namespace Messaging\r
class _EtwsPrimaryNotificationImpl;\r
\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @class EtwsPrimaryNotification\r
*\r
* @brief This class provides methods for handling an ETWS primary notification.\r
*\r
* @final This class is not intended for extension.\r
*\r
-* @visibility partner-operator\r
-*\r
* The %EtwsPrimaryNotification class provides methods for handling an ETWS primary notification. It allows you to get the serial number,\r
* message ID, warning type, warning security info, and received time of an ETWS primary notification.\r
-*\r
-* @endif\r
*/\r
class _OSP_EXPORT_ EtwsPrimaryNotification\r
: public Tizen::Base::Object\r
{\r
public:\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* This destructor overrides Tizen::Base::Object::~Object().\r
*\r
* @since 2.0\r
- *\r
- * @visibility partner-operator\r
- *\r
- * @endif\r
*/\r
virtual ~EtwsPrimaryNotification(void);\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Compares the specified instance of %EtwsPrimaryNotification with the calling instance.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return @c true if the values match, @n\r
* else @c false\r
* @param[in] obj The other Tizen::Base::Object to be compared\r
* @see Tizen::Base::Object::Equals()\r
- *\r
- * @endif\r
*/\r
virtual bool Equals(const Tizen::Base::Object& obj) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the copied instance of the class.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return An instance of %EtwsPrimaryNotification\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_OUT_OF_MEMORY The memory is insufficient.\r
*\r
* @remarks In case of error, this method returns @c null. @n\r
* The specific error code can be accessed using the GetLastResult() method.\r
- *\r
- * @endif\r
*/\r
EtwsPrimaryNotification* CloneN(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the hash value of the current instance.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The current instance's hash value\r
- *\r
- * @endif\r
*/\r
virtual int GetHashCode(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the date and time (UTC time) of the message when it is received.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The date and time (UTC time) when the message is received\r
- *\r
- * @endif\r
*/\r
Tizen::Base::DateTime GetReceivedTime(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the serial number of the ETWS primary notification.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The serial number of the ETWS primary notification\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_OUT_OF_MEMORY The memory is insufficient.\r
* @remarks The specific error code can be accessed using the GetLastResult() method. @n\r
* In case of an error, this method returns null.\r
- *\r
- * @endif\r
*/\r
Tizen::Base::ByteBuffer* GetSerialNumberN(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the message ID of the ETWS primary notification.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The message ID of the ETWS primary notification\r
- *\r
- * @endif\r
*/\r
int GetMessageId(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the warning type.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The ETWS warning type of the message\r
- *\r
- * @endif\r
*/\r
Tizen::Base::ByteBuffer* GetWarningTypeN(void) const;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Gets the warning security information of the ETWS primary notification.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @return The warning security information of the ETWS primary notification\r
* @exception E_SUCCESS The method is successful.\r
* @exception E_OUT_OF_MEMORY The memory is insufficient.\r
* @remarks The specific error code can be accessed using the GetLastResult() method. @n\r
* In case of an error, this method returns null.\r
- * @endif\r
*/\r
Tizen::Base::ByteBuffer* GetWarningSecurityInfoN(void) const;\r
\r
// limitations under the License.\r
//\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @file FMsgICbsMessageEventListener.h\r
* @brief This is the header file for the %ICbsMessageEventListener interface.\r
*\r
* This header file contains the declarations of the %ICbsMessageEventListener interface.\r
-*\r
-* @visibility partner-operator\r
-*\r
-* @endif\r
*/\r
\r
#ifndef _FMSG_ICBS_MESSAGE_EVENT_LISTENER_H_\r
#define _FMSG_ICBS_MESSAGE_EVENT_LISTENER_H_\r
\r
-#include <FBase.h>\r
-\r
namespace Tizen { namespace Messaging\r
{\r
class CbsMessage;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* @interface ICbsMessageEventListener\r
* @brief This is the listener interface for receiving CBS messages.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* The %ICbsMessageEventListener interface must be implemented to handle incoming CBS messages. An application must register this interface using the SmsManager::SetCbsMessageEventListener() method.\r
- *\r
- * @endif\r
*/\r
class _OSP_EXPORT_ ICbsMessageEventListener\r
: virtual public Tizen::Base::Runtime::IEventListener\r
{\r
public:\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* This polymorphic destructor should be overridden if required. @n\r
* This way, the destructors of the derived classes are called when the destructor of this interface is called.\r
-\r
*\r
* @since 2.0\r
- *\r
- * @visibility partner-operator\r
- *\r
- * @endif\r
*/\r
virtual ~ICbsMessageEventListener(void) {}\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Called when a CBS message is received.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @param[in] message The message that is received\r
* @see SmsManager::SetCbsMessageEventListener()\r
- *\r
- * @endif\r
*/\r
virtual void OnCbsMessageReceived(const CbsMessage& message) = 0;\r
\r
// limitations under the License.\r
//\r
/**\r
-* @if VISPARTNER-OPERATOR\r
-*\r
* @file FMsgIEtwsPrimaryNotificationEventListener.h\r
* @brief This is the header file for the %IEtwsPrimaryNotificationEventListener interface.\r
*\r
* This header file contains the declarations of the %IEtwsPrimaryNotificationEventListener interface.\r
-*\r
-* @visibility partner-operator\r
-*\r
-* @endif\r
*/\r
\r
#ifndef _FMSG_IETWS_PRIMARY_NOTIFICATION_EVENT_LISTENER_H_\r
class EtwsPrimaryNotification;\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* @interface IEtwsPrimaryNotificationEventListener\r
* @brief This is the listener interface for receiving ETWS primary notification.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* The %IEtwsPrimaryNotificationEventListener interface must be implemented to handle incoming ETWS primary notification.\r
* An application must register this interface using the SmsManager::SetEtwsPrimaryNotificationEventListener() method.\r
- *\r
- * @endif\r
*/\r
class _OSP_EXPORT_ IEtwsPrimaryNotificationEventListener\r
: virtual public Tizen::Messaging::ICbsMessageEventListener\r
{\r
public:\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* This polymorphic destructor should be overridden if required. @n\r
* This way, the destructors of the derived classes are called when the destructor of this interface is called.\r
\r
*\r
* @since 2.0\r
- *\r
- * @visibility partner-operator\r
- *\r
- * @endif\r
*/\r
virtual ~IEtwsPrimaryNotificationEventListener(void) {}\r
\r
/**\r
- * @if VISPARTNER-OPERATOR\r
- *\r
* Called when the ETWS primary notification is received.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-operator\r
- *\r
* @param[in] message The ETWS primary notification that is received\r
* @see SmsManager::SetEtwsPrimaryNotificationEventListener()\r
- *\r
- * @endif\r
*/\r
virtual void OnEtwsPrimaryNotificationReceived(const EtwsPrimaryNotification& message) = 0;\r
\r
// limitations under the License.
//
/**
- * @if VISPARTNER
- *
* @file FMsgISmsEventListener.h
* @brief This is the header file for the %ISmsEventListener interface.
- * @visibility partner
- *
* This header file contains the declarations of the %ISmsEventListener interface.
- *
- * @endif
*/
#ifndef _FMSG_ISMS_EVENT_LISTENER_H_
/**
- * @if VISPARTNER
- *
* @interface ISmsEventListener
* @brief This is the listener interface for receiving SMS messages.
*
* @since 2.0
*
- * @visibility partner
- *
* The %ISmsEventListener interface is the listener interface for receiving SMS messages.
* An application implements this interface and registers it using the SmsManager::AddSmsEventListener() method to receive SMS messages.
*
* For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/messaging.htm">Messaging Guide</a>.
- * @endif
*/
class _OSP_EXPORT_ ISmsEventListener
: virtual public Tizen::Base::Runtime::IEventListener
// Lifecycle
public:
/**
- * @if VISPARTNER
- *
* This is the destructor for this class.
*
* @since 2.0
- *
- * @visibility partner
- *
- * @endif
*/
virtual ~ISmsEventListener(void) {}
// Operations
public:
/**
- * @if VISPARTNER
- *
* Called when an SMS message is received.
*
* @since 2.0
*
- * @visibility partner
- *
* @param[in] port A port number
* @param[in] dateTime The date and time when the message is received
* @param[in] message The message that is received
* @see SmsManager::AddSmsEventListener()
* @see SmsManager::RemoveSmsEventListener()
- *
- * @endif
*/
virtual void OnSmsMessageReceived(int port, const Tizen::Base::DateTime& dateTime, const SmsMessage& message) = 0;
// limitations under the License.
//
/**
-* @if VISPARTNER-OPERATOR
-*
* @file FMsgIWapPushEventListener.h
* @brief This is the header file for the %IWapPushEventListener interface.
*
-* @visibility partner-operator
-*
* This header file contains the declaration of the %IWapPushEventListener interface.
-*
-* @endif
*/
#ifndef _FMSG_IWAP_PUSH_EVENT_LISTENER_H_
namespace Tizen { namespace Messaging
{
/**
-* @if VISPARTNER-OPERATOR
-*
* @interface IWapPushEventListener
* @brief This is the listener interface for receiving WAP Push messages.
*
* @since 2.0
*
-* @visibility partner-operator
-*
* The %IWapPushEventListener interface must be implemented to receive WAP Push messages. An application must register this interface using the WapPushManager::AddWapPushEventListener() method.
-*
-* @endif
*/
class _OSP_EXPORT_ IWapPushEventListener
: virtual public Tizen::Base::Runtime::IEventListener
{
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived
* classes are called when the destructor of this interface is called.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
virtual ~IWapPushEventListener(void) {}
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* Called when a WAP Push message is received.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @param[in] message The WAP push message
- *
- * @endif
*/
virtual void OnWapPushMessageReceived(const WapPushMessage& message) = 0;
* Sends the MMS message.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/messaging.mms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.mms
*
* @return An error code
* @param[in] message The message to be sent
* Initializes this instance of the %PushManager class with the specified parameters.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
*
* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
*
* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
*
* If an application receives unread messages with this method, the messages are removed from the system.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
*
* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push and %http://tizen.org/privilege/http @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push and http://tizen.org/privilege/http @n
* Both privileges are required
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
* This method is asynchronous.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/push and %http://tizen.org/privilege/http @n
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/push and http://tizen.org/privilege/http @n
* Both privileges are required
*
* @pre In order to use the push messaging service, see <a href="../org.tizen.native.appprogramming/html/guide/messaging/push_messaging.htm">Push Messaging Guide</a>.
* @exception E_OBJ_ALREADY_EXIST The specified @c recipient is already added.
* @exception E_INVALID_ARG The specified @c recipient string length is too short (< 3) or too long (> 320), or
* the specified @c type is invalid.
+ * @remarks The limit of the number of recipients is not checked in this method. This is done in the Send() method of each manager class (SmsManager, MmsManager, and EmailManager). @n
+ * The minimum length of a recipient is @c 3 for a phone number and @c 5 for an email address. @n
+ * The maximum length of a recipient is @c 41 for a phone number and @c 320 for an email address.
* @see Set()
* @see GetListN()
* @see SmsManager::Send()
result Construct(ISmsListener& listener);
/**
- * @if VISPARTNER
- *
* Adds the event listener for receiving SMS messages.
*
* @since 2.0
*
- * @visibility partner
- * @privilege %http://tizen.org/privilege/smstrigger
+ * @privlevel partner
+ * @privilege http://tizen.org/privilege/smstrigger
*
* @return An error code
* @param[in] port A port number
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see ISmsEventListener
* @see RemoveSmsEventListener()
- *
- * @endif
*/
result AddSmsEventListener(int port, ISmsEventListener& eventListener);
/**
- * @if VISPARTNER
- *
* Removes the event listener for receiving SMS messages.
*
* @since 2.0
*
- * @visibility partner
- * @privilege %http://tizen.org/privilege/smstrigger
+ * @privlevel partner
+ * @privilege http://tizen.org/privilege/smstrigger
*
* @return An error code
* @param[in] port A port number
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see ISmsEventListener
* @see AddSmsEventListener()
- *
- * @endif
*/
result RemoveSmsEventListener(int port, ISmsEventListener& eventListener);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return An error code
* @param[in] eventListener The listener to receive SMS messages
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return An error code
* @param[in] eventListener The listener to receive SMS messages
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return An error code
* @param[in] message The message to be sent
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The total number of SMS messages in the specified message box
* @param[in] type The type of message box
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return A pointer to the list of the SmsMessage class instances
* @param[in] pKeyword A part of the body text as a keyword (partial match) @n
* @exception E_SUCCESS The method is successful.
* @exception E_INVALID_ARG Either of the following conditions has occurred: @n
* - The specified @c pKeyword string length is less than @c 2 or greater than @c 30. @n
+ * - The specified @c pSenderAddress string length is less than @c 3 or greater than @c 41. @n
* - The specified @c startIndex value is less than @c 0. @n
* - The specified @c count value is less than @c 0 or greater than @c 20.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return A pointer to the list of the SmsMessage class instances
* @param[in] type The type of message box
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/messaging.sms
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The full text of the specified SMS message
* @param[in] messageId The unique ID of the message
Tizen::Base::String GetFullText(int messageId) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the event listener for receiving CB messages.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] pListener The listener to receive CB messages
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see ICbsMessageEventListener
- *
- * @endif
*/
result SetCbsMessageEventListener(ICbsMessageEventListener* pListener);
/**
- * @if VISPARTNER-OPERATOR
- *
* Sets the event listener for receiving ETWS primary notification.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] pListener The listener to receive ETWS primary notification
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see IEtwsPrimaryNotificationEventListener
- *
- * @endif
*/
result SetEtwsPrimaryNotificationEventListener(IEtwsPrimaryNotificationEventListener* pListener);
/**
- * @if VISPARTNER-OPERATOR
- *
* Enables or disables the save option for CBS message to the CbsBox
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] enable Set to @c true to save the message in the CbsBox, @n
* @exception E_SUCCESS The method is successful.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- *
- * @endif
*/
result SetSavingToCbsBoxEnabled(bool enable);
/**
- * @if VISPARTNER-OPERATOR
- *
* Checks whether the CB service is enabled.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return @c true if the CB service is enabled, @n
* else @c false
* @see SetCbsEnabled()
- *
- * @endif
*/
bool IsCbsEnabled(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Enables or disables the CB service.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] enable Set to @c true to enable the CB service, @n
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see IsCbsEnabled()
- *
- * @endif
*/
result SetCbsEnabled(bool enable);
/**
- * @if VISPARTNER-OPERATOR
- *
* Adds a CBS channel with specified parameters.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] from The starting index of the message ID of the channel
* - The specified @c to parameter is smaller than @c from. @n
* - The specified @c to or @c from parameter is a negative value. @n
* - The specified @c to parameter exceeds the limit (0xFFFF). @n
- * - The range (@c to - @c from) exceeds the limit (900).
+ * - The range (@c to - @c from) exceeds the limit (0xFFFF).
* - The specified @c name string length is greater than @c 32. @n
* @exception E_ALREADY_SET The channel range (@c from ~ @c to) is already set.
* @exception E_ILLEGAL_ACCESS The application does not have the permission to add the CBS channel.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see RemoveCbsChannel()
- *
- * @endif
*/
result AddCbsChannel(int from, int to, Tizen::Base::String& name, bool activate = true);
/**
- * @if VISPARTNER-OPERATOR
- *
* Removes a CBS channel.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return An error code
* @param[in] from The starting index of the message ID of the channel
* - The specified @c to parameter is smaller than @c from. @n
* - The specified @c to or @c from parameter is a negative value. @n
* - The specified @c to parameter exceeds the limit (0xFFFF). @n
- * - The range (@c to - @c from) exceeds the limit (900).
+ * - The range (@c to - @c from) exceeds the limit (0xFFFF).
* @exception E_OBJ_NOT_FOUND The channel range (@c from ~ @c to) is not found.
* @exception E_ILLEGAL_ACCESS The application does not have the permission to remove the CBS channel.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see AddCbsChannel()
- *
- * @endif
*/
result RemoveCbsChannel(int from, int to);
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets a CBS channel with specified range.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return A pointer to the CBS channel with specific range.
* @param[in] from The starting index of the message ID of the channel
* - The specified @c to parameter is smaller than @c from. @n
* - The specified @c to or @c from parameter is a negative value. @n
* - The specified @c to parameter exceeds the limit (0xFFFF). @n
- * - The range (@c to - @c from) exceeds the limit (900).
+ * - The range (@c to - @c from) exceeds the limit (0xFFFF).
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see AddCbsChannel()
* @see RemoveCbsChannel()
- *
- * @endif
*/
CbsChannel* GetCbsChannelN(int from, int to) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the CBS channel list.
*
* @since 2.0
*
- * @visibility partner-operator
- *
- * @privilege %http://tizen.org/privilege/cellbroadcast
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/cellbroadcast
*
* @return A pointer to the list of CBS channel
* @exception E_SUCCESS The method is successful.
* @see AddCbsChannel()
* @see RemoveCbsChannel()
* @see CbsChannel
- *
- * @endif
*/
Tizen::Base::Collection::IList* GetCbsChannelListN(void);
#ifndef _FMSG_SMS_MESSAGE_H_
#define _FMSG_SMS_MESSAGE_H_
-// Includes
-#include <FMsgISmsEventListener.h>
-#include <FMsgRecipientList.h>
+namespace Tizen { namespace Base
+{
+class String;
+class DateTime;
+} }
+
+#include <FBaseObject.h>
+#include <FMsgTypes.h>
namespace Tizen { namespace Messaging
{
-
// forward declaration for class extension
class _SmsMessageImpl;
+ class RecipientList;
/**
* @class SmsMessage
* Gets the sender address of the SMS message.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The sender address of the SMS message
* @exception E_SUCCESS The method is successful.
* Gets the received time of the SMS message.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The received time of the SMS message
* @exception E_SUCCESS The method is successful.
* Gets the unique ID of the SMS message.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The unique ID of the SMS message
* @exception E_SUCCESS The method is successful.
* Gets the sent time of the SMS message.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The sent time of the SMS message
* @exception E_SUCCESS The method is successful.
* Gets the type of the SMS message box.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The type of the SMS message box
* @exception E_SUCCESS The method is successful.
* Gets the list of the recipients.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return The list of the recipient
* @exception E_SUCCESS The method is successful.
* Checks whether the SMS message contains more than @c 160 bytes for the body text.
*
* @since 2.0
- *
- * @privilege %http://tizen.org/privilege/messaging.sms
+ *\r
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/messaging.sms
*
* @return @c true if this SMS message contains more than @c 160 bytes for the body text, @n
* else @c false
};
/**
- * @if VISPARTNER-OPERATOR
- *
* @enum EmailMessagePriority
*
* Defines the priority level for an email.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
enum EmailMessagePriority
{
{
PUSH_ACTION_SILENT = 0, /**< Store the message without alerting the user */
PUSH_ACTION_DISCARD, /**< Discard the message */
- PUSH_ACTION_ALERT /**< Store the message and alert the user */
+ PUSH_ACTION_ALERT, /**< Store the message and alert the user */
+ PUSH_ACTION_LAUNCH /**< Launch the application @b Since: @b 2.1 */
};
} } // Tizen::Messaging
// limitations under the License.
//
/**
-* @if VISPARTNER-OPERATOR
-*
* @file FMsgWapPushManager.h
* @brief This is the header file for the %WapPushManager class.
*
-* @visibility partner-operator
-*
* This header file contains the declarations of the %WapPushManager class.
-*
-* @endif
*/
#ifndef _FMSG_WAP_PUSH_MANAGER_H_
#define _FMSG_WAP_PUSH_MANAGER_H_
-#include <FBase.h>
+namespace Tizen { namespace Base
+{
+class String;
+} }
+
#include <FMsgIWapPushEventListener.h>
namespace Tizen { namespace Messaging
class _WapPushManagerImpl;
/**
-* @if VISPARTNER-OPERATOR
-*
* @class WapPushManager
* @brief This class provides methods to use the WAP Push messaging service.
*
* @since 2.0
*
* @final This class is not intended for extension.
-*
-* @visibility partner-operator
-*
-* @endif
*/
class _OSP_EXPORT_ WapPushManager
: public Tizen::Base::Object
{
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* This is the default constructor for this class.
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
WapPushManager(void);
/**
- * @if VISPARTNER-OPERATOR
- *
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
virtual ~WapPushManager(void);
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* Adds the event listener for receiving WAP Push messages for a specific WAP Push application ID.
*
* @since 2.0
*
- * @visibility partner-operator
- * @privilege %http://tizen.org/privilege/wappush
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wappush
*
* @return An error code
* @param[in] wapApplicationId The X-Wap-Application-Id indicating a WAP Push application ID
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see IWapPushEventListener
* @see RemoveWapPushEventListener()
- *
- * @endif
*/
result AddWapPushEventListener(const Tizen::Base::String& wapApplicationId, IWapPushEventListener& listener);
/**
- * @if VISPARTNER-OPERATOR
- *
* Removes the event listener for receiving WAP Push messages for a specific WAP Push application
* ID.
*
* @since 2.0
*
- * @visibility partner-operator
- * @privilege %http://tizen.org/privilege/wappush
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wappush
*
* @return An error code
* @param[in] wapApplicationId The X-Wap-Application-Id indicating a WAP Push
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see IWapPushEventListener
* @see AddWapPushEventListener()
- *
- * @endif
*/
result RemoveWapPushEventListener(const Tizen::Base::String& wapApplicationId, IWapPushEventListener& listener);
/**
- * @if VISPARTNER-OPERATOR
- *
* Registers a condition to receive WAP Push message.
*
* @since 2.0
*
- * @visibility partner-operator
- * @privilege %http://tizen.org/privilege/wappush
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wappush
*
* @return An error code
* @param[in] wapApplicationId The X-Wap-Application-Id indicating a WAP push application ID.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see UnregisterCondition()
- *
- * @endif
*/
result RegisterCondition(const Tizen::Base::String& wapApplicationId, const Tizen::Base::String& contentType);
/**
- * @if VISPARTNER-OPERATOR
- *
* Unregisters a condition to receive WAP push message.
*
* @since 2.0
*
- * @visibility partner-operator
- * @privilege %http://tizen.org/privilege/wappush
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/wappush
*
* @return An error code
* @param[in] wapApplicationId The X-Wap-Application-Id indicating a WAP push application ID.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* @see RegisterCondition()
- *
- * @endif
*/
result UnregisterCondition(const Tizen::Base::String& wapApplicationId, const Tizen::Base::String& contentType);
// limitations under the License.
//
/**
-* @if VISPARTNER-OPERATOR
-*
* @file FMsgWapPushMessage.h
* @brief This is the header file for the %WapPushMessage class.
*
-* @visibility partner-operator
-*
* This header file contains the declarations of the %WapPushMessage class.
-*
-* @endif
*/
#ifndef _FMSG_WAP_PUSH_MESSAGE_H_
#define _FMSG_WAP_PUSH_MESSAGE_H_
-#include <FBase.h>
+namespace Tizen { namespace Base
+{
+class String;
+class ByteBuffer;
+} }
+
+#include <FBaseObject.h>
namespace Tizen { namespace Messaging
{
class _WapPushMessageImpl;
/**
-* @if VISPARTNER-OPERATOR
-*
* @class WapPushMessage
* @brief This class provides methods for handling a WAP Push message.
*
*
* @final This class is not intended for extension.
*
-* @visibility partner-operator
-*
* The %WapPushMessage class provides methods for handling a WAP Push message. @n
* The methods of this class fetches the header and the body of a WAP Push message.
-*
-* @endif
*/
class _OSP_EXPORT_ WapPushMessage
: public Tizen::Base::Object
{
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* This destructor overrides Tizen::Base::Object::~Object().
*
* @since 2.0
- *
- * @visibility partner-operator
- *
- * @endif
*/
virtual ~WapPushMessage(void);
public:
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the header of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The header of a message
* @remarks The header has X-Wap-Application-Id and Content-Type fields.
- *
- * @endif
*/
Tizen::Base::String GetHeader(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the body of a message.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The body of a message
* @remarks The message body can be any MIME content-type. @n
* In case of error, this method returns null. @n
* The specific error code can be accessed using the GetLastResult() method.
- *
- * @endif
*/
Tizen::Base::ByteBuffer* GetBodyN(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Compares the calling instance with the specified instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return @c true if the specified instance of Object is equal to the calling %WapPushMessage instance, @n
* else @c false
* @param[in] obj An instance of Object to compare
* @see Object::Equals()
- *
- * @endif
*/
virtual bool Equals(const Tizen::Base::Object& obj) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the hash value of the current instance.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return The hash value of the current instance
- *
- * @endif
*/
virtual int GetHashCode(void) const;
/**
- * @if VISPARTNER-OPERATOR
- *
* Gets the copied instance of the class.
*
* @since 2.0
*
- * @visibility partner-operator
- *
* @return An instance of %WapPushMessage, @n
* else @c null in case of an error
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_MEMORY The memory is insufficient.
*
* @remarks The specific error code can be accessed using the GetLastResult() method.
- *
- * @endif
*/
WapPushMessage* CloneN(void) const;
Name: osp-messaging
Summary: osp messaging library
-Version: 1.2.0.0
+Version: 1.2.1.0
Release: 2
Group: System/Libraries
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(capi-messaging-messages)
-BuildRequires: pkgconfig(capi-messaging-email)
+BuildRequires: pkgconfig(msg-service)
BuildRequires: pkgconfig(push)
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(email-service)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(glib-2.0)
* @endif\r
*/\r
\r
-#include <messages.h>\r
#include <FMsgCbsChannel.h>\r
#include <FBaseSysLog.h>\r
#include <FSec_AccessController.h>\r
* This file contains the implementation of the %CbsMessage class.\r
*/\r
\r
-#include <messages.h>\r
#include <FMsgCbsMessage.h>\r
#include <FBaseSysLog.h>\r
#include <FSec_AccessController.h>\r
return (__pCbsMessageImpl->GetDataCodingScheme());\r
}\r
\r
+Tizen::Base::String\r
+CbsMessage::GetLanguageType(void) const\r
+{\r
+ SysAssertf(__pCbsMessageImpl != null, "The CbsChannel instance is not constructed yet.");\r
+\r
+ return (__pCbsMessageImpl->GetLanguageType());\r
+}\r
+\r
} } // Tizen::Messaging\r
#include "FMsg_DetailedEmailMessageImpl.h"
#include "FMsg_Types.h"
-
using namespace Tizen::Base;
using namespace Tizen::Messaging;
using namespace Tizen::Base::Collection;
* This file contains the implementation of the %EmailManager class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgEmailManager.h>
#include <FBaseSysLog.h>
#include <FSec_AccessController.h>
*/
#include <limits.h>
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgEmailMessage.h>
#include <FIoFile.h>
#include <FBaseSysLog.h>
* This file contains the implementation of the %EtwsPrimaryNotification class.\r
*/\r
\r
-#include <messages.h>\r
+#include <msg.h>\r
+#include <msg_transport.h>\r
+#include <msg_storage.h>\r
#include <FMsgEtwsPrimaryNotification.h>\r
#include <FBaseSysLog.h>\r
#include <FSec_AccessController.h>\r
* This file contains the implementation of the %MmsManager class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgMmsManager.h>
#include <FMsgMmsMessage.h>
#include <FBaseSysLog.h>
*/
#include <limits.h>
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgMmsMessage.h>
#include <FBaseInternalTypes.h>
#include <FApp_AppInfo.h>
* This file contains the implementation of the %SmsManager class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgSmsManager.h>
#include <FMsgSmsMessage.h>
#include <FBaseSysLog.h>
namespace Tizen { namespace Messaging
{
-
SmsMessage::SmsMessage(void)
{
__pImpl = new (std::nothrow) _SmsMessageImpl();
* This file contains the implementation of the %WapPushManger class.
*/
-#include <messages.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
#include <FMsgWapPushManager.h>
#include <FBaseSysLog.h>
#include <FSec_AccessController.h>
* This file contains the implementation of the %WapPushMessage class.
*/
-#include <messages.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
#include <FMsgWapPushMessage.h>
#include <FBaseSysLog.h>
#include <FSec_AccessController.h>
* @endif\r
*/\r
\r
-#include <messages.h>\r
+#include <msg.h>\r
+#include <msg_transport.h>\r
+#include <msg_storage.h>\r
#include <FMsgCbsChannel.h>\r
#include <FBaseSysLog.h>\r
#include <FBaseUtilStringUtil.h>\r
#include <FSec_AccessController.h>\r
#include "FMsg_Types.h"\r
#include "FMsg_CbsChannelImpl.h"\r
+#include "FMsg_SmsMmsCallbackHandler.h"\r
\r
using namespace Tizen::Base;\r
using namespace Tizen::Messaging;\r
, __toId(-1)\r
, __channelName(L"")\r
, __isChannelEnable(false)\r
- , __cbsChannelHandle(0)\r
{\r
}\r
\r
__toId = value.__toId;\r
__channelName = value.__channelName;\r
__isChannelEnable = value.__isChannelEnable;\r
- __cbsChannelHandle = value.__cbsChannelHandle;\r
}\r
\r
_CbsChannelImpl::~_CbsChannelImpl(void)\r
__toId = rhs.__toId;\r
__channelName = rhs.__channelName;\r
__isChannelEnable = rhs.__isChannelEnable;\r
- __cbsChannelHandle = rhs.__cbsChannelHandle;\r
}\r
\r
return (*this);\r
__toId = to;\r
__channelName = name;\r
__isChannelEnable = false;\r
- __cbsChannelHandle = 0;\r
\r
return E_SUCCESS;\r
}\r
return cbsChannel.__pCbsChannelImpl;\r
}\r
\r
-void\r
-_CbsChannelImpl::SetCbsChannelHandle(messages_cb_channel_h cbsChannelHandle)\r
-{\r
- __cbsChannelHandle = cbsChannelHandle;\r
-}\r
-\r
result\r
_CbsChannelImpl::UpdateName(const Tizen::Base::String& name)\r
{\r
result r = E_SUCCESS;\r
- int err = MESSAGES_ERROR_NONE;\r
- char* pChannelName = null;\r
- __channelName = name;\r
-\r
ClearLastResult();\r
\r
- pChannelName = _StringConverter::CopyToCharArrayN(name);\r
- SysTryReturn(NID_MSG, pChannelName != null, E_OUT_OF_MEMORY, r = E_OUT_OF_MEMORY, "memory allocation failed");\r
-\r
- err = messages_cb_channel_set_name(__cbsChannelHandle, pChannelName);\r
- r = ConvertException(err);\r
+ // save the setting\r
+ r = _SmsMmsCallbackHandler::GetInstance()->UpdateCbsChannel(__fromId, __toId, name, __isChannelEnable);\r
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to save the setting.");\r
\r
- if (pChannelName)\r
- {\r
- delete[] pChannelName;\r
- pChannelName =null;\r
- }\r
+ __channelName = name;\r
\r
return r;\r
}\r
{\r
result r = E_SUCCESS;\r
ClearLastResult();\r
- int err = MESSAGES_ERROR_NONE;\r
\r
- err = messages_cb_channel_set_activated(__cbsChannelHandle, false);\r
- __isChannelEnable = false;\r
+ // save the setting\r
+ r = _SmsMmsCallbackHandler::GetInstance()->UpdateCbsChannel(__fromId, __toId, __channelName, false);\r
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to save the setting.");\r
\r
- r = ConvertException(err);\r
+ __isChannelEnable = false;\r
\r
return r;\r
}\r
{\r
result r = E_SUCCESS;\r
ClearLastResult();\r
- int err = MESSAGES_ERROR_NONE;\r
\r
- err = messages_cb_channel_set_activated(__cbsChannelHandle, true);\r
- __isChannelEnable = true;\r
+ // save the setting\r
+ r = _SmsMmsCallbackHandler::GetInstance()->UpdateCbsChannel(__fromId, __toId, __channelName, true);\r
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to save the setting.");\r
\r
- r = ConvertException(err);\r
+ __isChannelEnable = true;\r
\r
return r;\r
}\r
bool\r
_CbsChannelImpl::IsActivated(void) const\r
{\r
- result r = E_SUCCESS;\r
- ClearLastResult();\r
- int err = MESSAGES_ERROR_NONE;\r
- bool isActivated = false;\r
-\r
- err = messages_cb_channel_is_activated(__cbsChannelHandle, &isActivated);\r
-\r
- r = ConvertException(err);\r
- SetLastResult(r);\r
-\r
- if (isActivated)\r
- {\r
- return isActivated;\r
- }\r
- else\r
- {\r
- return false;\r
- }\r
+ return __isChannelEnable;\r
}\r
\r
Tizen::Base::String\r
_CbsChannelImpl::GetName(void) const\r
{\r
- return __channelName;\r
+ return __channelName;\r
}\r
\r
result\r
return r;\r
}\r
\r
-result\r
-_CbsChannelImpl::ConvertException(int err) const\r
+void \r
+_CbsChannelImpl::SetCbsChannelName(Tizen::Base::String channelName)\r
{\r
- result r = E_SUCCESS;\r
-\r
- switch (err)\r
- {\r
- case MESSAGES_ERROR_NONE:\r
- r = E_SUCCESS;\r
- break;\r
-\r
- case MESSAGES_ERROR_INVALID_PARAMETER:\r
- r = E_INVALID_ARG;\r
- break;\r
-\r
- case MESSAGES_ERROR_OUT_OF_MEMORY:\r
- r = E_OUT_OF_MEMORY;\r
- break;\r
-\r
- case MESSAGES_ERROR_SERVER_NOT_READY: // Communication error between client and server\r
- case MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED:\r
- r = E_NETWORK_UNAVAILABLE;\r
- break;\r
-\r
- case MESSAGES_ERROR_NO_SIM_CARD:\r
- r = E_DEVICE_UNAVAILABLE;\r
- break;\r
-\r
- case MESSAGES_ERROR_OUT_OF_RANGE:\r
- r = E_ALREADY_SET;\r
- break;\r
-\r
- case MESSAGES_ERROR_SENDING_FAILED:\r
- case MESSAGES_ERROR_OPERATION_FAILED:\r
- r = E_FAILURE;\r
- break;\r
-\r
- default:\r
- r = E_SYSTEM;\r
- break;\r
- }\r
+ __channelName = channelName;\r
+}\r
\r
- return r;\r
+void \r
+_CbsChannelImpl::SetCbsChannelState(bool isChannelEnable)\r
+{\r
+ __isChannelEnable = isChannelEnable;\r
}\r
\r
} } // Tizen::Messaging\r
*/\r
result UpdateName(const Tizen::Base::String& name);\r
\r
+ /**\r
+ * Sets the cbs channel name to CbsChannelImpl object.\r
+ *\r
+ * @since 2.1\r
+ * @param[in] channelName An Cbs Channel Name\r
+ */\r
+ void SetCbsChannelName(Tizen::Base::String channelName);\r
+\r
+ /**\r
+ * Sets the cbs Channel State to CbsChannelImpl object.\r
+ *\r
+ * @since 2.1\r
+ * @param[in] isChannelEnable CBS on/off flag\r
+ */\r
+ void SetCbsChannelState(bool isChannelEnable);\r
+\r
public:\r
/**\r
* Gets the instance of CbsChannel\r
*/\r
static CbsChannel* GetCbsChannelN(int from, int to, const Tizen::Base::String& name);\r
\r
- /**\r
- * Gets the Impl instance.\r
- *\r
- * @since 2.1\r
- * @return The pointer to _CbsChannelImpl\r
- * @param[in] CbsChannel An instance of CbsChannel\r
- */\r
+ /**\r
+ * Gets the Impl instance.\r
+ *\r
+ * @since 2.1\r
+ * @return The pointer to _CbsChannelImpl\r
+ * @param[in] CbsChannel An instance of CbsChannel\r
+ */\r
static _CbsChannelImpl* GetInstance(CbsChannel& cbsChannel);\r
\r
- /**\r
- * Sets the cbs handle to CbsChannelImpl object.\r
- *\r
- * @since 2.1\r
- * @param[in] cbsChannelHandle An Cbs Channel Handle\r
- */\r
- void SetCbsChannelHandle(messages_cb_channel_h cbsChannelHandle);\r
-\r
- result ConvertException(int err) const;\r
-\r
public:\r
/**\r
* This default constructor is intentionally declared as private so that only the platform can create an instance.\r
* @exception E_INVALID_ARG The specified @c to parameter is smaller than @c from. @n\r
* The specified @c to or @c from parameter is a negative value. @n\r
* The specified @c to parameter exceeds the limit (0xFFFF). @n\r
- * The range (@c to - @c from) exceeds the limit (900).\r
+ * The range (@c to - @c from) exceeds the limit (0xFFFF).\r
* The specified @c name string length is greater than @c 32. @n\r
* @exception E_OUT_OF_MEMORY The memory is insufficient.\r
* @exception E_SYSTEM A system error has occurred.\r
int __toId;\r
Tizen::Base::String __channelName;\r
bool __isChannelEnable;\r
- messages_cb_channel_h __cbsChannelHandle;\r
}; // _CbsChannelImpl\r
\r
} } // Tizen::Messaging\r
* This file contains the implementation of the %_CbsMessageImpl class.\r
*/\r
\r
-#include <messages.h>\r
#include <FMsgCbsMessage.h>\r
#include <FBaseSysLog.h>\r
-#include <FSec_AccessController.h>\r
+#include <FBaseDateTime.h>\r
#include "FMsg_Types.h"\r
#include "FMsg_CbsMessageImpl.h"\r
\r
using namespace Tizen::Base;\r
using namespace Tizen::Messaging;\r
-using namespace Tizen::Security;\r
\r
namespace Tizen { namespace Messaging\r
{\r
: __cbsMsgTime()\r
, __pCbsSerialNumber(null)\r
, __cbsSenderMsg(L"")\r
+ , __cbslanguageType(L"")\r
, __cbsMessageId(0)\r
, __isEtwsNotification(false)\r
, __dataCodingScheme()\r
__cbsSenderMsg = value.__cbsSenderMsg;\r
__isEtwsNotification = value.__isEtwsNotification;\r
__dataCodingScheme = value.__dataCodingScheme;\r
+ __cbslanguageType = value.__cbslanguageType;\r
\r
__pCbsSerialNumber->SetArray(value.__pCbsSerialNumber->GetPointer(), 0, value.__pCbsSerialNumber->GetLimit());\r
__pCbsSerialNumber->SetPosition(0);\r
}\r
\r
result\r
-_CbsMessageImpl::SetCbsMessageImpl(const Tizen::Base::DateTime& dateTime, const Tizen::Base::ByteBuffer& cbsSerialNumber, const Tizen::Base::String& text, int cbsMessageId, bool isEtwsNotification, byte dataCodingScheme)\r
+_CbsMessageImpl::SetCbsMessageImpl(const Tizen::Base::DateTime& dateTime, const Tizen::Base::ByteBuffer& cbsSerialNumber, const Tizen::Base::String& text, int cbsMessageId, bool isEtwsNotification, byte dataCodingScheme, const Tizen::Base::String& languageType)\r
{\r
result r = E_SUCCESS;\r
\r
__cbsSenderMsg = text;\r
__isEtwsNotification = isEtwsNotification;\r
__dataCodingScheme = dataCodingScheme;\r
+ __cbslanguageType = languageType;\r
\r
__pCbsSerialNumber = new (std::nothrow) ByteBuffer();\r
SysTryReturn(NID_MSG, __pCbsSerialNumber != null, E_OUT_OF_MEMORY, r = E_OUT_OF_MEMORY, "memory allocation failed");\r
__cbsSenderMsg = rhs.__cbsSenderMsg;\r
__isEtwsNotification = rhs.__isEtwsNotification;\r
__dataCodingScheme = rhs.__dataCodingScheme;\r
+ __cbslanguageType = rhs.__cbslanguageType;\r
\r
__pCbsSerialNumber->SetArray(rhs.__pCbsSerialNumber->GetPointer(), 0, rhs.__pCbsSerialNumber->GetLimit());\r
__pCbsSerialNumber->SetPosition(0);\r
pCbsMsg = _CbsMessageImpl::GetCbsMessageN();\r
SysTryCatch(NID_MSG, pCbsMsg != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");\r
\r
- r = _CbsMessageImpl::GetInstance(*pCbsMsg)->SetCbsMessageImpl(__cbsMsgTime, *(__pCbsSerialNumber), __cbsSenderMsg, __cbsMessageId, __isEtwsNotification, __dataCodingScheme);\r
+ r = _CbsMessageImpl::GetInstance(*pCbsMsg)->SetCbsMessageImpl(__cbsMsgTime, *(__pCbsSerialNumber), __cbsSenderMsg, __cbsMessageId, __isEtwsNotification, __dataCodingScheme, __cbslanguageType);\r
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "cbsimpl message construct failed");\r
\r
SetLastResult(GetLastResult());\r
return false;\r
}\r
\r
+ // language type\r
+ if (__cbslanguageType != pCbsMessageImpl->__cbslanguageType)\r
+ {\r
+ return false;\r
+ }\r
+\r
return true;\r
}\r
\r
return __dataCodingScheme;\r
}\r
\r
+Tizen::Base::String\r
+_CbsMessageImpl::GetLanguageType(void) const\r
+{\r
+ return __cbslanguageType;\r
+}\r
+\r
} } // Tizen::Messaging\r
#ifndef _FMSG_INTERNAL_CBS_MESSAGE_IMPL_H_\r
#define _FMSG_INTERNAL_CBS_MESSAGE_IMPL_H_\r
\r
+namespace Tizen { namespace Base\r
+{\r
+class ByteBuffer;\r
+class String;\r
+class DateTime;\r
+} }\r
+\r
+#include <FBaseDateTime.h>\r
+\r
namespace Tizen { namespace Messaging\r
{\r
\r
* @endif\r
*/\r
byte GetDataCodingScheme(void) const;\r
+ \r
+ /**\r
+\r
+ * @if VISPARTNER-OPERATOR\r
+ *\r
+ * Gets the language type of a message.\r
+ *\r
+\r
+ * @since 2.1\r
+ *\r
+ * @visibility partner-operator\r
+ *\r
+ * @return The language type of a message \r
+ *\r
+ * @endif\r
+ */\r
+ Tizen::Base::String GetLanguageType(void) const;\r
\r
public:\r
/**\r
* @exception E_OUT_OF_MEMORY The memory is insufficient.\r
* @exception E_SYSTEM A system error has occurred.\r
*/\r
- result SetCbsMessageImpl(const Tizen::Base::DateTime& dateTime, const Tizen::Base::ByteBuffer& cbsSerialNumber, const Tizen::Base::String& text, int cbsMessageId, bool isEtwsNotification, byte dataCodingScheme);\r
+ result SetCbsMessageImpl(const Tizen::Base::DateTime& dateTime, const Tizen::Base::ByteBuffer& cbsSerialNumber, const Tizen::Base::String& text, int cbsMessageId, bool isEtwsNotification, byte dataCodingScheme, const Tizen::Base::String& languageType);\r
\r
private:\r
Tizen::Base::DateTime __cbsMsgTime;\r
Tizen::Base::ByteBuffer* __pCbsSerialNumber;\r
Tizen::Base::String __cbsSenderMsg;\r
+ Tizen::Base::String __cbslanguageType;\r
int __cbsMessageId;\r
bool __isEtwsNotification;\r
byte __dataCodingScheme;\r
* This file contains the implementation of the %_EmailManagerImpl class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgEmailMessage.h>
#include <FMsgEmailManager.h>
#include <FMsgRecipientList.h>
namespace Tizen { namespace Messaging
{
+ ArrayListT<_EmailAsyncData*>* _EmailManagerImpl::__pEmailAsyncData = null;
+ Tizen::Base::Runtime::Mutex * _EmailManagerImpl::__pMutex = null;
+
_EmailManagerImpl::_EmailManagerImpl(void)
: __pEmailEvent(null)
, __isConstructed(false)
}
void
-_EmailManagerImpl::SentEmailStatusCallback(email_h emailHandle, email_sending_e status, void* pData)
+_EmailManagerImpl::SentEmailStatusCallback(int msgId, email_noti_on_network_event status, int errorCode )
{
result r = E_SUCCESS;
switch (status)
{
- case EMAIL_SENDING_FAILED:
+ case NOTI_SEND_FAIL:
{
r = E_FAILURE;
- _EmailEvent* pEmailEvent = static_cast <_EmailEvent*>(pData);
- _EmailEventArg* pEmailEventArg = null;
+ _EmailEvent* pEmailEvent = null;
+ _EmailAsyncData *pEmailAsyncData = null;
- if (pEmailEvent)
+ for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount() ; i++)
{
- pEmailEventArg = new (std::nothrow) _EmailEventArg(r);
- if (pEmailEventArg)
+ _EmailManagerImpl::__pMutex->Acquire();
+ _EmailManagerImpl::__pEmailAsyncData->GetAt(i, pEmailAsyncData);
+ if ( null == pEmailAsyncData)
+ {
+ _EmailManagerImpl::__pMutex->Release();
+ break;
+
+ }
+ if ( msgId == pEmailAsyncData->msgId )
{
- pEmailEvent->Fire(*pEmailEventArg);
+ _EmailManagerImpl::__pEmailAsyncData->RemoveAt(i);
+ }
+ _EmailManagerImpl::__pMutex->Release();
+
+
+ if (msgId == pEmailAsyncData->msgId);
+ {
+ _EmailEventArg* pEmailEventArg = null;
+ pEmailEvent = pEmailAsyncData->pEventData;
+
+ if (pEmailEvent)
+ {
+ pEmailEventArg = new (std::nothrow) _EmailEventArg(r);
+ if (pEmailEventArg)
+ {
+ pEmailEvent->Fire(*pEmailEventArg);
+ }
+ }
+ if (pEmailAsyncData)
+ {
+ delete []pEmailAsyncData;
+ pEmailAsyncData = null;
+
+ }
+
+ break;
}
}
+
+
}
break;
- case EMAIL_SENDING_SUCCEEDED:
+ case NOTI_SEND_FINISH:
{
r = E_SUCCESS;
- _EmailEvent* pEmailEvent = static_cast <_EmailEvent*>(pData);
- _EmailEventArg* pEmailEventArg = null;
+ _EmailEvent* pEmailEvent = null;
+ _EmailAsyncData *pEmailAsyncData = null;
- if (pEmailEvent)
+ for( int i=0; i < _EmailManagerImpl::__pEmailAsyncData->GetCount() ; i++)
{
- pEmailEventArg = new (std::nothrow) _EmailEventArg(r);
- if (pEmailEventArg)
+ _EmailManagerImpl::__pMutex->Acquire();
+ _EmailManagerImpl::__pEmailAsyncData->GetAt(i, pEmailAsyncData);
+ if ( null == pEmailAsyncData)
{
- pEmailEvent->Fire(*pEmailEventArg);
+ _EmailManagerImpl::__pMutex->Release();
+ break;
+
+ }
+ if ( msgId == pEmailAsyncData->msgId )
+ {
+ _EmailManagerImpl::__pEmailAsyncData->RemoveAt(i);
+ }
+ _EmailManagerImpl::__pMutex->Release();
+
+
+ if (msgId == pEmailAsyncData->msgId);
+ {
+ _EmailEventArg* pEmailEventArg = null;
+ pEmailEvent = pEmailAsyncData->pEventData;
+
+ if (pEmailEvent)
+ {
+ pEmailEventArg = new (std::nothrow) _EmailEventArg(r);
+ if (pEmailEventArg)
+ {
+ pEmailEvent->Fire(*pEmailEventArg);
+ }
+ }
+
+ if (pEmailAsyncData)
+ {
+ delete []pEmailAsyncData;
+ pEmailAsyncData = null;
+
+ }
+
+ break;
}
}
+
+
}
break;
}
}
+
result
_EmailManagerImpl::Send(const EmailMessage& message, const RecipientList& recipientList, bool saveToSentBox)
{
result r = E_SUCCESS;
- int err = EMAIL_ERROR_NONE;
- email_h emailMsg = {0};
+ int msgId = -1;
+ int requestId = 0;
+ _EmailAsyncData *pTemp=null;
-
- SysAssertf(__isConstructed == true, "_EmailManagerImpl instance is not constructed yet.");
+ SysAssertf(__isConstructed == true, "The _EmailManagerImpl instance is not constructed yet.");
SysLog(NID_MSG, "sending an email message.");
- err = email_create_message(&emailMsg);
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to create msg.", GetErrorMessage(r));
-
- err = _MsgUtil::GetEmailMessage(message, recipientList, emailMsg);
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to get email.", GetErrorMessage(r));
-
- err = email_save_message(emailMsg);
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to save msg.", GetErrorMessage(r));
+ r = _MsgUtil::SendEmail(message, recipientList, msgId, requestId);
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to send the email message.", GetErrorMessage(r));
+
+ pTemp = new (std::nothrow) _EmailAsyncData();
+ SysTryCatch(NID_MSG, pTemp != null, r = E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+
+ pTemp->requestId = requestId;
+ pTemp->msgId = msgId;
+ pTemp->pEventData = __pEmailEvent.get();
+
+ if(null ==__pEmailAsyncData)
+
+ {
+ __pEmailAsyncData = new (std::nothrow) ArrayListT<_EmailAsyncData*> ;
+ SysTryCatch(NID_MSG, __pEmailAsyncData != null, r = E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+ __pEmailAsyncData->Construct();
+
+ }
- err = email_set_message_sent_cb(emailMsg, &_EmailManagerImpl::SentEmailStatusCallback, (void*) (__pEmailEvent.get()));
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to set cb.", GetErrorMessage(r));
+ __pEmailAsyncData->Add(pTemp);
- err = email_send_message(emailMsg, saveToSentBox);
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to send the email message.", GetErrorMessage(r));
- email_destroy_message(emailMsg);
+ if ( null == __pMutex)
+ {
+ __pMutex = new (std::nothrow) Tizen::Base::Runtime::Mutex();
+ SysTryCatch(NID_MSG, __pMutex != null, r = E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] Failed to allocate memory.");
+ __pMutex->Create();
+
+ }
- SysLog(NID_MSG, "sending an email message success");
return r;
CATCH:
+
+ if (pTemp)
+ {
+ if (__pEmailAsyncData->Contains(pTemp))
+ {
+ __pEmailAsyncData->Remove(pTemp);
+
+ }
+ delete pTemp;
+ pTemp = null;
+
+ }
- email_destroy_message(emailMsg);
return r;
}
+
_EmailManagerImpl*
_EmailManagerImpl::GetInstance(EmailManager& emailManager)
{
return emailManager.__pImpl;
}
-result
-_EmailManagerImpl::ConvertException(int err) const
-{
- result r = E_SUCCESS;
-
- switch (err)
- {
- case EMAIL_ERROR_NONE:
- r = E_SUCCESS;
- break;
-
- case EMAIL_ERROR_OPERATION_FAILED:
- r = E_INVALID_CONDITION;
- break;
-
- //case EMF_ERROR_INVALID_ADDRESS:
- // r = E_INVALID_ADDRESS;
- // break;
-
- case EMAIL_ERROR_INVALID_PARAMETER:
- r = E_INVALID_ARG;
- break;
-
- case EMAIL_ERROR_ACCOUNT_NOT_FOUND:
- r = E_INVALID_ACCOUNT;
- break;
-
- case EMAIL_ERROR_SERVER_NOT_READY:
- r = E_NETWORK_UNAVAILABLE;
- break;
-
- case EMAIL_ERROR_COMMUNICATION_WITH_SERVER_FAILED:
- r = E_ON_INITIALIZING;
- break;
-
- case EMAIL_ERROR_DB_FAILED:
- case EMAIL_ERROR_OUT_OF_MEMORY:
- r = E_STORAGE_FULL;
- break;
-
- default:
- r = E_SYSTEM;
- break;
- }
-
- return r;
-}
-
} } // Tizen::Messaging
class RecipientList;
class _EmailEvent;
+
+class _EmailAsyncData
+{
+public:
+ int requestId;
+ int msgId;
+ _EmailEvent *pEventData;
+
+};
+
+
/**
* @class _EmailManagerImpl
* @brief This class provides methods to use the email messaging service.
*/
static const _EmailManagerImpl* GetInstance(const EmailManager& emailManager);
- //utility
-private:
+
+
/**
* Call back for sent message
*
- * @param[in] hMsgHandle The message handle.
- * @param[in] pMsgStatus The sent message status.
- * @param[in] pUserParam The callback object..
+ * @param[in] msgId The msg Id
+ * @param[in] status The sent message status.
+ * @param[in] errorCode The error code.
*
*/
- static void SentEmailStatusCallback(email_h emailHandle, email_sending_e status, void* pData);
+ static void SentEmailStatusCallback(int msgId, email_noti_on_network_event status, int errorCode );
- /**
- * Converts platform error codes to BADA fwk error codes
- *
- * @return An error code
- * @param[in] err The error to convert
- *
- */
- result ConvertException(int err) const;
private:
std::unique_ptr<_EmailEvent> __pEmailEvent;
bool __isConstructed;
+ static Tizen::Base::Collection::ArrayListT<_EmailAsyncData*>*__pEmailAsyncData;
+ static Tizen::Base::Runtime::Mutex *__pMutex;
+
}; // _EmailManagerImpl
} } // Tizen::Messaging
*/
#include <limits.h>
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FIoFile.h>
#include <FBaseSysLog.h>
#include <FMsgEmailMessage.h>
* This file contains the implementation of the %_EtwsPrimaryNotificationImpl class.\r
*/\r
\r
-#include <messages.h>\r
+#include <msg.h>\r
+#include <msg_transport.h>\r
+#include <msg_storage.h>\r
#include <FMsgEtwsPrimaryNotification.h>\r
#include <FBaseSysLog.h>\r
#include <FSec_AccessController.h>\r
#ifndef _FMSG_INTERNAL_ETWS_PRIMARY_NOTIFICATION_IMPL_H_\r
#define _FMSG_INTERNAL_ETWS_PRIMARY_NOTIFICATION_IMPL_H_\r
\r
+#include <FBaseDateTime.h>\r
+#include <FBaseByteBuffer.h>\r
+\r
namespace Tizen { namespace Messaging\r
{\r
\r
* This file contains the implementation of the %_MmsManagerImpl class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FIoDirectory.h>
#include <FIoFile.h>
#include <FMsgIMmsListener.h>
_MmsManagerImpl::~_MmsManagerImpl(void)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
if (_SmsMmsCallbackHandler::GetInstance())
{
err = _SmsMmsCallbackHandler::GetInstance()->CloseMessageHandle();
}
- if (err != MESSAGES_ERROR_NONE)
+ if (err != MSG_SUCCESS)
{
r = ConvertException(err);
SysLogException(NID_MSG, r, "[%s] Failed to close message handle.", GetErrorMessage(r));
_MmsManagerImpl::Construct(IMmsListener& listener)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
SysAssertf(__isConstructed == false, "_MmsManagerImpl instance is already constructed.");
result
_MmsManagerImpl::Send(const MmsMessage& message, const RecipientList& recipientList, bool saveToSentBox)
{
+ SysAssertf(__isConstructed == true, "_MmsManagerImpl instance is not constructed yet.");
+
result r = E_SUCCESS;
- messages_message_h mmsMsg = {0};
- int err = MESSAGES_ERROR_NONE;
- bool saveMsgToSentbox = saveToSentBox;
+ int err = MSG_SUCCESS;
+ int msgReqId = -1;
+ msg_struct_t msgOption = NULL;
- SysAssertf(__isConstructed == true, "_MmsManagerImpl instance is not constructed yet.");
SysLog(NID_MSG, "sending an mms message");
- //pack mms message
- err = _MsgUtil::GetMmsMessage(message, recipientList, mmsMsg);
+ msg_struct_t msgReq = msg_create_struct(MSG_STRUCT_REQUEST_INFO);
+ msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+ msg_struct_t msgSendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_SETTING_BOOL, true);
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_DELIVER_REQ_BOOL, false);
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_KEEPCOPY_BOOL, saveToSentBox);
+
+ msg_get_struct_handle(msgSendOpt, MSG_SEND_OPT_MMS_OPT_HND, &msgOption);
+ msg_set_bool_value(msgOption, MSG_MMS_SENDOPTION_READ_REQUEST_BOOL, false);
+ msg_set_int_value(msgOption, MSG_MMS_SENDOPTION_PRIORITY_INT, MSG_MESSAGE_PRIORITY_NORMAL);
+ msg_set_int_value(msgOption, MSG_MMS_SENDOPTION_EXPIRY_TIME_INT, MSG_EXPIRY_TIME_MAXIMUM);
+ msg_set_int_value(msgOption, MSG_MMS_SENDOPTION_DELIVERY_TIME_INT, MSG_DELIVERY_TIME_IMMEDIATLY);
+
+ err = _MsgUtil::GetMmsMessage(msgInfo, message, recipientList);
+
+ r = ConvertException(err);
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to generate the MMS message.", GetErrorMessage(r));
+
+ msg_set_struct_handle(msgReq, MSG_REQUEST_MESSAGE_HND, msgInfo);
+ msg_set_struct_handle(msgReq, MSG_REQUEST_SENDOPT_HND, msgSendOpt);
- if (err == MESSAGES_ERROR_NONE)
+ if (err == MSG_SUCCESS)
{
- err = messages_send_message(__msgHandle, mmsMsg, saveMsgToSentbox, &_SmsMmsCallbackHandler::SentMmsMessageStatusCallback,
- (void*) (__pMmsEvent.get()));
+ err = msg_mms_send_message(__msgHandle, msgReq);
}
r = ConvertException(err);
+
+ if (r == E_SUCCESS)
+ {
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ msg_get_int_value(msgReq, MSG_REQUEST_REQUESTID_INT, &msgReqId);
+ r = _SmsMmsCallbackHandler::GetInstance()->AddToMessageMap(msgReqId, _MSG_MMS, __pMmsEvent.get());
+ }
+ else
+ {
+ r = E_SYSTEM;
+ }
+ }
+
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to send the MMS message.", GetErrorMessage(r));
//release message
- messages_destroy_message(mmsMsg);
-
+ msg_release_struct(&msgReq);
SysLog(NID_MSG, "sending an mms message success");
return r;
CATCH:
- messages_destroy_message(mmsMsg);
+ //release message
+ msg_release_struct(&msgReq);
return r;
}
switch (err)
{
- case MESSAGES_ERROR_NONE:
+ case MSG_SUCCESS:
r = E_SUCCESS;
break;
- case MESSAGES_ERROR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_MESSAGE:
+ case MSG_ERR_NULL_POINTER:
+ case MSG_ERR_NULL_MESSAGE:
r = E_INVALID_ARG;
break;
- case MESSAGES_ERROR_OUT_OF_MEMORY:
+ case MSG_ERR_MEMORY_ERROR:
r = E_OUT_OF_MEMORY;
break;
- case MESSAGES_ERROR_SERVER_NOT_READY:
- case MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED:
+ case MSG_ERR_SERVER_NOT_READY:
+ case MSG_ERR_TRANSPORT_ERROR:
+ case MSG_ERR_COMMUNICATION_ERROR:
r = E_NETWORK_UNAVAILABLE;
break;
- case MESSAGES_ERROR_NO_SIM_CARD:
+ case MSG_ERR_NO_SIM:
r = E_DEVICE_UNAVAILABLE;
break;
- case MESSAGES_ERROR_OUT_OF_RANGE:
- r = E_ALREADY_SET;
- break;
-
- case MESSAGES_ERROR_SENDING_FAILED:
- case MESSAGES_ERROR_OPERATION_FAILED:
+ case MSG_ERR_PLUGIN_TAPI_FAILED:
r = E_FAILURE;
break;
//utility
private:
/**
- * Converts platform error codes to BADA fwk error codes
+ * Converts platform error codes
*
* @return An error code
* @param[in] err The error to convert
private:
std::unique_ptr<_MmsEvent> __pMmsEvent;
bool __isConstructed;
- messages_service_h __msgHandle;
+ msg_handle_t __msgHandle;
}; // _MmsManagerImpl
} }
*/
#include <limits.h>
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FIoFile.h>
#include <FMsgTypes.h>
#include <FMsgMmsMessage.h>
*/
// includes
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <email-api.h>
#include <FBaseUtilStringUtil.h>
#include <FIoFile.h>
#include <FMsgMmsMessage.h>
#include <FBaseSysLog.h>
#include <FBase_StringConverter.h>
#include "FMsg_SmsMessageImpl.h"
+#include "FMsg_EmailManagerImpl.h"
#include "FMsg_MsgUtil.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Utility;
using namespace Tizen::Io;
+static const char* BODY_TEXT_FILE_NAME = "/tmp/mmsbodytext.txt";
+
namespace Tizen { namespace Messaging
{
{
pItem = dynamic_cast< String* >(pToList->GetAt(index));
SysTryCatch(NID_MSG, pItem != null, r = E_INVALID_ADDRESS, r, "To List Null");
- r = CheckAddressValidity(*pItem, type);
+ r = CheckAddressValidity(*pItem, type);
if (type == _MSG_MMS && r != E_SUCCESS) //Check If MMS might have email address
{
}
SmsMessageBoxType
-_MsgUtil::GetSmsMessageBoxType(messages_message_box_e folderId)
+_MsgUtil::GetSmsMessageBoxType(_MSG_FOLDER_ID_E folderId)
{
SmsMessageBoxType type = SMS_MESSAGE_BOX_TYPE_NONE;
switch (folderId)
{
- case MESSAGES_MBOX_INBOX:
+ case MSG_INBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_INBOX;
break;
- case MESSAGES_MBOX_OUTBOX:
+ case MSG_OUTBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_OUTBOX;
break;
- case MESSAGES_MBOX_SENTBOX:
+ case MSG_SENTBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_SENTBOX;
break;
-// case MESSAGES_MBOX_ALL:
+// case MSG_ALLBOX_ID:
// type = SMS_MESSAGE_BOX_TYPE_ALL;
// break;
return type;
}
-messages_message_box_e
+_MSG_FOLDER_ID_E
_MsgUtil::GetMsgFolderId(const SmsMessageBoxType& type)
{
- messages_message_box_e folderId;
+ _MSG_FOLDER_ID_E folderId;
switch (type)
{
case SMS_MESSAGE_BOX_TYPE_INBOX:
- folderId = MESSAGES_MBOX_INBOX;
+ folderId = MSG_INBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_OUTBOX:
- folderId = MESSAGES_MBOX_OUTBOX;
+ folderId = MSG_OUTBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_SENTBOX:
- folderId = MESSAGES_MBOX_SENTBOX;
+ folderId = MSG_SENTBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_ALL:
- folderId = MESSAGES_MBOX_ALL;
+ folderId = MSG_ALLBOX_ID;
break;
default:
- folderId = (messages_message_box_e) -1;
+ folderId = MSG_MAX_FOLDER_ID;
break;
}
}
SmsMessageBoxType
-_MsgUtil::GetMsgBoxType(const messages_message_box_e& folderId)
+_MsgUtil::GetMsgBoxType(const _MSG_FOLDER_ID_E& folderId)
{
SmsMessageBoxType type;
switch (folderId)
{
- case MESSAGES_MBOX_INBOX:
+ case MSG_INBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_INBOX;
break;
- case MESSAGES_MBOX_OUTBOX:
+ case MSG_OUTBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_OUTBOX;
break;
- case MESSAGES_MBOX_SENTBOX:
+ case MSG_SENTBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_SENTBOX;
break;
- case MESSAGES_MBOX_ALL:
+ case MSG_ALLBOX_ID:
type = SMS_MESSAGE_BOX_TYPE_ALL;
break;
}
int
-_MsgUtil::GetSmsMessage(const SmsMessage& message, const RecipientList& recipientList, messages_message_h& smsMsg)
+_MsgUtil::GetSmsMessage(msg_struct_t& msgInfo, const SmsMessage& message, const RecipientList& recipientList)
{
- int err = MESSAGES_ERROR_NONE;
- const char* pMsgBody = null;
+ int err = MSG_SUCCESS;
+ char* pMsgBody = null;
result r = E_SUCCESS;
- //create new message
- err = messages_create_message(MESSAGES_TYPE_SMS, &smsMsg);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to create message object");
-
if (message.GetText().GetLength() == 0)
{
Tizen::Base::String emptyText(L" ");
SysTryCatch(NID_MSG, pMsgBody != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
- err = messages_set_text(smsMsg, pMsgBody);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set message text");
+ err = msg_set_int_value(msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_SMS);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Set Message Type error");
- err = AddMessageAddress(recipientList, RECIPIENT_TYPE_TO, smsMsg, MESSAGES_RECIPIENT_TO);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set message To address");
+ err = msg_set_str_value(msgInfo, MSG_MESSAGE_SMS_DATA_STR, pMsgBody, strlen(pMsgBody));
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Set Message body error");
+
+ err = AddMessageAddress(recipientList, RECIPIENT_TYPE_TO, msgInfo, MSG_RECIPIENTS_TYPE_TO);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Message add address error");
if (pMsgBody)
{
return err;
CATCH:
+ SetLastResult(r);
if (pMsgBody)
{
}
int
-_MsgUtil::GetEmailMessage(const EmailMessage& message, const RecipientList& recipientList, email_h& emailMsg)
+_MsgUtil::GetMmsMessage(msg_struct_t& msgInfo, const MmsMessage& message, const RecipientList& recipientList)
{
- int err = EMAIL_ERROR_NONE;
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
- int attachNum = 0;
- const char* pSubject = null;
- const char* pMsgBody = null;
- Tizen::Base::Collection::IList* pAttachmentList = null;
+ char* pSubject = null;
pSubject = _StringConverter::CopyToCharArrayN(message.GetSubject());
- pMsgBody = _StringConverter::CopyToCharArrayN(message.GetText());
+ SysTryCatch(NID_MSG, pSubject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
- err = email_set_subject(emailMsg, pSubject);
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add subject failed");
- err = email_set_body(emailMsg, pMsgBody);
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add body failed");
+ //create new message
+ err = msg_set_int_value(msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_MMS);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Set Message Type error");
- err = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_TO, emailMsg, EMAIL_RECIPIENT_TYPE_TO);
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add recipient failed");
- err = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_CC, emailMsg, EMAIL_RECIPIENT_TYPE_CC);
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add recipient failed");
- err = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_BCC, emailMsg, EMAIL_RECIPIENT_TYPE_BCC);
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add recipient failed");
+ err = msg_set_str_value(msgInfo, MSG_MESSAGE_SUBJECT_STR, pSubject, strlen(pSubject));
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Set Message body error");
- pAttachmentList = message.GetAttachmentListN();
+ err = AddMessageAddress(recipientList, RECIPIENT_TYPE_TO, msgInfo, MSG_RECIPIENTS_TYPE_TO);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to add To address");
- if (pAttachmentList)
- {
- attachNum = pAttachmentList->GetCount();
- }
+ err = AddMessageAddress(recipientList, RECIPIENT_TYPE_CC, msgInfo, MSG_RECIPIENTS_TYPE_CC);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to add Cc address");
- if (attachNum >= 1)
- {
- String* pAttachPath = null;
- char* pTempAttachPath = null;
-
- for (int index = 0; index < attachNum; index++)
- {
- pAttachPath = dynamic_cast< String* >(pAttachmentList->GetAt(index));
- SysTryCatch(NID_MSG, pAttachPath != null, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add attachment failed");
- pTempAttachPath = _StringConverter::CopyToCharArrayN(*pAttachPath);
- err = email_add_attach(emailMsg, pTempAttachPath);
- if (pTempAttachPath)
- {
- delete[] pTempAttachPath;
- pTempAttachPath = null;
- }
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] email add attachment failed");
- }
- }
-
- if (pAttachmentList)
- {
- if (pAttachmentList->GetCount() > 0)
- {
- pAttachmentList->RemoveAll(true);
- }
- delete pAttachmentList;
- pAttachmentList = null;
- }
+ err = AddMessageAddress(recipientList, RECIPIENT_TYPE_BCC, msgInfo, MSG_RECIPIENTS_TYPE_BCC);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to add Bcc address");
- if (pMsgBody)
- {
- delete[] pMsgBody;
- pMsgBody = null;
- }
+ err = PopulateMmsContent(message, msgInfo);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to generate MMS message");
if (pSubject)
{
return err;
CATCH:
- if (pMsgBody)
- {
- delete[] pMsgBody;
- pMsgBody = null;
- }
+ SetLastResult(r);
if (pSubject)
{
pSubject = null;
}
- if (pAttachmentList)
- {
- if (pAttachmentList->GetCount() > 0)
- {
- pAttachmentList->RemoveAll(true);
- }
- delete pAttachmentList;
- pAttachmentList = null;
- }
-
return err;
}
int
-_MsgUtil::AddEmailMessageAddress(const RecipientList& recipientList, RecipientType type, email_h& emailMsg, email_recipient_type_e recipientType)
+_MsgUtil::PopulateMmsContent(const MmsMessage& message, msg_struct_t& msgData)
{
- String* pTempRecipient = null;
- IList* pRecipientList = null;
- char* pEmailAddr = null;
- int count = 0;
- int err = EMAIL_ERROR_NONE;
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
+ String filePath;
+ char* pFilePath = null;
+ bool isImage = false;
+ bool isAudio = false;
+ bool isText = false;
- pRecipientList = (const_cast< RecipientList& >(recipientList)).GetListN(type);
- if (!pRecipientList)
+ msg_struct_t mmsData = NULL;
+ msg_struct_t region = NULL;
+ msg_struct_t page = NULL;
+ msg_struct_t media = NULL;
+ msg_struct_t smilText = NULL;
+ msg_struct_t mmsAttach = NULL;
+
+ //create a temp file for body text
+ Tizen::Base::String bodyText = message.GetText();
+ Tizen::Base::String bodyTextFilePath(BODY_TEXT_FILE_NAME);
+ Tizen::Io::File file;
+ r = file.Construct(bodyTextFilePath, L"w+");
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
+
+ mmsData = msg_create_struct(MSG_STRUCT_MMS);
+
+ if (bodyText.GetLength())
{
- r = GetLastResult();
- SysLogException(NID_MSG, r, "[%s] Failed to get recipient list", GetErrorMessage(r));
- goto CATCH;
+ isText = true;
+ //write text to file
+ r = file.Write(bodyText);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
}
- count = pRecipientList->GetCount();
- for (int index = 0; index < count; index++)
+ filePath = message.GetAttachment(MMS_IMAGE);
+ if (filePath.GetLength())
{
- pTempRecipient = dynamic_cast< String* >(pRecipientList->GetAt(index));
- if (!pTempRecipient)
+ isImage = true;
+ }
+
+ filePath = message.GetAttachment(MMS_VIDEO);
+ if (filePath.GetLength())
+ {
+ isImage = true;
+ }
+
+ filePath = message.GetAttachment(MMS_AUDIO);
+ if (filePath.GetLength())
+ {
+ isAudio = true;
+ }
+
+ // Layout Setting
+ msg_set_int_value(mmsData, MSG_MMS_ROOTLAYOUT_WIDTH_INT, 100);
+ msg_set_int_value(mmsData, MSG_MMS_ROOTLAYOUT_HEIGHT_INT, 100);
+ msg_set_int_value(mmsData, MSG_MMS_ROOTLAYOUT_BGCOLOR_INT, 0xffffff);
+ msg_set_bool_value(mmsData, MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL, true);
+ msg_set_bool_value(mmsData, MSG_MMS_ROOTLAYOUT_HEIGHT_PERCENT_BOOL, true);
+
+ if (!isImage)
+ {
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_REGION, ®ion);
+ msg_set_str_value(region, MSG_MMS_REGION_ID_STR, (char *)"Text", 4);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_LEFT_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_TOP_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_WIDTH_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_HEIGHT_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_BGCOLOR_INT, 0xffffff);
+ }
+ else if (!isText)
+ {
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_REGION, ®ion);
+ msg_set_str_value(region, MSG_MMS_REGION_ID_STR, (char *)"Image", 5);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_LEFT_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_TOP_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_WIDTH_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_HEIGHT_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_BGCOLOR_INT, 0xffffff);
+ }
+ else
+ {
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_REGION, ®ion);
+ msg_set_str_value(region, MSG_MMS_REGION_ID_STR, (char *)"Image", 5);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_LEFT_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_TOP_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_WIDTH_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_HEIGHT_INT, 50);
+ msg_set_int_value(region, MSG_MMS_REGION_BGCOLOR_INT, 0xffffff);
+
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_REGION, ®ion);
+ msg_set_str_value(region, MSG_MMS_REGION_ID_STR, (char *)"Text", 4);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_LEFT_INT, 0);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_TOP_INT, 50);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_WIDTH_INT, 100);
+ msg_set_int_value(region, MSG_MMS_REGION_LENGTH_HEIGHT_INT, 50);
+ msg_set_int_value(region, MSG_MMS_REGION_BGCOLOR_INT, 0xffffff);
+ }
+
+ // Add Media
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_PAGE, &page);
+ msg_set_int_value(page, MSG_MMS_PAGE_PAGE_DURATION_INT, 5440);
+
+ if (isImage)
+ {
+ filePath = message.GetAttachment(MMS_IMAGE);
+ if (filePath.GetLength())
{
- r = GetLastResult();
- err = EMAIL_ERROR_OPERATION_FAILED;
- SysLogException(NID_MSG, r, "[%s] Failed to get a recipient", GetErrorMessage(r));
- goto CATCH;
+ pFilePath = _StringConverter::CopyToCharArrayN(filePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
+
+ msg_mms_add_item(page, MSG_STRUCT_MMS_MEDIA, &media);
+ msg_set_int_value(media, MSG_MMS_MEDIA_TYPE_INT, MMS_SMIL_MEDIA_IMG);
+ msg_set_str_value(media, MSG_MMS_MEDIA_REGION_ID_STR, (char *)"Image", 5);
+ msg_set_str_value(media, MSG_MMS_MEDIA_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
+
+ delete[] pFilePath;
+ pFilePath = null;
}
- pEmailAddr = _StringConverter::CopyToCharArrayN(*pTempRecipient);
- err = email_add_recipient(emailMsg, recipientType, pEmailAddr);
+ filePath = message.GetAttachment(MMS_VIDEO);
+ if (filePath.GetLength())
+ {
+ pFilePath = _StringConverter::CopyToCharArrayN(filePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
+
+ msg_mms_add_item(page, MSG_STRUCT_MMS_MEDIA, &media);
+ msg_set_int_value(media, MSG_MMS_MEDIA_TYPE_INT, MMS_SMIL_MEDIA_VIDEO);
+ msg_set_str_value(media, MSG_MMS_MEDIA_REGION_ID_STR, (char *)"Image", 5);
+ msg_set_str_value(media, MSG_MMS_MEDIA_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
- if (pEmailAddr)
+ delete[] pFilePath;
+ pFilePath = null;
+ }
+ }
+
+ if (isAudio)
+ {
+ filePath = message.GetAttachment(MMS_AUDIO);
+ if (filePath.GetLength())
{
- delete[] pEmailAddr;
- pEmailAddr = null;
+ pFilePath = _StringConverter::CopyToCharArrayN(filePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
+
+ msg_mms_add_item(page, MSG_STRUCT_MMS_MEDIA, &media);
+ msg_set_int_value(media, MSG_MMS_MEDIA_TYPE_INT, MMS_SMIL_MEDIA_AUDIO);
+ msg_set_str_value(media, MSG_MMS_MEDIA_REGION_ID_STR, (char *)"Audio", 5);
+ msg_set_str_value(media, MSG_MMS_MEDIA_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
+
+ delete[] pFilePath;
+ pFilePath = null;
}
- SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set message address");
+ }
+ if (isText)
+ {
+ pFilePath = _StringConverter::CopyToCharArrayN(bodyTextFilePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
+
+ msg_mms_add_item(page, MSG_STRUCT_MMS_MEDIA, &media);
+ msg_set_int_value(media, MSG_MMS_MEDIA_TYPE_INT, MMS_SMIL_MEDIA_TEXT);
+ msg_set_str_value(media, MSG_MMS_MEDIA_REGION_ID_STR, (char *)"Text", 4);
+ msg_set_str_value(media, MSG_MMS_MEDIA_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
+
+ msg_get_struct_handle(media, MSG_MMS_MEDIA_SMIL_TEXT_HND, &smilText);
+ msg_set_int_value(smilText, MSG_MMS_SMIL_TEXT_COLOR_INT, 0x000000);
+ msg_set_int_value(smilText, MSG_MMS_SMIL_TEXT_SIZE_INT, MMS_SMIL_FONT_SIZE_NORMAL);
+ msg_set_bool_value(smilText, MSG_MMS_SMIL_TEXT_BOLD_BOOL, false);
+
+ delete[] pFilePath;
+ pFilePath = null;
}
- // deallocate
- if (pRecipientList->GetCount() > 0)
+ //vcard attachment
+ filePath = message.GetAttachment(MMS_VCARD);
+ if (filePath.GetLength())
{
- pRecipientList->RemoveAll(true);
+ pFilePath = _StringConverter::CopyToCharArrayN(filePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_ATTACH, &mmsAttach);
+ msg_set_str_value(mmsAttach, MSG_MMS_ATTACH_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
+ delete[] pFilePath;
+ pFilePath = null;
}
- delete pRecipientList;
- pRecipientList = null;
+ //calander attachment
+ filePath = message.GetAttachment(MMS_VCALENDAR);
+ if (filePath.GetLength())
+ {
+ pFilePath = _StringConverter::CopyToCharArrayN(filePath);
+ err = MSG_ERR_MEMORY_ERROR;
+ SysTryCatch(NID_MSG, pFilePath != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "memory allocation failed.");
+ msg_mms_add_item(mmsData, MSG_STRUCT_MMS_ATTACH, &mmsAttach);
+ msg_set_str_value(mmsAttach, MSG_MMS_ATTACH_FILEPATH_STR, pFilePath, MSG_FILEPATH_LEN_MAX);
+ delete[] pFilePath;
+ pFilePath = null;
+ }
+
+ err = msg_set_mms_struct(msgData, mmsData);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to set message contents");
+
+ msg_release_struct(&mmsData);
return err;
CATCH:
- SetLastResult(r);
- if (pRecipientList)
+ if (mmsData)
+ {
+ msg_release_struct(&mmsData);
+ }
+ return err;
+}
+
+result
+_MsgUtil::AddEmailMessageAddress(const RecipientList& recipientList, RecipientType type, email_mail_data_t *pMail)
+{
+ String tempRecipient = null;
+ IList* pRecipientList = null;
+ int count = 0;
+ int index = 0;
+ const int zero = 0;
+ result r = E_SUCCESS;
+
+ pRecipientList = (const_cast< RecipientList& >(recipientList)).GetListN(type);
+ SysTryCatch(NID_MSG, pRecipientList != null, r = GetLastResult(), r, "[%s] Failed to get recipient list", GetErrorMessage(r));
+
+ count = pRecipientList->GetCount();
+ SysTryCatch(NID_MSG, count != zero, r = E_SUCCESS , r, "Type[%d] Recipient is empty",type);
+
+ tempRecipient.Append(L"<" + *(dynamic_cast< String* >(pRecipientList->GetAt(index))) + L">");
+ index++;
+
+ for (; index < count; index++)
{
+ tempRecipient.Append(L",<" + *(dynamic_cast< String* >(pRecipientList->GetAt(index))) + L">");
+
+ }
+ if(RECIPIENT_TYPE_TO == type)
+ {
+ pMail->full_address_to = _StringConverter::CopyToCharArrayN(tempRecipient);
+ }
+ else if(RECIPIENT_TYPE_CC == type)
+ {
+ pMail->full_address_cc = _StringConverter::CopyToCharArrayN(tempRecipient);
+
+ }
+ else if( RECIPIENT_TYPE_BCC == type)
+ {
+ pMail->full_address_bcc = _StringConverter::CopyToCharArrayN(tempRecipient);
+ }
+ else
+ {
+ SysLog(NID_MSG, "[%d] Wrong recipeint type", type);
+ r = E_INVALID_ARG;
+ goto CATCH;
+ }
+
if (pRecipientList->GetCount() > 0)
{
pRecipientList->RemoveAll(true);
}
delete pRecipientList;
pRecipientList = null;
+
+ return r;
+
+CATCH:
+ if (pRecipientList->GetCount() > 0)
+ {
+ pRecipientList->RemoveAll(true);
}
+ delete pRecipientList;
+ pRecipientList = null;
+
+ return r;
- return err;
}
int
-_MsgUtil::AddMessageAddress(const RecipientList& recipientList, RecipientType type, messages_message_h& messageMsg, messages_recipient_type_e recipientType)
+_MsgUtil::AddMessageAddress(const RecipientList& recipientList, RecipientType type, msg_struct_t& messageMsg, _MSG_RECIPIENT_TYPE_E recipientType)
{
String* pTempRecipient = null;
IList* pRecipientList = null;
char* pPhoneNum = null;
int count = 0;
- int err = MESSAGES_ERROR_NONE;
+ int msgType = -1;
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
pRecipientList = (const_cast< RecipientList& >(recipientList)).GetListN(type);
goto CATCH;
}
+ err = msg_get_int_value(messageMsg, MSG_MESSAGE_TYPE_INT, &msgType);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to get message type");
+
count = pRecipientList->GetCount();
for (int index = 0; index < count; index++)
{
if (!pTempRecipient)
{
r = GetLastResult();
- err = MESSAGES_ERROR_OPERATION_FAILED;
+ err = MSG_ERR_NULL_POINTER;
SysLogException(NID_MSG, r, "[%s] Failed to get a recipient", GetErrorMessage(r));
goto CATCH;
}
pPhoneNum = _StringConverter::CopyToCharArrayN(*pTempRecipient);
- err = messages_add_address(messageMsg, pPhoneNum, recipientType);
+
+ msg_struct_list_s *pAddrList = NULL;
+ msg_struct_t addrInfo = NULL;
+
+ err = msg_get_list_handle(messageMsg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&pAddrList);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to get message address handle");
+
+ addrInfo = pAddrList->msg_struct_info[pAddrList->nCount];
+
+ if (msgType == MSG_TYPE_SMS)
+ {
+ msg_set_int_value(addrInfo, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, recipientType);
+ }
+ else if (msgType == MSG_TYPE_MMS)
+ {
+ if (strchr(pPhoneNum, '@') == NULL)
+ {
+ msg_set_int_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+ }
+ else
+ {
+ msg_set_int_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_EMAIL);
+ }
+ msg_set_int_value(addrInfo, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, recipientType);
+ }
+
+ err = msg_set_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, pPhoneNum, strlen(pPhoneNum));
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, E_SYSTEM, "failed to set message address");
+
+ pAddrList->nCount++;
if (pPhoneNum)
{
delete[] pPhoneNum;
pPhoneNum = null;
}
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set message address");
-
}
// deallocate
pRecipientList = null;
}
+ if (pPhoneNum)
+ {
+ delete[] pPhoneNum;
+ pPhoneNum = null;
+ }
return err;
}
return concatenatedString;
}
-int
-_MsgUtil::GetMmsMessage(const MmsMessage& message, const RecipientList& recipientList, messages_message_h& mmsMsg)
-{
- int err = MESSAGES_ERROR_NONE;
- result r = E_SUCCESS;
- const char* pSubject = null;
- const char* pMsgBody = null;
- const char* pFilePath = null;
- String filePath;
-
- pSubject = _StringConverter::CopyToCharArrayN(message.GetSubject());
- pMsgBody = _StringConverter::CopyToCharArrayN(message.GetText());
-
- //create new message
- err = messages_create_message(MESSAGES_TYPE_MMS, &mmsMsg);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "Insufficient memory");
-
- err = messages_set_text(mmsMsg, pMsgBody);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set mms text");
-
- err = messages_mms_set_subject(mmsMsg, pSubject);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to set mms body");
-
- err = AddMessageAddress(recipientList, RECIPIENT_TYPE_TO, mmsMsg, MESSAGES_RECIPIENT_TO);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to add To address");
-
- err = AddMessageAddress(recipientList, RECIPIENT_TYPE_CC, mmsMsg, MESSAGES_RECIPIENT_CC);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to add Cc address");
-
- err = AddMessageAddress(recipientList, RECIPIENT_TYPE_BCC, mmsMsg, MESSAGES_RECIPIENT_BCC);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "failed to add Bcc address");
-
- // populate attachments
- filePath = message.GetAttachment(MMS_IMAGE);
- if (filePath.GetLength())
- {
- pFilePath = _StringConverter::CopyToCharArrayN(filePath);
- err = messages_mms_add_attachment(mmsMsg, MESSAGES_MEDIA_IMAGE, pFilePath);
- delete[] pFilePath;
- pFilePath = null;
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "mms add attachment failed");
- }
-
- //video attachment
- filePath = message.GetAttachment(MMS_VIDEO);
- if (filePath.GetLength())
- {
- pFilePath = _StringConverter::CopyToCharArrayN(filePath);
- err = messages_mms_add_attachment(mmsMsg, MESSAGES_MEDIA_VIDEO, pFilePath);
- delete[] pFilePath;
- pFilePath = null;
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "mms add attachment failed");
- }
-
- //audio attachment
- filePath = message.GetAttachment(MMS_AUDIO);
- if (filePath.GetLength())
- {
- pFilePath = _StringConverter::CopyToCharArrayN(filePath);
- err = messages_mms_add_attachment(mmsMsg, MESSAGES_MEDIA_AUDIO, pFilePath);
- delete[] pFilePath;
- pFilePath = null;
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "mms add attachment failed");
- }
-
- //vcard attachment
- filePath = message.GetAttachment(MMS_VCARD);
- if (filePath.GetLength())
- {
- pFilePath = _StringConverter::CopyToCharArrayN(filePath);
- err = messages_mms_add_attachment(mmsMsg, MESSAGES_MEDIA_UNKNOWN, pFilePath); // Not Suppourted Yet
- delete[] pFilePath;
- pFilePath = null;
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "mms add attachment failed");
- }
-
- //calander attachment
- filePath = message.GetAttachment(MMS_VCALENDAR);
- if (filePath.GetLength())
- {
- pFilePath = _StringConverter::CopyToCharArrayN(filePath);
- err = messages_mms_add_attachment(mmsMsg, MESSAGES_MEDIA_UNKNOWN, pFilePath); // Not Suppourted Yet
- delete[] pFilePath;
- pFilePath = null;
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "mms add attachment failed");
- }
-
- if (pMsgBody)
- {
- delete[] pMsgBody;
- pMsgBody = null;
- }
-
- if (pSubject)
- {
- delete[] pSubject;
- pSubject = null;
- }
-
- return err;
-
-CATCH:
-
- if (pMsgBody)
- {
- delete[] pMsgBody;
- pMsgBody = null;
- }
-
- if (pSubject)
- {
- delete[] pSubject;
- pSubject = null;
- }
-
- return err;
-}
-
Tizen::Base::DateTime
_MsgUtil::ConvertTime(time_t* pTime)
{
}
SmsMessage*
-_MsgUtil::ConvertSmsMessageN(const SmsMessageBoxType& type, messages_message_h msg)
+_MsgUtil::ConvertSmsMessageN(const SmsMessageBoxType& type, msg_struct_t& msg)
{
result r = E_SUCCESS;
+ int err = MSG_SUCCESS;
SmsMessage* pSmsMessage = null;
- char* pOriginalText = null;
- char* pBodyText = null;
- char* pMsgAddress = null;
DateTime time;
- time_t tempTime = 0;
+ int msgTime = -1;
bool hasMoreText = false;
- int messageId = 0;
+ int messageId;
String body;
- messages_recipient_type_e recipientType = MESSAGES_RECIPIENT_TO;
const int msgBodyLength = 160;
int originalTextLength = 0;
SysTryCatch(NID_MSG, pSmsMessage != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
// message ID
- messages_get_message_id(msg, &messageId);
+ err = msg_get_int_value(msg, MSG_MESSAGE_ID_INT, &messageId);
+
// body text
- messages_get_text(msg, &pOriginalText);
- SysTryCatch(NID_MSG, pOriginalText != null, r = E_SYSTEM, r, "sms get message body failed");
+ char msgText[MAX_MSG_TEXT_LEN];
+ err = msg_get_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, msgText, MAX_MSG_TEXT_LEN);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, r, "sms get message body failed");
- originalTextLength = strlen(pOriginalText);
+ originalTextLength = strlen(msgText);
if (originalTextLength > msgBodyLength)
{
- pBodyText = (char*) calloc(msgBodyLength + 1, sizeof(char)); // include NULL character
- SysTryCatch(NID_MSG, pBodyText != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
- strncpy(pBodyText, pOriginalText, msgBodyLength);
- pBodyText[msgBodyLength] = '\0'; // add NULL character
- free(const_cast< char* >(pOriginalText));
- pOriginalText = null;
+ char msgBodyText[msgBodyLength + 1];
+ memset(msgText, 0, msgBodyLength + 1);
+ strncpy(msgBodyText, msgText, msgBodyLength);
+ body = msgBodyText;
hasMoreText = true;
-
}
else
{
- pBodyText = const_cast< char* >(pOriginalText);
- pOriginalText = null;
+ body = msgText;
}
- body = pBodyText;
-
// received/sent time
- messages_get_time(msg, &tempTime);
- time = _MsgUtil::ConvertTime(&tempTime);
+ err = msg_get_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, &msgTime);
+ time = _MsgUtil::ConvertTime((time_t*) &msgTime);
switch (type)
{
case SMS_MESSAGE_BOX_TYPE_INBOX:
{
// sender address
- messages_get_address(msg, 0, &pMsgAddress, &recipientType);
- SysTryCatch(NID_MSG, pMsgAddress != null, r = E_SYSTEM, r, "sms get message address failed");
- String senderAddress(pMsgAddress);
- free(pMsgAddress);
- pMsgAddress = null;
+ char address[MAX_ADDRESS_VAL_LEN] = {0, };
+ msg_struct_list_s* pAddrList = NULL;
+ msg_struct_t addrInfo = NULL;
+ err = msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&pAddrList);
+ addrInfo = pAddrList->msg_struct_info[0];
+ err = msg_get_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, address, MAX_ADDRESS_VAL_LEN);
+ String senderAddress(address);
+
_SmsMessageImpl::GetInstance(*pSmsMessage)->SetInboxMessage(messageId, body, hasMoreText, senderAddress, time);
break;
}
case SMS_MESSAGE_BOX_TYPE_SENTBOX:
{
// recipient list
- int recipient_count = 0;
- messages_get_address_count(msg, &recipient_count);
+ char address[MAX_ADDRESS_VAL_LEN] = {0, };
+ msg_struct_list_s* pAddrList = NULL;
+ msg_struct_t addrInfo = NULL;
+ err = msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&pAddrList);
+ addrInfo = pAddrList->msg_struct_info[0];
+ int recipient_count = pAddrList->nCount;
RecipientList recipients;
for (int index = 0; index < recipient_count; index++)
{
- messages_get_address(msg, index, &pMsgAddress, &recipientType);
- SysTryCatch(NID_MSG, pMsgAddress != null, r = E_SYSTEM, r, "sms get message address failed");
- String senderAddress(pMsgAddress);
- free(pMsgAddress);
- pMsgAddress = null;
+ addrInfo = pAddrList->msg_struct_info[index];
+ err = msg_get_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, address, MAX_ADDRESS_VAL_LEN);
+ String senderAddress(address);
r = recipients.Add(RECIPIENT_TYPE_TO, senderAddress);
}
+
_SmsMessageImpl::GetInstance(*pSmsMessage)->SetSentboxMessage(messageId, body, hasMoreText, recipients, time);
break;
}
case SMS_MESSAGE_BOX_TYPE_OUTBOX:
{
// recipient list
- int recipient_count = 0;
- messages_get_address_count(msg, &recipient_count);
+ char address[MAX_ADDRESS_VAL_LEN] = {0, };
+ msg_struct_list_s* pAddrList = NULL;
+ msg_struct_t addrInfo = NULL;
+ err = msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&pAddrList);
+ addrInfo = pAddrList->msg_struct_info[0];
+ int recipient_count = pAddrList->nCount;
RecipientList recipients;
for (int index = 0; index < recipient_count; index++)
{
- messages_get_address(msg, index, &pMsgAddress, &recipientType);
- SysTryCatch(NID_MSG, pMsgAddress != null, r = E_SYSTEM, r, "sms get message address failed");
- String senderAddress(pMsgAddress);
- free(pMsgAddress);
- pMsgAddress = null;
- r = recipients.Add(RECIPIENT_TYPE_TO, senderAddress);
+ addrInfo = pAddrList->msg_struct_info[index];
+ err = msg_get_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, address, MAX_ADDRESS_VAL_LEN);
+ String senderAddress(address);
}
+
_SmsMessageImpl::GetInstance(*pSmsMessage)->SetOutboxMessage(messageId, body, hasMoreText, recipients, time);
break;
}
break;
}
- if (pBodyText)
+ return pSmsMessage;
+
+CATCH:
+ if (pSmsMessage)
{
- free(pBodyText);
- pBodyText = null;
+ delete pSmsMessage;
}
- return pSmsMessage;
+ return NULL;
+}
+result
+_MsgUtil::SendEmail(const EmailMessage& message, const RecipientList& recipientList, int &mailId, int &requestId)
+{
+
+//////////////////
+ email_account_t* pAccount = NULL;
+ email_mail_data_t *pMail = null;
+ email_mailbox_t *pMailbox = null;
+ email_attachment_data_t **pAttach=null;
+ int accountId = 0;
+ int err = EMAIL_ERROR_NONE;
+ result r = E_SUCCESS;
+ String fromAddr;
+
+
+ email_service_begin();
+
+ pMail = (email_mail_data_t *)calloc(1,sizeof(email_mail_data_t));
+ SysTryCatch(NID_MSG, pMail != null, r = E_OUT_OF_MEMORY, r, "Insufficient memory");
+
+ pMailbox = (email_mailbox_t *)calloc(1,sizeof(email_mailbox_t));
+ SysTryCatch(NID_MSG, pMailbox != null, r = E_OUT_OF_MEMORY, r, "Insufficient memory");
+
+
+ err = email_load_default_account_id(&accountId);
+ SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_INVALID_ACCOUNT, r, "Account Load is Failed.");
+
+ err = email_get_account(accountId, GET_FULL_DATA, &pAccount);
+ SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_INVALID_ACCOUNT, r, "Account is Failed.");
+
+ fromAddr.Append(L'\"');
+ fromAddr.Append(pAccount->incoming_server_user_name);
+ fromAddr.Append(L"\"<");
+ fromAddr.Append(pAccount->user_email_address);
+ fromAddr.Append(L'>');
+ pMail->full_address_from = _StringConverter::CopyToCharArrayN(fromAddr);
+
+ err = email_get_mailbox_by_mailbox_type(accountId, EMAIL_MAILBOX_TYPE_OUTBOX, &pMailbox);
+ SysTryCatch(NID_MSG, err == EMAIL_ERROR_NONE, r = E_STORAGE_FULL, r, "Account is Failed.");
+
+ //info
+ pMail->account_id = pAccount->account_id;
+ pMail->flags_draft_field = 1;
+ pMail->flags_seen_field = 1;
+ pMail->priority = EMAIL_MAIL_PRIORITY_NORMAL;
+ pMail->mailbox_id = pMailbox->mailbox_id;
+ pMail->mailbox_type = pMailbox->mailbox_type;
+ pMail->attachment_count = 0;
+ pMail->subject = _StringConverter::CopyToCharArrayN(message.GetSubject());
+
+ r = AddEmailMessageBody(pMail,_StringConverter::CopyToCharArrayN(message.GetText()));
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add body failed", GetErrorMessage(r));
+ r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_TO, pMail);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_CC, pMail);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+ r = AddEmailMessageAddress(recipientList, RECIPIENT_TYPE_BCC, pMail);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+
+
+ r = AddEmailMessageAttachment(message, &pAttach, pMail);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "[%s] email add recipient failed", GetErrorMessage(r));
+
+
+ if( null != pAttach)
+ {
+ err=email_add_mail(pMail,*pAttach, pMail->attachment_count, NULL, 0);
+ }
+ else
+ {
+ err=email_add_mail(pMail,null, pMail->attachment_count, NULL, 0);
+ }
+
+ r = _MsgUtil::EmailConvertException(err);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "To make email body is failed.");
+
+ err = email_send_mail(pMail->mail_id, &requestId);
+ r = _MsgUtil::EmailConvertException(err);
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, r, "The sent mail is failed.");
+
+ mailId = pMail->mail_id;
+
+ r = AddEmailCallBackToDbus();
+
+ if (pAttach)
+ {
+ if (*pAttach)
+ {
+ for(int i=0 ; i < pMail->attachment_count ; i++)
+ {
+ if(pAttach[i])
+ {
+ if(pAttach[i]->attachment_name)
+ {
+ free(pAttach[i]->attachment_name);
+ }
+ if(pAttach[i]->attachment_path)
+ {
+ free(pAttach[i]->attachment_path);
+ }
+ }
+
+ }
+ free(*pAttach);
+ }
+ free( pAttach);
+
+ }
+ email_free_mail_data(&pMail, 1);
+ email_free_mailbox(&pMailbox, 1);
+ email_service_end();
+
+ return r;
CATCH:
+ if (pAttach)
+ {
+ if (*pAttach)
+ {
+ for(int i=0 ; i < pMail->attachment_count ; i++)
+ {
+ if(pAttach[i])
+ {
+ if(pAttach[i]->attachment_name)
+ {
+ free(pAttach[i]->attachment_name);
+ }
+ if(pAttach[i]->attachment_path)
+ {
+ free(pAttach[i]->attachment_path);
+ }
+ }
- if (pBodyText)
+ }
+ free(*pAttach);
+ }
+ free( pAttach);
+
+ }
+ email_free_mail_data(&pMail, 1);
+ email_free_mailbox(&pMailbox, 1);
+ email_service_end();
+
+ return r;
+
+/////////////
+
+}
+
+result
+_MsgUtil::AddEmailMessageBody(email_mail_data_t *pMail, char * pBody)
+{
+
+ String fileName(L"/tmp/mail.txt");
+ File file;
+ result r = E_SUCCESS;
+ int bodyLen = 0;
+ r = file.Construct(fileName, L"w");
+ if(IsFailed(r))
{
- free(pBodyText);
- pBodyText = null;
+ return E_STORAGE_FULL;
+
+ }
+ if (pBody)
+ {
+ bodyLen = strlen(pBody);
+ if (bodyLen)
+ {
+ r = file.Write(pBody, bodyLen);
+ if(IsFailed(r))
+ {
+ return E_STORAGE_FULL;
+ }
+ }
}
- if (pSmsMessage)
+ pMail->file_path_plain = _StringConverter::CopyToCharArrayN(fileName);
+
+ return E_SUCCESS;
+
+}
+
+result
+_MsgUtil::AddEmailMessageAttachment(const EmailMessage& message, email_attachment_data_t ***pAttach, email_mail_data_t *pMail)
+{
+ Tizen::Base::Collection::IList* pAttachmentList = null;
+ result r = E_SUCCESS;
+ int attachNum = 0 ;
+ email_attachment_data_t *getMemory=null;
+
+ SysTryCatch(NID_MSG, pAttach != null, r = E_OUT_OF_MEMORY, r, "Insufficient memory");
+
+ pAttachmentList = message.GetAttachmentListN();
+ SysTryCatch(NID_MSG, null != pAttachmentList, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] email add attachment failed");
+
+ attachNum = pAttachmentList->GetCount();
+ SysTryCatch(NID_MSG, attachNum > 0, r = E_SUCCESS, E_SUCCESS, "email attachment file does not exist.");
+
+
+ (*pAttach) = (email_attachment_data_t **)calloc( attachNum,sizeof(email_attachment_data_t*));
+ SysTryCatch(NID_MSG, *pAttach != null, r = E_OUT_OF_MEMORY, r, "Insufficient memory");
+
+ getMemory = (email_attachment_data_t *)calloc(attachNum,sizeof(email_attachment_data_t));
+ SysTryCatch(NID_MSG, getMemory != null, r = E_OUT_OF_MEMORY, r, "Insufficient memory");
+
+ for( int index = 0; index < attachNum ; index ++)
{
- delete pSmsMessage;
+ int startIndex = 0;
+ int findIndex = 0;
+ String* pAttachPath = null;
+ String tempString = null;
+ File file;
+ FileAttributes attr;
+
+ pAttachPath = dynamic_cast< String* >(pAttachmentList->GetAt(index));
+ SysTryCatch(NID_MSG, pAttachPath != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] email add attachment failed");
+
+ startIndex = pAttachPath->GetLength()-1;
+ if( E_SUCCESS == pAttachPath->LastIndexOf( L"/", startIndex, findIndex))
+ {
+ pAttachPath->SubString(findIndex+1, tempString);
+ }
+ else
+ {
+ tempString = *pAttachPath;
+ }
+
+ (*pAttach)[index] = getMemory + index;
+ memset((*pAttach)[index], 0 , sizeof(email_attachment_data_t));
+
+ r = File::GetAttributes(*pAttachPath, attr);
+ SysTryCatch(NID_MSG, r == E_SUCCESS , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] email add attachment failed");
+
+ (*pAttach)[index]->attachment_name = _StringConverter::CopyToCharArrayN(tempString);
+ (*pAttach)[index]->attachment_path = _StringConverter::CopyToCharArrayN(*pAttachPath);
+ (*pAttach)[index]->attachment_size = attr.GetFileSize();
+ (*pAttach)[index]->save_status = 1;
+ pMail->attachment_count = index+1;
+ }
+
+ if (pAttachmentList)
+ {
+ if (pAttachmentList->GetCount() > 0)
+ {
+ pAttachmentList->RemoveAll(true);
+ }
+ delete pAttachmentList;
+ pAttachmentList = null;
}
+ return r;
- return NULL;
+CATCH:
+
+ if (pAttachmentList)
+ {
+ if (pAttachmentList->GetCount() > 0)
+ {
+ pAttachmentList->RemoveAll(true);
+ }
+ delete pAttachmentList;
+ pAttachmentList = null;
+ }
+
+ return r;
+
+}
+
+
+result
+_MsgUtil::AddEmailCallBackToDbus(void)
+{
+
+ DBusConnection* pConnection=NULL;
+ DBusError error = {0};
+ result r = E_SUCCESS;
+ static bool registerDbus = false;
+
+ SysTryCatch(NID_MSG, false == registerDbus ,, E_SUCCESS, "Dbus was already registered");
+
+ dbus_error_init(&error);
+
+ pConnection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
+ SysTryCatch(NID_MSG, pConnection != null, r = E_STORAGE_FULL, r, "dbus handler is null");
+
+ dbus_connection_setup_with_g_main(pConnection, null);
+ dbus_bus_add_match(pConnection, "path='/User/Email/NetworkStatus',type='signal',interface='User.Email.NetworkStatus'", &error);
+ SysTryCatch(NID_MSG, !dbus_error_is_set(&error) ,dbus_error_free(&error);r = E_STORAGE_FULL, E_STORAGE_FULL, "[E_STORAGE_FULL] Fail to add match : %s",error.message);
+ SysTryCatch(NID_MSG, FALSE != dbus_connection_add_filter(pConnection, EmailNetworkCallBack, NULL, NULL) ,dbus_error_free(&error);r = E_STORAGE_FULL, E_STORAGE_FULL, "[E_STORAGE_FULL] Fail to add match : %s",error.message);
+
+ if (false == registerDbus)
+ {
+ registerDbus = true;
+ SysLog(NID_MSG, "Now. Dbus was registered");
+
+ }
+
+
+ return r;
+
+CATCH:
+
+ return r;
+
+}
+
+DBusHandlerResult
+_MsgUtil::EmailNetworkCallBack(DBusConnection* pConnection, DBusMessage* pMessage, void* pUserData)
+{
+ DBusError error ={0};
+
+ if(dbus_message_is_signal(pMessage, "User.Email.NetworkStatus", "email"))
+ {
+ dbus_error_init(&error);
+ int status=0;
+ int accountId=0;
+ char* fileId=NULL;
+ int mailId=0;
+ int errorCode=0;
+ unsigned int checkDbus;
+ checkDbus = dbus_message_get_args(pMessage, &error,
+ DBUS_TYPE_INT32, &status,
+ DBUS_TYPE_INT32, &accountId,
+ DBUS_TYPE_STRING, &fileId,
+ DBUS_TYPE_INT32, &mailId,
+ DBUS_TYPE_INT32, &errorCode,
+ DBUS_TYPE_INVALID);
+ SysLog(NID_MSG, "Dbus status [%d], msg [%d], err [%d]",status, mailId, errorCode);
+
+ if(checkDbus)
+ {
+ switch (status) {
+ case NOTI_SEND_START:
+ break;
+
+ case NOTI_SEND_FAIL:
+
+ switch(errorCode)
+ {
+ case EMAIL_ERROR_NO_SIM_INSERTED:
+ case EMAIL_ERROR_FLIGHT_MODE:
+ case EMAIL_ERROR_SMTP_SEND_FAILURE:
+ case EMAIL_ERROR_NO_SUCH_HOST:
+ case EMAIL_ERROR_CONNECTION_FAILURE:
+ case EMAIL_ERROR_CONNECTION_BROKEN:
+ case EMAIL_ERROR_INVALID_SERVER:
+ case EMAIL_ERROR_NO_RESPONSE:
+
+ break;
+
+ default:
+ break;
+ }
+ _EmailManagerImpl::SentEmailStatusCallback(mailId, (email_noti_on_network_event)status, errorCode);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ break;
+
+ case NOTI_SEND_FINISH:
+ _EmailManagerImpl::SentEmailStatusCallback(mailId, (email_noti_on_network_event)status, errorCode);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ break;
+
+ default:
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+ }
+ }
+ else
+ {
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ }
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+}
+
+result
+_MsgUtil::EmailConvertException(int err)
+{
+ result r = E_SUCCESS;
+ SysLog(NID_MSG,"Core Error [%d]", err);
+
+ switch (err)
+ {
+ case EMAIL_ERROR_NONE:
+ r = E_SUCCESS;
+ break;
+
+ case EMAIL_ERROR_INVALID_PARAM:
+ r = E_INVALID_ARG;
+ break;
+
+
+ case EMAIL_ERROR_INVALID_ACCOUNT:
+ case EMAIL_ERROR_ACCOUNT_NOT_FOUND:
+ r = E_INVALID_ACCOUNT;
+ break;
+
+ case EMAIL_ERROR_NULL_VALUE:
+ case EMAIL_ERROR_IPC_SOCKET_FAILURE:
+ r = E_ON_INITIALIZING;
+ break;
+
+ case EMAIL_ERROR_DB_FAILURE:
+ case EMAIL_ERROR_OUT_OF_MEMORY:
+ r = E_STORAGE_FULL;
+ break;
+
+ default:
+ r = E_INVALID_CONDITION;
+ break;
+ }
+
+ return r;
}
} } // Tizen::Messaging
static bool IsValidVcardFile(const Tizen::Base::String& filePath);
static bool IsValidVcalendarFile(const Tizen::Base::String& filePath);
static bool IsValidPhoneNumber(const Tizen::Base::String& phoneNumber);
- static SmsMessageBoxType GetSmsMessageBoxType(messages_message_box_e folderId);
- static messages_message_box_e GetMsgFolderId(const SmsMessageBoxType& type);
- static SmsMessageBoxType GetMsgBoxType(const messages_message_box_e& folderId);
- static int GetSmsMessage(const SmsMessage& message, const RecipientList& recipientList, messages_message_h& smsMsg);
+ static SmsMessageBoxType GetSmsMessageBoxType(_MSG_FOLDER_ID_E folderId);
+ static _MSG_FOLDER_ID_E GetMsgFolderId(const SmsMessageBoxType& type);
+ static SmsMessageBoxType GetMsgBoxType(const _MSG_FOLDER_ID_E& folderId);
+ static int GetSmsMessage(msg_struct_t& msgInfo, const SmsMessage& message, const RecipientList& recipientList);
static Tizen::Base::String GetConcatenatedRecipientListString(const RecipientList& recipientList, RecipientType type, const Tizen::Base::String& delim);
- static int GetMmsMessage(const MmsMessage& message, const RecipientList& recipientList, messages_message_h& mmsMsg);
- static int GetEmailMessage(const EmailMessage& message, const RecipientList& recipientList, email_h& emailMsg);
+ static int GetMmsMessage(msg_struct_t& msgInfo, const MmsMessage& message, const RecipientList& recipientList);
+ static int PopulateMmsContent(const MmsMessage& message, msg_struct_t& msgData);
static Tizen::Base::DateTime ConvertTime(time_t* pTime);
- static SmsMessage* ConvertSmsMessageN(const SmsMessageBoxType& type, messages_message_h msg);
- static int AddMessageAddress(const RecipientList& recipientList, RecipientType type, messages_message_h& messageMsg, messages_recipient_type_e recipientType);
- static int AddEmailMessageAddress(const RecipientList& recipientList, RecipientType type, email_h& emailMsg, email_recipient_type_e recipientType);
+ static SmsMessage* ConvertSmsMessageN(const SmsMessageBoxType& type, msg_struct_t& msg);
+ static int AddMessageAddress(const RecipientList& recipientList, RecipientType type, msg_struct_t& messageMsg, _MSG_RECIPIENT_TYPE_E recipientType);
+ static result AddEmailMessageAddress(const RecipientList& recipientList, RecipientType type, email_mail_data_t *pMail);
+ static result SendEmail(const EmailMessage& message, const RecipientList& recipientList, int &mailboxId, int &requestId);
+ static result AddEmailMessageBody(email_mail_data_t *pMail, char * pBody);
+ static result AddEmailMessageAttachment(const EmailMessage& message, email_attachment_data_t ***pAttach, email_mail_data_t *pMail);
+ static result AddEmailCallBackToDbus(void);
+ static DBusHandlerResult EmailNetworkCallBack(DBusConnection* pConnection, DBusMessage* pMessage, void* pUserData);
+ static result EmailConvertException(int err);
private:
_MsgUtil(void);
//
/**
* @file FMsg_PushEventArg.h
- * @brief This is the header file for _PushEventArg class.
+ * @brief This is the header file for %_PushEventArg class.
* @version 3.0
*
- * This header file contains the declarations of _PushEventArg class.
+ * This header file contains the declarations of %_PushEventArg class.
*/
#ifndef _FMSG_INTERNAL_PUSH_EVENT_ARG_H_
result r = E_SUCCESS;
int ret = PUSH_ERROR_NONE;
push_connection_h pushHandle = null;
- String packageId;
+ PackageId packageId;
char* pPackageId = null;
SysTryReturnResult(NID_MSG, __pPushHandle == null, E_INVALID_STATE, "The __pPushHandle instance is already constructed.");
pRequestList.reset(new (std::nothrow) ArrayList());
SysTryCatch(NID_MSG, pRequestList != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- r = _AppInfo::GetAppId().SubString(0, 10, packageId);
- SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get a package ID.");
-
+ packageId = _AppInfo::GetPackageId();
SysLog(NID_MSG, "Package ID is [%ls].", packageId.GetPointer());
pPackageId = _StringConverter::CopyToCharArrayN(packageId);
int timeout = _MAX_TRANSACTION_TIMEOUT;
int length = 0;
String lengthAsString(L"");
- String packageId(L"");
+ PackageId packageId(L"");
String appSecret(L"");
r = uri.SetUri(url);
// Create Http Request Header
__pHeader = __pRequest->GetHeader();
- r = _AppInfo::GetAppId().SubString(0, 10, packageId);
- SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get a package ID.");
+ packageId = _AppInfo::GetPackageId();
appSecret = GetAppSecret();
}
PushAction pushAction = pushMessage.GetAction();
- if (pushAction == PUSH_ACTION_SILENT)
+ if (pushAction == PUSH_ACTION_ALERT)
+ {
+ action.Append("action=ALERT");
+ }
+ else if (pushAction == PUSH_ACTION_SILENT)
{
action.Append("action=SILENT");
}
{
action.Append("action=DISCARD");
}
+ else if (pushAction == PUSH_ACTION_LAUNCH)
+ {
+ action.Append("action=LAUNCH");
+ }
else
{
- action.Append("action=ALERT");
+ action.Append("action=SILENT");
}
String alertText1 = notificationMessage.GetAlertText();
ret = service_create(&svc);
SysTryReturnResult(NID_MSG, ret == SERVICE_ERROR_NONE, E_SYSTEM, "service_create() is failed[%d].", ret);
- // ToDo - Remove GetAppExecutableName().
- String appId;
- appId.Clear();
- appId.Append(_AppInfo::GetAppId());
- appId.Append(L".");
- appId.Append(_AppInfo::GetAppExecutableName());
+ AppId appId;
+ appId = _AppInfo::GetApplicationId();
pAppId = _StringConverter::CopyToCharArrayN(appId);
SysTryReturnResult(NID_MSG, pAppId != null, E_SYSTEM, "Failed to get the application ID.");
static const wchar_t _PUSH_MESSAGE_VALUE_ACTION_SILENT[] = L"SILENT";
static const wchar_t _PUSH_MESSAGE_VALUE_ACTION_DISCARD[] = L"DISCARD";
static const wchar_t _PUSH_MESSAGE_VALUE_ACTION_ALERT[] = L"ALERT";
+static const wchar_t _PUSH_MESSAGE_VALUE_ACTION_LAUNCH[] = L"LAUNCH";
+
namespace Tizen { namespace Messaging
{
_PushMessageImpl::SetAction(PushAction action)
{
result r = E_SUCCESS;
- SysTryReturn(NID_NET_SOCK, (action >= PUSH_ACTION_SILENT && action <= PUSH_ACTION_ALERT), r = E_INVALID_ARG, E_INVALID_ARG,
+ SysTryReturn(NID_NET_SOCK, (action >= PUSH_ACTION_SILENT && action <= PUSH_ACTION_LAUNCH), r = E_INVALID_ARG, E_INVALID_ARG,
"[E_INVALID_ARG] Invalid PushAction [%d] argument.", (int)action);
__pushAction = action;
}
else if (key.Equals(_PUSH_MESSAGE_KEY_ACTION, false) == true)
{
- if (value.Equals(_PUSH_MESSAGE_VALUE_ACTION_SILENT, false) == true)
+ if (value.Equals(_PUSH_MESSAGE_VALUE_ACTION_ALERT, false) == true)
+ {
+ __pushAction = PUSH_ACTION_ALERT;
+ }
+ else if (value.Equals(_PUSH_MESSAGE_VALUE_ACTION_SILENT, false) == true)
{
__pushAction = PUSH_ACTION_SILENT;
}
{
__pushAction = PUSH_ACTION_DISCARD;
}
- else if (value.Equals(_PUSH_MESSAGE_VALUE_ACTION_ALERT, false) == true)
+ else if (value.Equals(_PUSH_MESSAGE_VALUE_ACTION_LAUNCH, false) == true)
{
- __pushAction = PUSH_ACTION_ALERT;
+ __pushAction = PUSH_ACTION_LAUNCH;
}
else
{
*/
#include <FMsgISmsMessageEventListener.h>
+#include <FMsgISmsEventListener.h>
#include <FMsgISmsListener.h>
#include <FMsgICbsMessageEventListener.h>
#include <FMsgIWapPushEventListener.h>
IEventArg* pEventArg = const_cast <IEventArg*>(&arg);
_SmsEventArg* pSmsEventArg = dynamic_cast <_SmsEventArg*>(pEventArg);
- SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
+ SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_SYSTEM, "A failure occurred from the underlying system.");
SmsMessage message;
CbsMessage* pCbsMessage = null;
if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_SMS_SEND_RESULT)
{
pSmsListener = dynamic_cast <ISmsListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pSmsListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
+ SysTryReturnVoidResult(NID_MSG, pSmsListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
+ // set result
pSmsEventArg->GetErrorResult(r);
+
// Fire
pSmsListener->OnSmsMessageSent(r);
}
else if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_SMS_TRIGGER)
{
pSmsEventListener = dynamic_cast <ISmsEventListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pSmsEventListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
- r = message.SetText(pSmsEventArg->GetMessage());
- if (IsFailed(r))
- {
- SysLogException(NID_MSG, r, "[%s] occurred. Input text is [%ls] and its length is [%d].", GetErrorMessage(r), pSmsEventArg->GetMessage().GetPointer(), pSmsEventArg->GetMessage().GetLength());
- }
- dateTime = pSmsEventArg->GetDateTime();
+ SysTryReturnVoidResult(NID_MSG, pSmsEventListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
+ _SmsMessageImpl* pImpl = _SmsMessageImpl::GetInstance(message);
+ SysTryReturnVoidResult(NID_MSG, pImpl != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
+ // port
port = pSmsEventArg->GetPort();
+ // received time
+ dateTime = pSmsEventArg->GetDateTime();
+ // message
+ pImpl->SetIncomingMessage(pSmsEventArg->GetMessage(), pSmsEventArg->GetSenderAddress(), dateTime);
+
// Fire
pSmsEventListener->OnSmsMessageReceived(port, dateTime, message);
}
else if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_SMS_RECEIVE_RESULT)
{
pSmsMessageEventListener = dynamic_cast <ISmsMessageEventListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pSmsMessageEventListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
- _SmsMessageImpl::GetInstance(message)->SetIncomingMessage(pSmsEventArg->GetMessage(),
- pSmsEventArg->GetSenderAddress(), pSmsEventArg->GetDateTime());
+ SysTryReturnVoidResult(NID_MSG, pSmsMessageEventListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
+ _SmsMessageImpl* pImpl = _SmsMessageImpl::GetInstance(message);
+ SysTryReturnVoidResult(NID_MSG, pImpl != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
+ // set message
+ pImpl->SetIncomingMessage(pSmsEventArg->GetMessage(), pSmsEventArg->GetSenderAddress(), pSmsEventArg->GetDateTime());
+
// Fire
pSmsMessageEventListener->OnSmsMessageReceived(message);
}
else if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_CBS_RECEIVE_RESULT)
{
pCbsMessageEventListener = dynamic_cast <ICbsMessageEventListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pCbsMessageEventListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
- pCbsMessage = _CbsMessageImpl::GetCbsMessageN();
+ SysTryReturnVoidResult(NID_MSG, pCbsMessageEventListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
+ pCbsMessage = _CbsMessageImpl::GetCbsMessageN();
if (pCbsMessage)
{
- _CbsMessageImpl::GetInstance(*pCbsMessage)->SetCbsMessageImpl(pSmsEventArg->GetDateTime(), *(pSmsEventArg->GetSerialNumber()), pSmsEventArg->GetMessage(), pSmsEventArg->GetMessageId(), pSmsEventArg->GetEtwsNotification(), pSmsEventArg->GetDataCodingScheme());
+ _CbsMessageImpl::GetInstance(*pCbsMessage)->SetCbsMessageImpl(pSmsEventArg->GetDateTime(), *(pSmsEventArg->GetSerialNumber()), pSmsEventArg->GetMessage(), pSmsEventArg->GetMessageId(), pSmsEventArg->GetEtwsNotification(), pSmsEventArg->GetDataCodingScheme(), pSmsEventArg->GetCbsLanguageType());
}
+
// Fire
if (pCbsMessage)
{
else if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_WAP_PUSH_RECEIVE_RESULT)
{
pWapPushMessageEventListener = dynamic_cast <IWapPushEventListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pWapPushMessageEventListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
+ SysTryReturnVoidResult(NID_MSG, pWapPushMessageEventListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
+
pWapPushMessage = _WapPushMessageImpl::GetWapPushMessageN(pSmsEventArg->GetMessage(), *(pSmsEventArg->GetWapPushBody()));
// Fire
else if (pSmsEventArg->GetEventType() == _SMS_EVENT_TYPE_ETWS_RECEIVE_RESULT)
{
pEtwsNotificationMesssageEventListener = dynamic_cast <IEtwsPrimaryNotificationEventListener*>(&listener);
- SysTryReturnVoidResult(NID_MSG, pEtwsNotificationMesssageEventListener != null, E_SYSTEM, "[E_SYSTEM] A failure occurred from the underlying system.");
+ SysTryReturnVoidResult(NID_MSG, pEtwsNotificationMesssageEventListener != null, E_SYSTEM, "A failure occurred from the underlying system.");
pEtwsNotificationMessage = _EtwsPrimaryNotificationImpl::GetEtwsPrimaryNotificationN();
if (pEtwsNotificationMessage)
{
_SmsEventArg::_SmsEventArg(void)
+ : __result(E_SUCCESS)
+ , __port(-1)
+ , __eventType(_SMS_EVENT_TYPE_NONE)
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __pEtwsWarningType(null)
{
- __eventType = _SMS_EVENT_TYPE_NONE;
- __port = -1;
- __result = E_SUCCESS;
- __pPushMsgBody = null;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
}
_SmsEventArg::_SmsEventArg(const result r)
+ : __port(-1)
+ , __eventType(_SMS_EVENT_TYPE_SMS_SEND_RESULT)
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __pEtwsWarningType(null)
{
- __eventType = _SMS_EVENT_TYPE_SMS_SEND_RESULT;
- __port = -1;
- __pPushMsgBody = null;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
-
if (IsFailed(r))
{
__result = E_FAILURE;
}
else
{
- __result = r; // E_SUCCESS
+ __result = r; // E_SUCCESS
}
}
-_SmsEventArg::_SmsEventArg(int port, const DateTime& dateTime, const String& message)
+_SmsEventArg::_SmsEventArg(int port, const DateTime& dateTime, const String& message, const String& senderAddress)
+ : __result(E_UNKNOWN)
+ , __message(message)
+ , __port(port)
+ , __sender(senderAddress)
+ , __dateTime(dateTime)
+ , __eventType(_SMS_EVENT_TYPE_SMS_TRIGGER)
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __pEtwsWarningType(null)
{
- __eventType = _SMS_EVENT_TYPE_SMS_TRIGGER;
- __port = port;
- __dateTime = dateTime;
- __message = message;
- __result = E_UNKNOWN;
- __pPushMsgBody = null;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
}
_SmsEventArg::_SmsEventArg(const Tizen::Base::String& text, const Tizen::Base::String& senderAddress, const Tizen::Base::DateTime& receivedTime)
+ : __result(E_UNKNOWN)
+ , __message(text)
+ , __port(-1)
+ , __sender(senderAddress)
+ , __dateTime(receivedTime)
+ , __eventType(_SMS_EVENT_TYPE_SMS_RECEIVE_RESULT)
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __pEtwsWarningType(null)
{
- __eventType = _SMS_EVENT_TYPE_SMS_RECEIVE_RESULT;
- __port = -1;
- __sender = senderAddress;
- __dateTime = receivedTime;
- __message = text;
- __result = E_UNKNOWN;
- __pPushMsgBody = null;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
}
-_SmsEventArg::_SmsEventArg(const Tizen::Base::String& text, const Tizen::Base::ByteBuffer& msgSerialNumber, const Tizen::Base::DateTime& receivedTime, int messageId, bool isEtwsNotification, byte dataCodingScheme, _SmsEventType eventType)
+_SmsEventArg::_SmsEventArg(const Tizen::Base::String& text, const Tizen::Base::ByteBuffer& msgSerialNumber, const Tizen::Base::DateTime& receivedTime, int messageId, bool isEtwsNotification, byte dataCodingScheme, const Tizen::Base::String& languageType, _SmsEventType eventType)
+ : __result(E_UNKNOWN)
+ , __message(text)
+ , __port(-1)
+ , __dateTime(receivedTime)
+ , __eventType(eventType) //_SMS_EVENT_TYPE_CBS_RECEIVE_RESULT
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __messageId(messageId)
+ , __isEtwsNotification(isEtwsNotification)
+ , __pEtwsWarningType(null)
+ , __dataCodingScheme(dataCodingScheme)
+ , __cbslanguageType(languageType)
{
- __eventType = eventType; //_SMS_EVENT_TYPE_CBS_RECEIVE_RESULT
- __port = -1;
- __dateTime = receivedTime;
- __message = text;
- __result = E_UNKNOWN;
- __pPushMsgBody = null;
- __messageId = messageId;
- __isEtwsNotification = isEtwsNotification;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
- __dataCodingScheme = dataCodingScheme;
-
__pMsgSerialNumber = new (std::nothrow) ByteBuffer();
- SysTryReturnVoidResult(NID_MSG, __pMsgSerialNumber != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
+ SysTryReturnVoidResult(NID_MSG, __pMsgSerialNumber != null, E_OUT_OF_MEMORY, "memory allocation failed");
__pMsgSerialNumber->Construct(msgSerialNumber);
__pMsgSerialNumber->SetPosition(0);
}
_SmsEventArg::_SmsEventArg(const Tizen::Base::DateTime& receivedTime, const Tizen::Base::ByteBuffer& msgSerialNumber, const Tizen::Base::ByteBuffer& msgSecurityInfo, int messageId, const Tizen::Base::ByteBuffer& etwsWarningType, _SmsEventType eventType)
+ : __result(E_UNKNOWN)
+ , __port(-1)
+ , __dateTime(receivedTime)
+ , __eventType(eventType) //_SMS_EVENT_TYPE_ETWS_RECEIVE_RESULT
+ , __pPushMsgBody(null)
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __messageId(messageId)
+ , __pEtwsWarningType(null)
{
- __eventType = eventType; //_SMS_EVENT_TYPE_ETWS_RECEIVE_RESULT
- __port = -1;
- __dateTime = receivedTime;
- __result = E_UNKNOWN;
- __pPushMsgBody = null;
- __messageId = messageId;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
-
__pMsgSerialNumber = new (std::nothrow) ByteBuffer();
SysTryReturnVoidResult(NID_MSG, __pMsgSerialNumber != null, E_OUT_OF_MEMORY, "memory allocation failed");
}
_SmsEventArg::_SmsEventArg(const Tizen::Base::String& pushMsgHdr, const Tizen::Base::ByteBuffer& pushMsgBody, _SmsEventType eventType)
+ : __result(E_UNKNOWN)
+ , __message(pushMsgHdr)
+ , __port(-1)
+ , __eventType(eventType) //_SMS_EVENT_TYPE_WAP_PUSH_RECEIVE_RESULT
+ , __pMsgSerialNumber(null)
+ , __pMsgSecurityInfo(null)
+ , __pEtwsWarningType(null)
{
- __eventType = eventType; //_SMS_EVENT_TYPE_WAP_PUSH_RECEIVE_RESULT
- __port = -1;
- __message = pushMsgHdr;
- __result = E_UNKNOWN;
- __pMsgSerialNumber = null;
- __pMsgSecurityInfo = null;
- __pEtwsWarningType = null;
-
__pPushMsgBody = new (std::nothrow) ByteBuffer();
SysTryReturnVoidResult(NID_MSG, __pPushMsgBody != null, E_OUT_OF_MEMORY, "memory allocation failed");
String
_SmsEventArg::GetSenderAddress(void) const
{
- if (__eventType != _SMS_EVENT_TYPE_SMS_RECEIVE_RESULT)
- {
- return L"";
- }
-
return __sender;
}
return __dataCodingScheme;
}
+Tizen::Base::String
+_SmsEventArg::GetCbsLanguageType(void) const
+{
+ return __cbslanguageType;
+}
+
} }
/**
* This is the constructor.
*
- * @param[in] port - the port number
- * @param[in] dateTime - the received date time
- * @param[in] message - the received message
+ * @param[in] port The port number
+ * @param[in] dateTime The received date time
+ * @param[in] message The received message
+ * @param[in] senderAddress The sender address of the message
*/
- _SmsEventArg(int port, const Tizen::Base::DateTime& dateTime, const Tizen::Base::String& message);
+ _SmsEventArg(int port, const Tizen::Base::DateTime& dateTime, const Tizen::Base::String& message, const Tizen::Base::String& senderAddress);
/**
* This is the constructor.
* @param[in] isEtwsNotification The Etws Notification
* @param[in] eventType The received event type of the message
*/
- _SmsEventArg(const Tizen::Base::String& text, const Tizen::Base::ByteBuffer& msgSerialNumber, const Tizen::Base::DateTime& receivedTime, int messageId, bool isEtwsNotification, byte dataCodingScheme, _SmsEventType eventType);
+ _SmsEventArg(const Tizen::Base::String& text, const Tizen::Base::ByteBuffer& msgSerialNumber, const Tizen::Base::DateTime& receivedTime, int messageId, bool isEtwsNotification, byte dataCodingScheme, const Tizen::Base::String& languageType, _SmsEventType eventType);
/**
* This is the constructor.
Tizen::Base::ByteBuffer* GetWapPushBody(void) const;
+ /**
+ *
+ * Gets the language type of a CB message.
+ *
+ * @return The language type of a message
+ */
+ Tizen::Base::String GetCbsLanguageType(void) const;
+
private:
_SmsEventArg(const _SmsEventArg& eventArg);
_SmsEventArg& operator =(const _SmsEventArg& value);
bool __isEtwsNotification;
Tizen::Base::ByteBuffer* __pEtwsWarningType;
byte __dataCodingScheme;
+ Tizen::Base::String __cbslanguageType;
}; // _SmsEventArg
} }
// OAF headers
#include <unique_ptr.h>
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
#include <FMsgSmsManager.h>
#include <FBaseSysLog.h>
#include <FBase_StringConverter.h>
_SmsManagerImpl::~_SmsManagerImpl(void)
{
- int err = MESSAGES_ERROR_NONE;
if (__pSmsReceiveEvent)
{
if (_SmsMmsCallbackHandler::GetInstance())
{
- err = messages_cb_unset_incoming_cb(__msgHandle);
- err = messages_cb_unset_etws_primary_noti_cb(__msgHandle);
- err = _SmsMmsCallbackHandler::GetInstance()->CloseMessageHandle();
+ _SmsMmsCallbackHandler::GetInstance()->CloseMessageHandle();
+ _SmsMmsCallbackHandler::GetInstance()->CloseCbsSettingsHandle();
}
__isConstructed = false;
{
// method return code
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
SysAssertf(__isConstructed == false, "_SmsManagerImpl instance is already constructed.");
// check value of msg handle
SysTryReturnResult(NID_MSG, __msgHandle > 0, E_SYSTEM, "msgHandle is invalid.");
- // open CB message settings handle
+ // register sent status callback
+ err = _SmsMmsCallbackHandler::GetInstance()->RegisterMessageCallback();
+
+ r = ConvertException(err);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to register sms,mms callback.");
+
+ // open cbs message handle
err = _SmsMmsCallbackHandler::GetInstance()->OpenCbsSettingsHandle(__cbsSettingsHandle);
- SysLog(NID_MSG, "value of __cbsSettingsHandle is [%d]", __cbsSettingsHandle);
- if (err == MESSAGES_ERROR_NO_SIM_CARD)
+ if (err == MSG_ERR_NO_SIM)
{
r = E_SUCCESS;
SysLog(NID_MSG, "Sim card is not present in device"); // even no sim, return sucess so that app will launch sucess
SysTryReturnResult(NID_MSG, __cbsSettingsHandle > 0, E_SYSTEM, "cbsSettingsHandle is invalid.");
}
+ // load cbs settings
+ r = _SmsMmsCallbackHandler::GetInstance()->LoadCbsSettings();
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to load cbs message settings.");
+
__pSmsEvent = move(pSmsEvent);
__isConstructed = true;
result r = E_SUCCESS;
_SmsEvent* pSmsTriggerEvent = null;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
// check duplications
if (__pSmsTriggerEventList)
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to add a listener.", GetErrorMessage(r));
// Register SMS Trigger
- err = messages_set_message_incoming_cb(__msgHandle, &_SmsMmsCallbackHandler::IncomingSmsMessageCallback,(void*)pSmsTriggerEvent);
+ err = msg_reg_sms_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingSmsMessageCallback, port, (void*) pSmsTriggerEvent);
- if (err != MESSAGES_ERROR_NONE)
+ if (err != MSG_SUCCESS)
{
r = __pSmsTriggerEventList->Remove(*pSmsTriggerEvent);
r = E_SYSTEM;
- SysLogException(NID_MSG, r, "[%s] Failed to remove a listener.", GetErrorMessage(r));
-
- goto CATCH;
- }
-
- err = messages_add_sms_listening_port(__msgHandle, port);
-
- if (err != MESSAGES_ERROR_NONE)
- {
- r = __pSmsTriggerEventList->Remove(*pSmsTriggerEvent);
- r = E_SYSTEM;
- SysLogException(NID_MSG, r, "[%s] Failed to remove a listener.", GetErrorMessage(r));
+ SysLogException(NID_MSG, r, "[%s] Failed to register for incoming sms callback.", GetErrorMessage(r));
goto CATCH;
}
int index = -1;
int listSize = -1;
bool isFound = false;
- int err = MESSAGES_ERROR_NONE;
// find the SmsTriggerEvent using port
if (__pSmsTriggerEventList)
r = __pSmsTriggerEventList->RemoveAt(index, true);
SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to remove the event listener");
- err = messages_unset_message_incoming_cb(__msgHandle);
-
- r = ConvertException(err);
- SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to remove the event listener");
-
return r;
}
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
// set event
if (!__pSmsReceiveEvent)
r = __pSmsReceiveEvent->AddListener(eventListener, true);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "Failed to add a listener");
- err = messages_set_message_incoming_cb(__msgHandle, &_SmsMmsCallbackHandler::IncomingSmsMessageCallback, (void*)
+ err = msg_reg_sms_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingSmsMessageCallback, 0, (void*)
__pSmsReceiveEvent);
r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to add a listener.", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[%s] Failed to register for incoming sms callback.", GetErrorMessage(r));
+
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ _SmsMmsCallbackHandler::GetInstance()->SetInComingSmsCallback(true);
+ }
return E_SUCCESS;
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
SysTryReturnResult(NID_MSG, __pSmsReceiveEvent != NULL, E_OBJ_NOT_FOUND, "Failed to remove a listener");
r = __pSmsReceiveEvent->RemoveListener(eventListener);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to remove a listener..", GetErrorMessage(r));
- err = messages_unset_message_incoming_cb(__msgHandle);
-
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "Failed to remove the event listener");
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ _SmsMmsCallbackHandler::GetInstance()->SetInComingSmsCallback(false);
+ }
if (__pSmsReceiveEvent)
{
SysAssertf(__msgHandle > 0, "message handle is invalid.");
int msgCount = 0;
- int err = MESSAGES_ERROR_NONE;
- messages_message_box_e folderType = MESSAGES_MBOX_INBOX;
+ msg_struct_t countInfo = NULL;
+ int err = MSG_SUCCESS;
+ _MSG_FOLDER_ID_E folderType = MSG_ALLBOX_ID;
result r = E_SUCCESS;
ClearLastResult();
switch (type)
{
case SMS_MESSAGE_BOX_TYPE_INBOX:
- folderType = MESSAGES_MBOX_INBOX;
+ folderType = MSG_INBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_SENTBOX:
- folderType = MESSAGES_MBOX_SENTBOX;
+ folderType = MSG_SENTBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_OUTBOX:
- folderType = MESSAGES_MBOX_OUTBOX;
+ folderType = MSG_OUTBOX_ID;
break;
case SMS_MESSAGE_BOX_TYPE_ALL:
- folderType = MESSAGES_MBOX_ALL;
+ {
+ err = msg_count_msg_by_type(__msgHandle, MSG_TYPE_SMS, &msgCount);
+
+ if (err != MSG_SUCCESS)
+ {
+ r = ConvertException(err);
+ SysLogException(NID_MSG, r, "[%s] Failed to get the message count", GetErrorMessage(r));
+ SetLastResult(r);
+ return -1;
+ }
+
+ SysLog(NID_MSG, "Total count of messages is [%d]", msgCount);
+ return msgCount;
+ }
break;
case SMS_MESSAGE_BOX_TYPE_NONE: // impossible case
break;
break;
}
- // get the count of corresponding message box
- err = messages_get_message_count(__msgHandle, folderType, MESSAGES_TYPE_SMS, &msgCount);
- if (err != MESSAGES_ERROR_NONE)
+ // get the count of corresponding message box
+ countInfo = msg_create_struct(MSG_STRUCT_COUNT_INFO);
+ err = msg_count_message(__msgHandle, folderType, countInfo);
+
+ if (err != MSG_SUCCESS)
{
r = ConvertException(err);
SysLogException(NID_MSG, r, "[%s] Failed to get the message count of the message box (%d)", GetErrorMessage(r), (int) type);
+ msg_release_struct(&countInfo);
SetLastResult(r);
return -1;
}
+
+ msg_get_int_value(countInfo, MSG_COUNT_INFO_SMS_INT, &msgCount);
+ msg_release_struct(&countInfo);
SysLog(NID_MSG, "Total count of messages is [%d]", msgCount);
return msgCount;
char* pSearchString = NULL;
char* pSenderAddressTemp = NULL;
ArrayList* pList = null;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
- messages_message_h* pMsgList = null;
- int searchCount = 0;
- int totalCount = 0;
+ msg_struct_list_s msgList;
+ msg_struct_t searchCon = NULL;
ClearLastResult();
r = pList->Construct();
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "Failed to construct an ArrayList");
+ // Set Condition
+ searchCon = msg_create_struct(MSG_STRUCT_SEARCH_CONDITION);
+ msg_set_int_value(searchCon, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_INBOX_ID);
+ msg_set_int_value(searchCon, MSG_SEARCH_CONDITION_MSGTYPE_INT, MSG_TYPE_SMS);
+
// keyword
if (pKeyword)
{
pSearchString = _StringConverter::CopyToCharArrayN(*pKeyword);
+ SysTryCatch(NID_MSG, pSearchString != null, r = E_OUT_OF_MEMORY, r, "Memory allocation failed.");
+ msg_set_str_value(searchCon, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, pSearchString, strlen(pSearchString));
}
// sender address
if (pSenderAddress)
{
pSenderAddressTemp = _StringConverter::CopyToCharArrayN(*pSenderAddress);
+ SysTryCatch(NID_MSG, pSenderAddressTemp != null, r = E_OUT_OF_MEMORY, r, "Memory allocation failed.");
+ msg_set_str_value(searchCon, MSG_SEARCH_CONDITION_ADDRESS_VALUE_STR, pSenderAddressTemp, strlen(pSenderAddressTemp));
}
- // searching
- err = messages_search_message(__msgHandle, MESSAGES_MBOX_INBOX, MESSAGES_TYPE_SMS,
- pSearchString, pSenderAddressTemp, startIndex, count,
- &pMsgList, &searchCount, &totalCount);
+ // Search
+ err = msg_search_message(__msgHandle, searchCon, startIndex, count, &msgList);
r = ConvertException(err);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] msg_search_message call failed.", GetErrorMessage(r));
- totalResultCount = searchCount;
+ totalResultCount = msgList.nCount;
SysLog(NID_MSG, "Total Search count of messages is [%d]", totalResultCount);
- for (int index = 0; index < searchCount; index++)
+ for (int index = 0; index < totalResultCount; index++)
{
// get SmsMessage instance
- SmsMessage* pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_INBOX, pMsgList[index]);
+ SmsMessage* pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_INBOX, msgList.msg_struct_info[index]);
// add to the list
pList->Add(*pSmsMessage);
}
pSenderAddressTemp = NULL;
}
- messages_free_message_array(pMsgList);
+ msg_release_struct(&searchCon);
+ msg_release_list_struct(&msgList);
return pList;
pList = null;
}
- messages_free_message_array(pMsgList);
+ msg_release_struct(&searchCon);
+ msg_release_list_struct(&msgList);
return null;
}
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
char* pSearchString = NULL;
- messages_message_box_e folderId = MESSAGES_MBOX_ALL;
+ int folderId = MSG_ALLBOX_ID;
ArrayList* pList = NULL;
- messages_message_h* pMsgList = null;
- int searchCount = 0;
- int totalCount = 0;
+ msg_struct_list_s msgList;
+ msg_struct_t searchCon = NULL;
ClearLastResult();
// type
folderId = _MsgUtil::GetMsgFolderId(type);
+ // Set Condition
+ searchCon = msg_create_struct(MSG_STRUCT_SEARCH_CONDITION);
+ msg_set_int_value(searchCon, MSG_SEARCH_CONDITION_FOLDERID_INT, folderId);
+ msg_set_int_value(searchCon, MSG_SEARCH_CONDITION_MSGTYPE_INT, MSG_TYPE_SMS);
+
// keyword
if (pKeyword)
{
pSearchString = _StringConverter::CopyToCharArrayN(*pKeyword);
+ SysTryCatch(NID_MSG, pSearchString != null, r = E_OUT_OF_MEMORY, r, "Memory allocation failed.");
+ msg_set_str_value(searchCon, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, pSearchString, strlen(pSearchString));
}
- // searching
- err = messages_search_message(__msgHandle, folderId, MESSAGES_TYPE_SMS, pSearchString, null,
- startIndex, count, &pMsgList, &searchCount, &totalCount);
+ // Search
+ err = msg_search_message(__msgHandle, searchCon, startIndex, count, &msgList);
r = ConvertException(err);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] msg_search_message call failed.", GetErrorMessage(r));
- totalResultCount = searchCount;
+ totalResultCount = msgList.nCount;
SysLog(NID_MSG, "Total Search count of messages is [%d]", totalResultCount);
- for (int index = 0; index < searchCount; index++)
+ for (int index = 0; index < totalResultCount; index++)
{
SmsMessage* pSmsMessage = null;
if (type == SMS_MESSAGE_BOX_TYPE_ALL)
{
- messages_get_mbox_type(pMsgList[index], &folderId);
+ err = msg_get_int_value(msgList.msg_struct_info[index], MSG_MESSAGE_FOLDER_ID_INT, &folderId);
switch (folderId)
{
- case MESSAGES_MBOX_INBOX:
- pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_INBOX, pMsgList[index]);
+ case MSG_INBOX_ID:
+ pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_INBOX, msgList.msg_struct_info[index]);
break;
- case MESSAGES_MBOX_OUTBOX:
- pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_OUTBOX, pMsgList[index]);
+ case MSG_OUTBOX_ID:
+ pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_OUTBOX, msgList.msg_struct_info[index]);
break;
- case MESSAGES_MBOX_SENTBOX:
- pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, pMsgList[index]);
+ case MSG_SENTBOX_ID:
+ pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, msgList.msg_struct_info[index]);
break;
- case MESSAGES_MBOX_DRAFT :
- //pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, pMsgList[index]);
+ case MSG_DRAFT_ID:
+ //pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, msgList.msg_struct_info[index]);
break;
- case MESSAGES_MBOX_ALL:
- //pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, msgList[index]);
+ case MSG_ALLBOX_ID:
+ //pSmsMessage = _MsgUtil::ConvertSmsMessageN(SMS_MESSAGE_BOX_TYPE_SENTBOX, msgList.msg_struct_info[index]);
break;
}
}
else
{
- pSmsMessage = _MsgUtil::ConvertSmsMessageN(type, pMsgList[index]);
+ pSmsMessage = _MsgUtil::ConvertSmsMessageN(type, msgList.msg_struct_info[index]);
pList->Add(*pSmsMessage);
}
}
pSearchString = NULL;
}
- messages_free_message_array(pMsgList);
+ msg_release_struct(&searchCon);
+ msg_release_list_struct(&msgList);
return pList;
pSearchString = NULL;
}
- messages_free_message_array(pMsgList);
+ msg_release_struct(&searchCon);
+ msg_release_list_struct(&msgList);
return null;
}
result r = E_SUCCESS;
String fullText;
- messages_message_h msg = {0};
- int err = MESSAGES_ERROR_NONE;
-
- char* pOriginalText = null;
- char* pBodyText = null;
+ msg_struct_t smsMsg = null;
+ msg_struct_t sendOpt = null;
+ int err = MSG_SUCCESS;
+ char msgText[MAX_MSG_TEXT_LEN];
ClearLastResult();
// get SMS message
- err = messages_search_message_by_id(__msgHandle, messageId, &msg);
+ smsMsg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+ sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+ err = msg_get_message(__msgHandle, messageId, smsMsg, sendOpt);
r = ConvertException(err);
SetLastResult(r);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] messages_search_message_by_id call failed.", GetErrorMessage(r));
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] msg_get_message by messageid failed.", GetErrorMessage(r));
// get text
- messages_get_text(msg, &pOriginalText);
- SysTryCatch(NID_MSG, pOriginalText != null, r = E_SYSTEM, r, "sms get message body failed");
-
- // convert to const char* type
- pBodyText = const_cast<char*>(pOriginalText);
+ err = msg_get_str_value(smsMsg, MSG_MESSAGE_SMS_DATA_STR, msgText, MAX_MSG_TEXT_LEN);
+ SysTryCatch(NID_MSG, err == MSG_SUCCESS, r = E_SYSTEM, r, "sms get message body failed");
- // convert to SmsMessage type
- fullText = String(pBodyText);
+ fullText = msgText;
SysLog(NID_MSG, "Returned Full Text : [%ls]", fullText.GetPointer());
- free(pOriginalText);
- pOriginalText = null;
- pBodyText = null;
-
- messages_destroy_message(msg);
+ msg_release_struct(&sendOpt);
+ msg_release_struct(&smsMsg);
return fullText;
CATCH:
- messages_destroy_message(msg);
+ msg_release_struct(&sendOpt);
+ msg_release_struct(&smsMsg);
return L"";
}
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- messages_message_h smsMsg = {0};
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
+ int msgReqId = -1;
bool saveMsgToSentbox = saveToSentbox;
SysLog(NID_MSG, "sending an sms message");
- err = _MsgUtil::GetSmsMessage(message, recipientList, smsMsg);
+ msg_struct_t msgReq = msg_create_struct(MSG_STRUCT_REQUEST_INFO);
+ msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);;
+ msg_struct_t msgSendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_SETTING_BOOL, true);
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_DELIVER_REQ_BOOL, false);
+ msg_set_bool_value(msgSendOpt, MSG_SEND_OPT_KEEPCOPY_BOOL, saveMsgToSentbox);
- if (err == MESSAGES_ERROR_NONE)
+ err = _MsgUtil::GetSmsMessage(msgInfo, message, recipientList);
+
+ r = ConvertException(err);
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to generate the SMS message.", GetErrorMessage(r));
+
+ msg_set_struct_handle(msgReq, MSG_REQUEST_MESSAGE_HND, msgInfo);
+ msg_set_struct_handle(msgReq, MSG_REQUEST_SENDOPT_HND, msgSendOpt);
+
+ if (err == MSG_SUCCESS)
{
- err = messages_send_message(__msgHandle, smsMsg, saveMsgToSentbox,
- &_SmsMmsCallbackHandler::SentSmsMessageStatusCallback, (void*) (__pSmsEvent.get()));
+ err = msg_sms_send_message(__msgHandle, msgReq);
}
r = ConvertException(err);
+ if (r == E_SUCCESS)
+ {
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ msg_get_int_value(msgReq, MSG_REQUEST_REQUESTID_INT, &msgReqId);
+ r = _SmsMmsCallbackHandler::GetInstance()->AddToMessageMap(msgReqId, _MSG_SMS, __pSmsEvent.get());
+ }
+ else
+ {
+ r = E_SYSTEM;
+ }
+ }
+
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to send the SMS message.", GetErrorMessage(r));
//release message
- messages_destroy_message(smsMsg);
+ msg_release_struct(&msgReq);
SysLog(NID_MSG, "sending an sms message success");
return r;
CATCH:
//release message
- messages_destroy_message(smsMsg);
+ msg_release_struct(&msgReq);
return r;
}
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
if (!pListener)
{
r = __pCbsReceiveEvent->AddListener(*__pCbsListener, true);
SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Failed to add cbs listner");
- err = messages_cb_set_incoming_cb(__msgHandle, __isCbsSaveEnabled,
- &_SmsMmsCallbackHandler::IncomingCbsMessageCallback, (void*) __pCbsReceiveEvent);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "Failed to set cbs incoming callback");
+ err = msg_reg_cb_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingCbsMessageCallback, __isCbsSaveEnabled, null);
+ r = ConvertException(err);
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Failed to set cbs incoming callback");
+
+ if (r == E_SUCCESS)
+ {
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ _SmsMmsCallbackHandler::GetInstance()->SetCbsAndEtwsUserEvent(_MSG_CBS, __pCbsReceiveEvent);
+ }
+ else
+ {
+ r = E_SYSTEM;
+ }
+ }
return r;
SysAssertf(__msgHandle > 0, "message handle is invalid.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
if (!pListener)
{
r = __pEtwsReceiveEvent->AddListener(*__pEtwsListener, true);
SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "Failed to add an etws primary notification event listener.");
- err = messages_cb_set_etws_primary_noti_cb(__msgHandle, &_SmsMmsCallbackHandler::IncomingEtwsMessageCallback, (void*)__pEtwsReceiveEvent);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM,
- "Failed to add an etws primary notification event listener.");
+ err = msg_reg_cb_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingCbsMessageCallback, __isCbsSaveEnabled, null);
+ r = ConvertException(err);
+ SysTryCatch(NID_MSG, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM,"Failed to add an etws primary notification event listener.");
+
+ if (r == E_SUCCESS)
+ {
+ if (_SmsMmsCallbackHandler::GetInstance())
+ {
+ _SmsMmsCallbackHandler::GetInstance()->SetCbsAndEtwsUserEvent(_MSG_ETWS, __pEtwsReceiveEvent);
+ }
+ else
+ {
+ r = E_SYSTEM;
+ }
+ }
return r;
SysAssertf(__msgHandle > 0, "message handle is invalid.");
SysTryReturnResult(NID_MSG, __cbsSettingsHandle != NULL, E_SYSTEM, "Cb handle is null");
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
- err = messages_cb_set_incoming_cb(__msgHandle, enable,
- &_SmsMmsCallbackHandler::IncomingCbsMessageCallback, (void*)__pCbsReceiveEvent);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, E_SYSTEM, "Failed to set SavingToCbsBoxEnabled option.");
+ err = msg_reg_cb_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingCbsMessageCallback, enable, null);
+ SysTryReturnResult(NID_MSG, err == MSG_SUCCESS, E_SYSTEM, "Failed to set SavingToCbsBoxEnabled option.");
__isCbsSaveEnabled = enable;
SysTryReturn(NID_MSG, __cbsSettingsHandle != NULL, false, E_SYSTEM, "Cb handle is null");
bool isCbsEnabled = false;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
- err = messages_cb_settings_is_enabled(__cbsSettingsHandle, &isCbsEnabled);
- SysTryReturn(NID_MSG, err == MESSAGES_ERROR_NONE, false, E_SYSTEM, "Failed to set SavingToCbsBoxEnabled option.");
+ err = msg_get_bool_value(__cbsSettingsHandle, MSG_CB_RECEIVE_BOOL, &isCbsEnabled);
+ SysTryReturn(NID_MSG, err == MSG_SUCCESS, false, E_SYSTEM, "Failed to set SavingToCbsBoxEnabled option.");
return isCbsEnabled;
}
SysAssertf(__msgHandle > 0, "message handle is invalid.");
SysTryReturnResult(NID_MSG, __cbsSettingsHandle != NULL, E_SYSTEM, "Cb handle is null");
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
+ result r = E_SUCCESS;
- err = messages_cb_settings_set_enabled(__cbsSettingsHandle, enable);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, E_SYSTEM, "Failed to set cbs enabled.");
+ err = msg_set_bool_value(__cbsSettingsHandle, MSG_CB_RECEIVE_BOOL, enable);
+ SysTryReturnResult(NID_MSG, err == MSG_SUCCESS, E_SYSTEM, "Failed to set cbs enabled.");
- err = messages_cb_save_settings(__msgHandle, __cbsSettingsHandle);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, E_SYSTEM, "Failed to save cbs settings.");
+ r = _SmsMmsCallbackHandler::GetInstance()->SaveCbsSettings();
+ SysTryReturnResult(NID_MSG, r == E_SUCCESS, E_SYSTEM, "Failed to save cbs settings.");
return E_SUCCESS;
}
SysTryReturnResult(NID_MSG, __cbsSettingsHandle != NULL, E_SYSTEM, "Cb handle is null");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
- messages_cb_channel_h cbsChannel = {0};
- std::unique_ptr<char[]> pChannelName;
+ int count = 0;
- // create a channel
- err = messages_cb_create_channel(&cbsChannel);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, E_SYSTEM, "Failed to create a channel.");
+ r = _SmsMmsCallbackHandler::GetInstance()->GetCbsChannelsCount(count);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to get CB Channel count.");
- // set channel ids
- err = messages_cb_channel_set_id(cbsChannel, from, to);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to set channel ids.");
-
- // set channel name
- pChannelName.reset(_StringConverter::CopyToCharArrayN(name));
- SysTryCatch(NID_MSG, pChannelName != null, r = E_OUT_OF_MEMORY, r, "Memory allocation failed.");
-
- err = messages_cb_channel_set_name(cbsChannel, pChannelName.get());
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to set channel name.");
-
- // activate
- err = messages_cb_channel_set_activated(cbsChannel, activate);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to activate the channel.");
+ if (CB_CHANNEL_MAX <= count)
+ {
+ return E_ALREADY_SET;
+ }
// add channel
- err = messages_cb_settings_add_channel(__cbsSettingsHandle, cbsChannel);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to add the channel.");
-
- // save the setting
- err = messages_cb_save_settings(__msgHandle, __cbsSettingsHandle);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to save the setting.");
-
- // destroy the channel
- err = messages_cb_destroy_channel(cbsChannel);
- SysTryCatch(NID_MSG, err == MESSAGES_ERROR_NONE, r = ConvertException(err), r, "Failed to destroy the channel.");
+ r = _SmsMmsCallbackHandler::GetInstance()->AddCbsChannel(from, to, name, activate);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to add a CB Channel.");
return r;
-
-CATCH:
- messages_cb_settings_remove_channel(__cbsSettingsHandle, cbsChannel);
- messages_cb_save_settings(__msgHandle, __cbsSettingsHandle);
- messages_cb_destroy_channel(cbsChannel);
- return r;
}
result
SysTryReturnResult(NID_MSG, __cbsSettingsHandle != NULL, E_SYSTEM, "Cb handle is null");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
- int cbChannelCount = 0;
- int fromId = 0;
- int toId = 0;
- bool channelFound = false;
- messages_cb_channel_h cbsChannel = {0};
-
- err = messages_cb_settings_get_channel_count(__cbsSettingsHandle, &cbChannelCount);
- r = ConvertException(err);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, r, "Failed to get channel count.");
-
- for (int index = 0; index < cbChannelCount; index++)
- {
- if ((err = messages_cb_settings_get_channel(__cbsSettingsHandle, index, &cbsChannel)) == MESSAGES_ERROR_NONE)
- {
- if ((err = messages_cb_channel_get_id(cbsChannel, &fromId, &toId)) == MESSAGES_ERROR_NONE)
- {
- if (from == fromId && to == toId)
- {
- channelFound = true;
- break; // found channel to be removed.
- }
- }
- }
- }
-
- SysTryReturnResult(NID_MSG, channelFound, E_OBJ_NOT_FOUND, "channel not found");
// remove channel
- err = messages_cb_settings_remove_channel(__cbsSettingsHandle, cbsChannel);
- r = ConvertException(err);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, r, "Failed to remove the channel. (from:%d, to:%d)", from, to);
-
- // destroy channel
- err = messages_cb_destroy_channel(cbsChannel);
- r = ConvertException(err);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, r, "Failed to destroy the channel.");
-
- // save the status
- err = messages_cb_save_settings(__msgHandle, __cbsSettingsHandle);
- r = ConvertException(err);
- SysTryReturnResult(NID_MSG, err == MESSAGES_ERROR_NONE, r, "Failed to save the setting.");
+ r = _SmsMmsCallbackHandler::GetInstance()->RemoveCbsChannel(from, to);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, r, r, "Failed to remove a CB Channel.");
return r;
}
SysTryReturn(NID_MSG, __cbsSettingsHandle != null, null, E_SYSTEM, "Cb handle is null.");
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
- int cbChannelCount = 0;
int fromId = 0;
int toId = 0;
- bool channelFound = false;
- char* pTempChannelName = null;
- std::unique_ptr<char> pChannelName;
- messages_cb_channel_h cbsChannel = {0};
+ int index = 0;
+ bool isActive = false;
+ String channelName;
std::unique_ptr<CbsChannel> pCbsChannel;
ClearLastResult();
- err = messages_cb_settings_get_channel_count(__cbsSettingsHandle, &cbChannelCount);
- r = ConvertException(err);
- SysTryReturn(NID_MSG, err == MESSAGES_ERROR_NONE, null, r, "Failed to get channel count.");
-
- for (int index = 0; index < cbChannelCount; index++)
- {
- if ((err = messages_cb_settings_get_channel(__cbsSettingsHandle, index, &cbsChannel)) == MESSAGES_ERROR_NONE)
- {
- if ((err = messages_cb_channel_get_id(cbsChannel, &fromId, &toId)) == MESSAGES_ERROR_NONE)
- {
- if (from == fromId && to == toId)
- {
- channelFound = true;
- break; // found channel.
- }
- }
- }
- }
-
- SysTryReturn(NID_MSG, channelFound, null, E_OBJ_NOT_FOUND, "Failed to find the cb channel");
-
- err = messages_cb_channel_get_name(cbsChannel, &pTempChannelName);
- r = ConvertException(err);
- SysTryReturn(NID_MSG, err == MESSAGES_ERROR_NONE, null, r, "Failed to get the channel name.");
- SysTryReturn(NID_MSG, pTempChannelName != null, null, r, "Failed to get the channel name.");
- pChannelName.reset(pTempChannelName);
+ // search channel
+ r = _SmsMmsCallbackHandler::GetInstance()->SearchCbsChannel(from, to, index);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, null, r, "Failed to find the cb channel.");
// get channel
- pCbsChannel.reset(_CbsChannelImpl::GetCbsChannelN(from, to, String(pChannelName.release())));
- SysTryReturn(NID_MSG, pCbsChannel != null, null, r, "Failed to get the channel.");
+ r = _SmsMmsCallbackHandler::GetInstance()->GetCbsChannel(index, fromId, toId, channelName, isActive);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, null, r, "Failed to get the cb channel.");
- // set cbs handle
- _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelHandle(cbsChannel);
+ // creates channel
+ pCbsChannel.reset(_CbsChannelImpl::GetCbsChannelN(fromId, toId, channelName));
+
+ if (isActive)
+ {
+ pCbsChannel->Activate();
+ }
return pCbsChannel.release();
}
result r = E_SUCCESS;
unique_ptr<ArrayList, AllElementsDeleter> pList;
- int err = MESSAGES_ERROR_NONE;
int cbChannelCount = 0;
int fromId = 0;
int toId = 0;
- unique_ptr<char> pChannelName;
- char* pTempChannelName = null;
- messages_cb_channel_h cbsChannel = {0};
+ bool isActive = false;
+ String channelName;
std::unique_ptr<CbsChannel> pCbsChannel;
ClearLastResult();
r = pList->Construct();
SysTryReturn(NID_MSG, r == E_SUCCESS, null, r, "Failed to construct array list.");
- err = messages_cb_settings_get_channel_count(__cbsSettingsHandle, &cbChannelCount);
- SysTryReturn(NID_MSG, r == E_SUCCESS, null, r, "Failed to get channel count.");
+ r = _SmsMmsCallbackHandler::GetInstance()->GetCbsChannelsCount(cbChannelCount);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, null, r, "Failed to get CB Channel count.");
for (int index = 0; index < cbChannelCount; index++)
{
- if ((err = messages_cb_settings_get_channel(__cbsSettingsHandle, index, &cbsChannel)) == MESSAGES_ERROR_NONE)
+ // get channel
+ r = _SmsMmsCallbackHandler::GetInstance()->GetCbsChannel(index, fromId, toId, channelName, isActive);
+ SysTryReturn(NID_MSG, r == E_SUCCESS, null, r , "Failed to get the cb channel.");
+
+ pCbsChannel.reset(_CbsChannelImpl::GetCbsChannelN(fromId, toId, channelName));
+ if (pCbsChannel && isActive)
{
- if ((err = messages_cb_channel_get_id(cbsChannel, &fromId, &toId)) == MESSAGES_ERROR_NONE)
- {
- if ((err = messages_cb_channel_get_name(cbsChannel, &pTempChannelName)) == MESSAGES_ERROR_NONE)
- {
- if (pTempChannelName)
- {
- pChannelName.reset(pTempChannelName);
- pCbsChannel.reset(_CbsChannelImpl::GetCbsChannelN(fromId, toId, String(pChannelName.release())));
- }
-
- if (pCbsChannel)
- {
- _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelHandle(cbsChannel);
- // add to the list
- pList->Add(*pCbsChannel);
- }
- }
- }
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelState(isActive);
+ // add to the list
+ pList->Add(*pCbsChannel);
}
}
- SysTryReturn(NID_MSG, err == MESSAGES_ERROR_NONE, null, E_SYSTEM, "Failed to GetCbsChannelListN.");
-
return pList.release();
}
switch (err)
{
- case MESSAGES_ERROR_NONE:
+ case MSG_SUCCESS:
r = E_SUCCESS;
break;
- case MESSAGES_ERROR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_MESSAGE:
+ case MSG_ERR_NULL_POINTER:
+ case MSG_ERR_NULL_MESSAGE:
r = E_INVALID_ARG;
break;
- case MESSAGES_ERROR_NO_DATA:
- r = E_OBJ_NOT_FOUND;
- break;
-
- case MESSAGES_ERROR_OUT_OF_MEMORY:
+ case MSG_ERR_MEMORY_ERROR:
r = E_OUT_OF_MEMORY;
break;
- case MESSAGES_ERROR_SERVER_NOT_READY: // Communication error between client and server
- case MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED:
+ case MSG_ERR_SERVER_NOT_READY:
+ case MSG_ERR_TRANSPORT_ERROR:
+ case MSG_ERR_COMMUNICATION_ERROR:
r = E_NETWORK_UNAVAILABLE;
break;
- case MESSAGES_ERROR_NO_SIM_CARD:
+ case MSG_ERR_NO_SIM:
r = E_DEVICE_UNAVAILABLE;
break;
- case MESSAGES_ERROR_OUT_OF_RANGE:
- r = E_ALREADY_SET;
- break;
-
- case MESSAGES_ERROR_SENDING_FAILED:
- case MESSAGES_ERROR_OPERATION_FAILED:
+ case MSG_ERR_PLUGIN_TAPI_FAILED:
r = E_FAILURE;
break;
* @exception E_INVALID_ARG The specified @c to parameter is smaller than @c from. @n
* The specified @c to or @c from parameter is a negative value. @n
* The specified @c to parameter exceeds the limit (0xFFFF). @n
- * The range (@c to - @c from) exceeds the limit (900).
+ * The range (@c to - @c from) exceeds the limit (0xFFFF).
* The specified @c name string length is greater than @c 32. @n
* @exception E_ALREADY_SET The channel range (@c from ~ @c to) is already set.
* @exception E_ILLEGAL_ACCESS The application does not have the permission to add the CBS channel.
* @exception E_INVALID_ARG The specified @c to parameter is smaller than @c from. @n
* The specified @c to or @c from parameter is a negative value. @n
* The specified @c to parameter exceeds the limit (0xFFFF). @n
- * The range (@c to - @c from) exceeds the limit (900).
+ * The range (@c to - @c from) exceeds the limit (0xFFFF).
* @exception E_OBJ_NOT_FOUND The channel range (@c from ~ @c to) is not found.
* @exception E_ILLEGAL_ACCESS The application does not have the permission to remove the CBS channel.
* @exception E_SYSTEM A system error has occurred.
* @exception E_INVALID_ARG The specified @c to parameter is smaller than @c from. @n
* The specified @c to or @c from parameter is a negative value. @n
* The specified @c to parameter exceeds the limit (0xFFFF). @n
- * The range (@c to - @c from) exceeds the limit (900).
+ * The range (@c to - @c from) exceeds the limit (0xFFFF).
* @exception E_SYSTEM A system error has occurred.
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see AddCbsChannel(), RemoveCbsChannel()
_SmsEvent* __pCbsReceiveEvent;
_SmsEvent* __pEtwsReceiveEvent;
Tizen::Base::Collection::ArrayList* __pSmsTriggerEventList;
- messages_service_h __msgHandle;
- messages_cb_settings_h __cbsSettingsHandle;
+ msg_handle_t __msgHandle;
+ msg_struct_t __cbsSettingsHandle;
ICbsMessageEventListener* __pCbsListener;
IEtwsPrimaryNotificationEventListener* __pEtwsListener;
}; // _SmsManagerImpl
* This file contains the implementation of the %_SmsMmsCallbackHandler class.
*/
-#include <messages.h>
-#include <email.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <dbus/dbus.h>
+#include <email-api.h>
+#include <FMsgSmsManager.h>
#include <FBaseInteger.h>
#include <FBaseSysLog.h>
#include <FMsgEtwsPrimaryNotification.h>
+#include <FBase_StringConverter.h>
#include "FMsg_SmsEvent.h"
#include "FMsg_SmsEventArg.h"
#include "FMsg_MmsEvent.h"
#include "FMsg_MmsEventArg.h"
#include "FMsg_MsgUtil.h"
#include "FMsg_SmsMmsCallbackHandler.h"
+#include "FMsg_CbsChannelImpl.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
_SmsMmsCallbackHandler::_SmsMmsCallbackHandler(void)
: __msgHandle(0)
, __cbsSettingsHandle(0)
+ , __pCbsChannelList(0)
+ , __pTempCbsChannelList(0)
+ , __callbackRegistered(false)
+ , __incomingSmsCallbackRegistered(true)
+ , __pCbsUserEvent(null)
+ , __pEtwsUserEvent(null)
{
+}
+
+result
+_SmsMmsCallbackHandler::Construct()
+{
+ result r = E_SUCCESS;
+
+ r = __messageMap.Construct();
+ if (r == E_SUCCESS)
+ {
+ r = __msgMutex.Create();
+ }
+
+ return r;
}
_SmsMmsCallbackHandler::~_SmsMmsCallbackHandler(void)
{
if (__msgHandle)
{
- messages_close_service(__msgHandle);
+ msg_close_msg_handle(&__msgHandle);
__msgHandle = 0;
}
+ if (__messageMap.GetCount())
+ {
+ __messageMap.RemoveAll(true);
+ }
+
+ if (__cbsSettingsHandle)
+ {
+ msg_release_struct(&__cbsSettingsHandle);
+ __cbsSettingsHandle = 0;
+ }
+
+ if (__pTempCbsChannelList)
+ {
+ if (__pTempCbsChannelList->GetCount() > 0)
+ {
+ __pTempCbsChannelList->RemoveAll(true);
+ }
+ delete __pTempCbsChannelList;
+ __pTempCbsChannelList = null;
+ }
}
_SmsMmsCallbackHandler*
_SmsMmsCallbackHandler::GetInstance(void)
{
+ result r = E_SUCCESS;
+
if (!__pMessageCallbackHandler)
{
__pMessageCallbackHandler = new (std::nothrow) _SmsMmsCallbackHandler();
+ SysTryReturn(NID_MSG, __pMessageCallbackHandler != NULL, null, E_SYSTEM, "failed to create instance");
+
+ if (__pMessageCallbackHandler)
+ {
+ r = __pMessageCallbackHandler->Construct();
+
+ if (r != E_SUCCESS)
+ {
+ delete __pMessageCallbackHandler;
+ __pMessageCallbackHandler = 0;
+ }
+ }
}
return __pMessageCallbackHandler;
}
int
-_SmsMmsCallbackHandler::OpenMessageHandle(messages_service_h& messageHandle)
+_SmsMmsCallbackHandler::OpenMessageHandle(msg_handle_t& messageHandle)
{
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
if (!__msgHandle)
{
- err = messages_open_service(&__msgHandle);
+ err = msg_open_msg_handle(&__msgHandle);
}
messageHandle = __msgHandle;
}
int
-_SmsMmsCallbackHandler::OpenCbsSettingsHandle(messages_cb_settings_h& cbsSettingsHandle)
+_SmsMmsCallbackHandler::OpenCbsSettingsHandle(msg_struct_t& cbsSettingsHandle)
{
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
if (!__cbsSettingsHandle)
{
- err = messages_cb_load_settings(__msgHandle, &__cbsSettingsHandle);
+ __cbsSettingsHandle = msg_create_struct(MSG_STRUCT_SETTING_CB_OPT);
+ if (__cbsSettingsHandle && __msgHandle)
+ {
+ err = msg_get_cb_opt(__msgHandle, __cbsSettingsHandle);
+ }
}
cbsSettingsHandle = __cbsSettingsHandle;
return err;
}
-int
-_SmsMmsCallbackHandler::CloseMessageHandle()
+result
+_SmsMmsCallbackHandler::AddCbsChannel(int from, int to, Tizen::Base::String& name, bool activate)
{
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
+ result r = E_SUCCESS;
+ CbsChannel* pCbsChannel = NULL;
- if (__msgHandle)
+ pCbsChannel = _CbsChannelImpl::GetCbsChannelN(from, to, name);
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+
+ if (activate)
{
- err = messages_close_service(__msgHandle);
- __msgHandle = 0;
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelState(activate);
}
- return err;
+ r =__pTempCbsChannelList->Add(*pCbsChannel);
+
+ err = SaveCbsSettings();
+ r = ConvertException(err);
+
+ return r;
}
-void
-_SmsMmsCallbackHandler::SentSmsMessageStatusCallback(messages_sending_result_e status, void* pUserEvent)
+result
+_SmsMmsCallbackHandler::RemoveCbsChannel(int from, int to)
{
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
- _SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserEvent);
- _SmsEventArg* pSmsEventArg = null;
+ int fromId = 0;
+ int toId = 0;
+ bool channelFound = false;
+ CbsChannel* pCbsChannel = NULL;
+
+ for (int index = 0; index < __pTempCbsChannelList->GetCount(); index++)
+ {
+ pCbsChannel = dynamic_cast< Tizen::Messaging::CbsChannel* >(__pTempCbsChannelList->GetAt(index));
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+
+ pCbsChannel->GetRange(fromId, toId);
+ if (from == fromId && to == toId)
+ {
+ channelFound = true; // found channel to be removed.
+ __pTempCbsChannelList->RemoveAt(index);
- SysLog(NID_MSG, "SMS message sent status[%d]", status);
+ err = SaveCbsSettings();
+ r = ConvertException(err);
+ delete pCbsChannel;
+ break;
+ }
+ }
- switch (status)
+ if (!channelFound)
{
- case MESSAGES_SENDING_SUCCEEDED: // Message is sent successfully
- SysLog(NID_MSG, "MESSAGES_SENDING_SUCCEEDED -> E_SUCCESS");
- r = E_SUCCESS;
- break;
+ return E_OBJ_NOT_FOUND;
+ }
- case MESSAGES_SENDING_FAILED: // Message is not sending
- SysLog(NID_MSG, "MESSAGES_SENDING_FAILED -> E_FAILURE");
- r = E_FAILURE;
- SysLog(NID_MSG, "Failed to send the SMS message. error cause: Message is not sending");
- break;
+ return r;
+}
- default:
- SysLog(NID_MSG, "default -> E_FAILURE");
- r = E_FAILURE;
- SysLog(NID_MSG, "Failed to send the SMS message. error cause: Unknown");
- break;
+result
+_SmsMmsCallbackHandler::SearchCbsChannel(int from, int to, int& index)
+{
+ result r = E_SUCCESS;
+ int fromId = 0;
+ int toId = 0;
+ bool channelFound = false;
+ CbsChannel* pCbsChannel = NULL;
+
+ for (int tempIndex = 0; tempIndex < __pTempCbsChannelList->GetCount(); tempIndex++)
+ {
+ pCbsChannel = dynamic_cast< Tizen::Messaging::CbsChannel* >(__pTempCbsChannelList->GetAt(tempIndex));
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+
+ pCbsChannel->GetRange(fromId, toId);
+ if (from == fromId && to == toId)
+ {
+ channelFound = true;
+ index = tempIndex;
+ break; // found channel to be searched.
+ }
}
- if (pSmsEvent)
+ if (!channelFound)
{
- pSmsEventArg = new (std::nothrow) _SmsEventArg(r);
- if (pSmsEventArg)
+ return E_OBJ_NOT_FOUND;
+ }
+
+ return r;
+}
+
+result
+_SmsMmsCallbackHandler::UpdateCbsChannel(int from, int to, Tizen::Base::String name, bool activate)
+{
+ int err = MSG_SUCCESS;
+ result r = E_SUCCESS;
+ int fromId = 0;
+ int toId = 0;
+ bool channelFound = false;
+ CbsChannel* pCbsChannel = NULL;
+
+ for (int index = 0; index < __pTempCbsChannelList->GetCount(); index++)
+ {
+ pCbsChannel = dynamic_cast< Tizen::Messaging::CbsChannel* >(__pTempCbsChannelList->GetAt(index));
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+
+ pCbsChannel->GetRange(fromId, toId);
+ if (from == fromId && to == toId)
{
- pSmsEvent->Fire(*pSmsEventArg);
+ channelFound = true;
+ break; // found channel to be updated.
+ }
+ }
+
+ if (!channelFound)
+ {
+ return E_OBJ_NOT_FOUND;
+ }
+
+ // set cbs channel name
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelName(name);
+
+ if (activate)
+ {
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelState(activate);
+ }
+ else
+ {
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelState(false);
+ }
+
+ err = SaveCbsSettings();
+ r = ConvertException(err);
+ return r;
+}
+
+result
+_SmsMmsCallbackHandler::GetCbsChannel(int index, int& from, int& to, Tizen::Base::String& name, bool& activate)
+{
+ result r = E_SUCCESS;
+ CbsChannel* pCbsChannel = NULL;
+
+ pCbsChannel = dynamic_cast< Tizen::Messaging::CbsChannel* >(__pTempCbsChannelList->GetAt(index));
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+
+ pCbsChannel->GetRange(from, to);
+ name = pCbsChannel->GetName();
+ if (pCbsChannel->IsActivated())
+ {
+ activate = true;
+ }
+ else
+ {
+ activate = false;
+ }
+ return r;
+}
+
+result
+_SmsMmsCallbackHandler::GetCbsChannelsCount(int& count)
+{
+ result r = E_SUCCESS;
+
+ if (__pTempCbsChannelList)
+ {
+ count = __pTempCbsChannelList->GetCount();
+ }
+
+ return r;
+}
+
+result
+_SmsMmsCallbackHandler::SaveCbsSettings()
+{
+ int err = MSG_SUCCESS;
+ result r = E_SUCCESS;
+ int fromId = 0;
+ int toId = 0;
+ bool isChannelActive = false;
+ String channelName;
+ char* pTempChannelName = null;
+
+ SysTryReturn(NID_MSG, __pTempCbsChannelList != null, r = E_SYSTEM, E_SYSTEM, "Failed to save the channel.");
+ err = msg_get_list_handle(__cbsSettingsHandle, MSG_CB_CHANNEL_LIST_STRUCT, (void **)&__pCbsChannelList);
+
+ // save Channel List
+ for (int index = 0; index < __pTempCbsChannelList->GetCount(); index++)
+ {
+ Tizen::Messaging::CbsChannel* pCbsChannel = dynamic_cast< Tizen::Messaging::CbsChannel* >(__pTempCbsChannelList->GetAt(index));
+ SysTryReturn(NID_MSG, pCbsChannel != null, r = E_SYSTEM, E_SYSTEM, "Failed to get the channel.");
+ pCbsChannel->GetRange(fromId, toId);
+ channelName = pCbsChannel->GetName();
+ if (pCbsChannel->IsActivated())
+ {
+ isChannelActive = true;
+ }
+
+ pTempChannelName = _StringConverter::CopyToCharArrayN(channelName);
+ SysTryReturn(NID_MSG, pTempChannelName != null, r = E_OUT_OF_MEMORY, r, "Memory allocation failed.");
+
+ msg_set_bool_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ACTIVATE_BOOL, isChannelActive);
+ msg_set_int_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ID_FROM_INT, fromId);
+ msg_set_int_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ID_TO_INT, toId);
+ msg_set_str_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_NAME_STR,
+ pTempChannelName,CB_CHANNEL_NAME_MAX);
+
+ if (pTempChannelName)
+ {
+ delete[] pTempChannelName;
+ pTempChannelName = null;
}
}
+
+ err = msg_set_cb_opt(__msgHandle, __cbsSettingsHandle);
+ r = ConvertException(err);
+ return r;
}
-void
-_SmsMmsCallbackHandler::SentMmsMessageStatusCallback(messages_sending_result_e status, void* pUserEvent)
+result
+_SmsMmsCallbackHandler::LoadCbsSettings()
{
+ int err = MSG_SUCCESS;
result r = E_SUCCESS;
- _MmsEvent* pMmsEvent = static_cast <_MmsEvent*>(pUserEvent);
- _MmsEventArg* pMmsEventArg = null;
+ CbsChannel* pCbsChannel = NULL;
+ int fromId = 0;
+ int toId = 0;
+ bool isChannelActive = false;
+ char channelName[CB_CHANNEL_NAME_MAX + 1] = {0,};
- SysLog(NID_MSG, "MMS message sent status[%d]", status);
+ __pTempCbsChannelList = new (std::nothrow) ArrayList();
+ SysTryCatch(NID_MSG, __pTempCbsChannelList != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
- switch (status)
+ // make a list
+ r = __pTempCbsChannelList->Construct();
+ SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "Failed to construct an ArrayList");
+
+ if (__cbsSettingsHandle)
{
- case MESSAGES_SENDING_SUCCEEDED: // Message is sent successfully
- SysLog(NID_MSG, "MESSAGES_SENDING_SUCCEEDED -> E_SUCCESS");
- r = E_SUCCESS;
- break;
+ // Load Channel List
+ err = msg_get_list_handle(__cbsSettingsHandle, MSG_CB_CHANNEL_LIST_STRUCT, (void **)&__pCbsChannelList);
+ for (int index = 0; index < __pCbsChannelList->nCount; index++)
+ {
+ msg_get_bool_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ACTIVATE_BOOL, &isChannelActive);
+ msg_get_int_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ID_FROM_INT, &fromId);
+ msg_get_int_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_ID_TO_INT, &toId);
+ msg_get_str_value(__pCbsChannelList->msg_struct_info[index], MSG_CB_CHANNEL_NAME_STR,
+ channelName,CB_CHANNEL_NAME_MAX);
+
+ pCbsChannel = _CbsChannelImpl::GetCbsChannelN(fromId, toId, String(channelName));
+ SysTryCatch(NID_MSG, pCbsChannel != null, r = E_SYSTEM, r, "Failed to get the channel.");
+ if (isChannelActive)
+ {
+ _CbsChannelImpl::GetInstance(*pCbsChannel)->SetCbsChannelState(isChannelActive);
+ }
+ __pTempCbsChannelList->Add(*pCbsChannel);
+ }
+ }
- case MESSAGES_SENDING_FAILED: // Message is not sending
- SysLog(NID_MSG, "MESSAGES_SENDING_SUCCEEDED -> E_FAILURE");
- r = E_FAILURE;
- break;
+ r = ConvertException(err);
+ return r;
- default:
- SysLog(NID_MSG, "default -> E_FAILURE");
- r = E_FAILURE;
- break;
+CATCH:
+ if (__pTempCbsChannelList)
+ {
+ if (__pTempCbsChannelList->GetCount() > 0)
+ {
+ __pTempCbsChannelList->RemoveAll(true);
+ }
+ delete __pTempCbsChannelList;
+ __pTempCbsChannelList = null;
+ }
+
+ return r;
+}
+
+int
+_SmsMmsCallbackHandler::RegisterMessageCallback()
+{
+ int err = MSG_SUCCESS;
+
+ if (__msgHandle && !__callbackRegistered)
+ {
+ err = msg_reg_sent_status_callback(__msgHandle, &_SmsMmsCallbackHandler::SentMessageStatusCallback, null);
+ __callbackRegistered = true;
+ }
+
+ return err;
+}
+
+int
+_SmsMmsCallbackHandler::CloseMessageHandle()
+{
+ int err = MSG_SUCCESS;
+
+ if (__msgHandle)
+ {
+ err = msg_close_msg_handle(&__msgHandle);
+ __msgHandle = 0;
+ }
+
+ return err;
+}
+
+int
+_SmsMmsCallbackHandler::CloseCbsSettingsHandle()
+{
+ int err = MSG_SUCCESS;
+
+ if (__cbsSettingsHandle)
+ {
+ err = msg_release_struct(&__cbsSettingsHandle);
+ __cbsSettingsHandle = 0;
}
- if (pMmsEvent)
+ if (__pTempCbsChannelList)
{
- pMmsEventArg = new (std::nothrow) _MmsEventArg(r);
- if (pMmsEventArg)
+ if (__pTempCbsChannelList->GetCount() > 0)
{
- pMmsEvent->Fire(*pMmsEventArg);
+ __pTempCbsChannelList->RemoveAll(true);
}
+ delete __pTempCbsChannelList;
+ __pTempCbsChannelList = null;
}
+
+ return err;
}
void
-_SmsMmsCallbackHandler::IncomingSmsMessageCallback(messages_message_h incomingMsg, void* pUserParam)
+_SmsMmsCallbackHandler::SetInComingSmsCallback(bool incomingSmsCallbackRegistered)
{
- _SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserParam);
- _SmsEventArg* pSmsEventArg = null;
- char* pMsgBody = null;
- char* pMsgAddress = null;
- time_t tempReceivedTime = 0;
- int port = 0;
- DateTime receivedTime;
- messages_recipient_type_e recipientType = MESSAGES_RECIPIENT_TO;
+ __incomingSmsCallbackRegistered = incomingSmsCallbackRegistered;
+}
+
+void
+_SmsMmsCallbackHandler::SetCbsAndEtwsUserEvent(_MessageType msgType, Tizen::Base::Object* pEvent)
+{
+ if (msgType == _MSG_CBS)
+ {
+ __pCbsUserEvent = pEvent;
+ }
+ else
+ {
+ __pEtwsUserEvent = pEvent;
+ }
+}
- messages_get_text(incomingMsg, &pMsgBody);
- messages_get_time(incomingMsg, &tempReceivedTime); // get msg time
- messages_get_message_port(incomingMsg, &port); // get port number
- messages_get_address(incomingMsg, 0, &pMsgAddress, &recipientType);
+result
+_SmsMmsCallbackHandler::AddToMessageMap(int reqId, _MessageType msgType, Tizen::Base::Object* pEvent)
+{
+ result r = E_SUCCESS;
- String message(pMsgBody); // porting char* to String
- String senderAddress(pMsgAddress);
+ Integer* pReqId = new (std::nothrow) Integer(reqId);
+ SysTryReturn(NID_MSG, pReqId != null, E_OUT_OF_MEMORY, r = E_OUT_OF_MEMORY, "memory allocation failed.");
+ Integer* pMsgType = new (std::nothrow) Integer(msgType);
+ SysTryReturn(NID_MSG, pMsgType != null, E_OUT_OF_MEMORY, r = E_OUT_OF_MEMORY, "memory allocation failed.");
- receivedTime = _MsgUtil::ConvertTime(&tempReceivedTime);
+ __msgMutex.Acquire();
- SysLog(NID_MSG, "incoming sms msg_body: [%s]", pMsgBody);
- SysLog(NID_MSG, "incoming sms port: [%d]", port);
- SysLog(NID_MSG, "incoming sms received time: [%s]", ctime(&tempReceivedTime));
+ r = __messageMap.Add(*pReqId, *pMsgType);
+ r = __messageMap.Add(*pReqId, *pEvent);
- free(pMsgBody);
- pMsgBody = null;
- free(pMsgAddress);
- pMsgAddress = null;
+ __msgMutex.Release();
- if (pSmsEvent)
+ return r;
+}
+
+result
+_SmsMmsCallbackHandler::GetAndRemoveFromMessageMap(int reqId, _MessageType& msgType, Tizen::Base::Object** pUserEvent)
+{
+ result r = E_SUCCESS;
+
+ Integer* pReqId = new (std::nothrow) Integer(reqId);
+ SysTryReturn(NID_MSG, pReqId != null, E_OUT_OF_MEMORY, r = E_OUT_OF_MEMORY, "memory allocation failed.");
+ Integer* pKey = null;
+ Integer* pMsgType = null;
+ Tizen::Base::Object* pEvent = null;
+ IEnumerator* pValueEnum = null;
+ IMapEnumerator* pMapEnum = null;
+
+ __msgMutex.Acquire();
+
+ pValueEnum = __messageMap.GetValuesN(*pReqId);
+
+ if (pValueEnum)
{
- if (port == 0) // normal incoming SMS message case
+ if (pValueEnum->MoveNext() == E_SUCCESS)
{
- pSmsEventArg = new (std::nothrow) _SmsEventArg(message, senderAddress, receivedTime);
- SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ pMsgType = static_cast <Integer*>(pValueEnum->GetCurrent());
+
+ if (pValueEnum->MoveNext() == E_SUCCESS)
+ {
+ pEvent = static_cast <Tizen::Base::Object*>(pValueEnum->GetCurrent());
+ }
}
- else // SMS trigger message case
+ }
+
+ *pUserEvent = pEvent;
+
+ if (pMsgType)
+ {
+ if (pMsgType->ToInt() == _MSG_SMS)
{
- pSmsEventArg = new (std::nothrow) _SmsEventArg(port, receivedTime, message);
- SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ msgType = _MSG_SMS;
}
+ else
+ {
+ msgType = _MSG_MMS;
+ }
+ }
- pSmsEvent->Fire(*pSmsEventArg);
+ //Manually getting and deleting the key value
+ pMapEnum = __messageMap.GetMapEnumeratorN();
+
+ if (pMapEnum)
+ {
+ while (pMapEnum->MoveNext() == E_SUCCESS)
+ {
+ pKey = static_cast <Integer*>(pMapEnum->GetKey());
+ if (pKey)
+ {
+ if (!(pKey->CompareTo(*pReqId)))
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ r = __messageMap.Remove(*pReqId, false);
+
+ delete pMapEnum;
+ delete pValueEnum;
+ delete pMsgType;
+ delete pReqId;
+ delete pKey;
+
+ __msgMutex.Release();
+
+ return r;
+}
+
+void
+_SmsMmsCallbackHandler::SentMessageStatusCallback(msg_handle_t hMsgHandle, msg_struct_t msgStatus, void* pUserParam)
+{
+ result r = E_SUCCESS;
+ _MessageType msgType = (_MessageType) -1;
+ Tizen::Base::Object* pUserEvent = null;
+ int status = MSG_NETWORK_SEND_FAIL;
+ int reqId = 0;
+
+ msg_get_int_value(msgStatus, MSG_SENT_STATUS_REQUESTID_INT, &reqId);
+ msg_get_int_value(msgStatus, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
+
+ _SmsMmsCallbackHandler::GetInstance()->GetAndRemoveFromMessageMap(reqId, msgType, &pUserEvent);
+
+ SysLog(NID_MSG, "hMsgHandle[%d]", hMsgHandle);
+ SysLog(NID_MSG, "req[%d]", reqId);
+ SysLog(NID_MSG, "msgType[%d]", msgType);
+ SysLog(NID_MSG, "pUserEvent[%d]", pUserEvent);
+
+ if (status == MSG_NETWORK_SEND_SUCCESS)
+ {
+ r = E_SUCCESS;
+ SysLog(NID_MSG, "Message is sent successfully");
+ }
+ else
+ {
+ r = E_FAILURE;
+ SysLog(NID_MSG, "Failed to send the message. error cause: Message is not sending");
+ }
+
+ if (msgType == _MSG_SMS)
+ {
+ _SmsEvent* pSmsEvent = dynamic_cast <_SmsEvent*>(pUserEvent);
+ _SmsEventArg* pSmsEventArg = null;
+
+ if (pSmsEvent)
+ {
+ pSmsEventArg = new (std::nothrow) _SmsEventArg(r);
+ if (pSmsEventArg)
+ {
+ pSmsEvent->Fire(*pSmsEventArg);
+ }
+ }
+ }
+ else
+ {
+ if (msgType == _MSG_MMS)
+ {
+ _MmsEvent* pMmsEvent = dynamic_cast <_MmsEvent*>(pUserEvent);
+ _MmsEventArg* pMmsEventArg = null;
+
+ if (pMmsEvent)
+ {
+ pMmsEventArg = new (std::nothrow) _MmsEventArg(r);
+ if (pMmsEventArg)
+ {
+ pMmsEvent->Fire(*pMmsEventArg);
+ }
+ }
+ }
}
+
}
void
-_SmsMmsCallbackHandler::IncomingCbsMessageCallback(messages_cb_message_h incomingMsg, void* pUserParam)
+_SmsMmsCallbackHandler::IncomingSmsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam)
{
_SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserParam);
_SmsEventArg* pSmsEventArg = null;
- char* pMsgBody = null;
- time_t tempReceivedTime = 0;
+
+ int msgSize = 0;
+ msg_get_int_value(newMsg, MSG_MESSAGE_DATA_SIZE_INT, &msgSize);
+ char msgText[msgSize + 1];
+ memset(msgText, 0, msgSize + 1);
+ msg_get_str_value(newMsg, MSG_MESSAGE_SMS_DATA_STR, msgText, msgSize);
+ String message(msgText);
+
+ int port = -1;
+ msg_get_int_value(newMsg, MSG_MESSAGE_DEST_PORT_INT, &port);
+
+ int displayTime = -1;
+ msg_get_int_value(newMsg, MSG_MESSAGE_DISPLAY_TIME_INT, &displayTime);
+ DateTime receivedTime = _MsgUtil::ConvertTime((time_t *) &displayTime);
+
+ char address[MAX_ADDRESS_VAL_LEN] = {0, };
+ msg_struct_list_s* pAddrList = NULL;
+ msg_struct_t addrInfo = NULL;
+ msg_get_list_handle(newMsg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&pAddrList);
+ addrInfo = pAddrList->msg_struct_info[0];
+ msg_get_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, address, MAX_ADDRESS_VAL_LEN);
+ String senderAddress(address);
+
+ SysLog(NID_MSG, "hMsgHandle: [%d]", hMsgHandle);
+ SysLog(NID_MSG, "msg_body: [%s]", msgText);
+ SysLog(NID_MSG, "port: [%d]", port);
+ //SysLog(NID_MSG, "received time: [%s]", ctime(pReceivedTime));
+
+ if (_SmsMmsCallbackHandler::GetInstance()->__incomingSmsCallbackRegistered)
+ {
+ if (pSmsEvent)
+ {
+ if (port == 0) // normal incoming SMS message case
+ {
+ pSmsEventArg = new (std::nothrow) _SmsEventArg(message, senderAddress, receivedTime);
+ SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ }
+ else // SMS trigger message case
+ {
+ pSmsEventArg = new (std::nothrow) _SmsEventArg(port, receivedTime, message, senderAddress);
+ SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ }
+ pSmsEvent->Fire(*pSmsEventArg);
+ }
+ }
+}
+
+void
+_SmsMmsCallbackHandler::IncomingCbsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam)
+{
+ _SmsEventArg* pSmsEventArg = null;
+ int tempReceivedTime = 0;
DateTime receivedTime;
bool etwsNotifiation = false;
int messgeId = 0;
int serialNumber = 0;
int length = 0;
- int dataCodingScheme = 0;
- messages_message_type_e cbsType;
+ int cbsType = -1;
Tizen::Base::ByteBuffer msgSerialNumber;
- messages_cb_get_text(incomingMsg, &pMsgBody);
- messages_cb_get_time(incomingMsg, &tempReceivedTime);
- messages_cb_get_message_id(incomingMsg, &messgeId);
- messages_cb_get_serial_number(incomingMsg, &serialNumber);
- messages_cb_get_message_type(incomingMsg, &cbsType);
- messages_cb_get_dcs(incomingMsg, &dataCodingScheme);
+ msg_get_int_value(newMsg, MSG_CB_MSG_RECV_TIME_INT, &tempReceivedTime);
+ receivedTime = _MsgUtil::ConvertTime((time_t *) &tempReceivedTime);
- Tizen::Base::Integer serialno(serialNumber);
+ msg_get_int_value(newMsg, MSG_CB_MSG_MSG_ID_INT, &messgeId);
+ msg_get_int_value(newMsg, MSG_CB_MSG_SERIAL_NUM_INT, &serialNumber);
+ msg_get_int_value(newMsg, MSG_CB_MSG_TYPE_INT, &cbsType);
+
+ Tizen::Base::Integer serialno(serialNumber);
length = serialno.ToString().GetLength();
msgSerialNumber.Construct(length);
msgSerialNumber.SetInt(0, serialNumber);
msgSerialNumber.SetPosition(0);
- String message(pMsgBody); // porting char* to String
+ if (cbsType == MSG_TYPE_SMS_ETWS_PRIMARY || cbsType == MSG_TYPE_SMS_ETWS_SECONDARY)
+ {
+ int etwsWarningType;
+ char etwsWarningInfo[MESSAGES_ETWS_WARNING_INFO_LEN];
+ Tizen::Base::ByteBuffer msgSecurityInfo;
+ Tizen::Base::ByteBuffer etwsMsgWarningType;
+ msg_get_int_value(newMsg, MSG_CB_MSG_ETWS_WARNING_TYPE_INT, &etwsWarningType);
+ msg_get_str_value(newMsg, MSG_CB_MSG_ETWS_WARNING_SECU_INFO_STR, etwsWarningInfo, MESSAGES_ETWS_WARNING_INFO_LEN);
+
+ String etwsSecurityInfo(etwsWarningInfo);
+ length = etwsSecurityInfo.GetLength();
+ msgSecurityInfo.Construct(length);
+ msgSecurityInfo.SetArray((byte*) etwsWarningInfo, 0, length);
+ msgSecurityInfo.SetPosition(0);
+
+ Tizen::Base::Integer warningtype(etwsWarningType);
+ length = warningtype.ToString().GetLength();
+
+ etwsMsgWarningType.Construct(length);
+ etwsMsgWarningType.SetInt(0, etwsWarningType);
+ etwsMsgWarningType.SetPosition(0);
- receivedTime = _MsgUtil::ConvertTime(&tempReceivedTime);
+ etwsNotifiation = true;
+ _SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(_SmsMmsCallbackHandler::GetInstance()->__pEtwsUserEvent);
- Tizen::Base::Integer dataCodingSchemeTemp(dataCodingScheme);
+ SysLog(NID_MSG, "cbs etwsWarningType: [%d]", etwsWarningType);
- if (cbsType == MESSAGES_TYPE_SMS_ETWS_PRIMARY || cbsType == MESSAGES_TYPE_SMS_ETWS_SECONDARY)
- {
- etwsNotifiation = true;
+ if (pSmsEvent)
+ {
+ pSmsEventArg = new (std::nothrow) _SmsEventArg(receivedTime, msgSerialNumber, msgSecurityInfo, messgeId,
+ etwsMsgWarningType, _SMS_EVENT_TYPE_ETWS_RECEIVE_RESULT);
+ SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ pSmsEvent->Fire(*pSmsEventArg);
+ }
}
-
- if (pMsgBody)
+ else
{
- free(pMsgBody);
- pMsgBody = null;
+ _SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(_SmsMmsCallbackHandler::GetInstance()->__pCbsUserEvent);
+ int dataCodingScheme = 0;
+ int msgSize = 0;
+
+ msg_get_int_value(newMsg, MSG_CB_MSG_CB_TEXT_LEN_INT, &msgSize);
+ char msgBody[msgSize + 1];
+ memset(msgBody, 0, msgSize + 1);
+ msg_get_str_value(newMsg, MSG_CB_MSG_CB_TEXT_STR, msgBody, msgSize + 1);
+ String message(msgBody); // porting char* to String
+
+ msg_get_int_value(newMsg, MSG_CB_MSG_DCS_INT, &dataCodingScheme);
+ Tizen::Base::Integer dataCodingSchemeTemp(dataCodingScheme);
+
+ //language type of cbs message
+ String messageLanguage(L"");
+ byte higherNibble = dataCodingScheme & 0xf0;
+ byte lowerNibble = dataCodingScheme & 0x0f;
+
+ //check higher nibble
+ // if higher nibble 0000
+ if (higherNibble == 0x00)
+ {
+ messageLanguage = GetCbsLanguageType(lowerNibble);
+ }
+ else if (higherNibble == 0x01)
+ {
+ // if higher nibble is 0001, get language type from framework
+ int len = 15;
+ char type[len + 1];
+ memset(type, 0, len + 1);
+ msg_get_str_value(newMsg, MSG_CB_MSG_LANGUAGE_TYPE_STR, type, len);
+ messageLanguage = String(type);
+ }
+ else if (higherNibble == 0x20 && lowerNibble == 0x00)
+ {
+ // if 0010 0000
+ messageLanguage = String(L"CS");
+ }
+ else
+ {
+ // use empty string
+ }
+
+ if (pSmsEvent)
+ {
+ pSmsEventArg = new (std::nothrow) _SmsEventArg(message, msgSerialNumber, receivedTime, messgeId, etwsNotifiation,
+ ((byte) dataCodingSchemeTemp.ToChar()),messageLanguage, _SMS_EVENT_TYPE_CBS_RECEIVE_RESULT);
+ SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
+ pSmsEvent->Fire(*pSmsEventArg);
+ }
+
+ SysLog(NID_MSG, "cbs msg_body: [%s]", msgBody);
+ SysLog(NID_MSG, "cbs dataCodingScheme: [%d]", dataCodingScheme);
+ SysLog(NID_MSG, "cbs languageType: [%s]", messageLanguage.GetPointer());
}
- SysLog(NID_MSG, "cbs msg_body: [%s]", pMsgBody);
+
SysLog(NID_MSG, "cbs msg_id: [%d]", messgeId);
SysLog(NID_MSG, "cbs serialNumber: [%d]", serialNumber);
- SysLog(NID_MSG, "cbs received time: [%s]", ctime(&tempReceivedTime));
SysLog(NID_MSG, "cbs etwsNotifiation: [%d]", etwsNotifiation);
- SysLog(NID_MSG, "cbs dataCodingScheme: [%d]", dataCodingScheme);
-
- if (pSmsEvent)
- {
- pSmsEventArg = new (std::nothrow) _SmsEventArg(message, msgSerialNumber, receivedTime, messgeId, etwsNotifiation, ((byte) dataCodingSchemeTemp.ToChar()), _SMS_EVENT_TYPE_CBS_RECEIVE_RESULT);
- SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
- pSmsEvent->Fire(*pSmsEventArg);
- }
}
void
-_SmsMmsCallbackHandler::IncomingWapPushMessageCallback(const char* pHeader, const char* pBody, int bodyLength, void* pUserParam)
+_SmsMmsCallbackHandler::IncomingWapPushMessageCallback(msg_handle_t hMsgHandle, const char* pHeader, const char* pBody, int bodyLength, void* pUserParam)
{
_SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserParam);
_SmsEventArg* pSmsEventArg = null;
}
}
-void
-_SmsMmsCallbackHandler::IncomingEtwsMessageCallback(messages_cb_message_h incomingMsg, int etwsWarningType, const char* pEtwsSecurityInfo, void* pUserParam)
+Tizen::Base::String
+_SmsMmsCallbackHandler::GetCbsLanguageType(byte codingScheme)
{
- _SmsEvent* pSmsEvent = static_cast <_SmsEvent*>(pUserParam);
- _SmsEventArg* pSmsEventArg = null;
- time_t tempReceivedTime = 0;
- DateTime receivedTime;
- int messgeId = 0;
- int serialNumber = 0;
- int length = 0;
- Tizen::Base::ByteBuffer msgSerialNumber;
- Tizen::Base::ByteBuffer msgSecurityInfo;
- Tizen::Base::ByteBuffer etwsMsgWarningType;
+ String languageType(L"");
- messages_cb_get_time(incomingMsg, &tempReceivedTime);
- messages_cb_get_message_id(incomingMsg, &messgeId);
- messages_cb_get_serial_number(incomingMsg, &serialNumber);
+ switch(codingScheme)
+ {
+ case 0x00:
+ languageType = String(L"DE");
+ break;
+ case 0x01:
+ languageType = String(L"EN");
+ break;
+ case 0x02:
+ languageType = String(L"IT");
+ break;
+ case 0x03:
+ languageType = String(L"FR");
+ break;
+ case 0x04:
+ languageType = String(L"ES");
+ break;
+ case 0x05:
+ languageType = String(L"NL");
+ break;
+ case 0x06:
+ languageType = String(L"SV");
+ break;
+ case 0x07:
+ languageType = String(L"DA");
+ break;
+ case 0x08:
+ languageType = String(L"PT");
+ break;
+ case 0x09:
+ languageType = String(L"FI");
+ break;
+ case 0x0a:
+ languageType = String(L"NO");
+ break;
+ case 0x0b:
+ languageType = String(L"EL");
+ break;
+ case 0x0c:
+ languageType = String(L"TR");
+ break;
+ case 0x0d:
+ languageType = String(L"HU");
+ break;
+ case 0x0e:
+ languageType = String(L"PL");
+ break;
+ case 0x0f:
+ languageType = String(L"");
+ SysLog(NID_MSG, "Language unspecified.");
+ break;
+ default:
+ break;
+ };
+
+ return languageType;
+}
- Tizen::Base::Integer serialno(serialNumber);
- length = serialno.ToString().GetLength();
+result
+_SmsMmsCallbackHandler::ConvertException(int err) const
+{
+ result r = E_SUCCESS;
- msgSerialNumber.Construct(length);
- msgSerialNumber.SetInt(0, serialNumber);
- msgSerialNumber.SetPosition(0);
+ switch (err)
+ {
+ case MSG_SUCCESS:
+ r = E_SUCCESS;
+ break;
- String etwsSecurityInfo(pEtwsSecurityInfo);
- length = etwsSecurityInfo.GetLength();
- msgSecurityInfo.Construct(length);
- msgSecurityInfo.SetArray((byte*) pEtwsSecurityInfo, 0, length);
- msgSecurityInfo.SetPosition(0);
+ case MSG_ERR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_MESSAGE:
+ case MSG_ERR_NULL_POINTER:
+ case MSG_ERR_NULL_MESSAGE:
+ r = E_INVALID_ARG;
+ break;
- Tizen::Base::Integer warningtype(etwsWarningType);
- length = warningtype.ToString().GetLength();
+ case MSG_ERR_MEMORY_ERROR:
+ r = E_OUT_OF_MEMORY;
+ break;
- etwsMsgWarningType.Construct(length);
- etwsMsgWarningType.SetInt(0, etwsWarningType);
- etwsMsgWarningType.SetPosition(0);
+ case MSG_ERR_SERVER_NOT_READY:
+ case MSG_ERR_TRANSPORT_ERROR:
+ case MSG_ERR_COMMUNICATION_ERROR:
+ r = E_NETWORK_UNAVAILABLE;
+ break;
- receivedTime = _MsgUtil::ConvertTime(&tempReceivedTime);
+ case MSG_ERR_NO_SIM:
+ r = E_DEVICE_UNAVAILABLE;
+ break;
- SysLog(NID_MSG, "cbs msg_id: [%d]", messgeId);
- SysLog(NID_MSG, "cbs received time: [%s]", ctime(&tempReceivedTime));
- SysLog(NID_MSG, "cbs etwsWarningType: [%d]", etwsWarningType);
+ case MSG_ERR_PLUGIN_TAPI_FAILED:
+ r = E_FAILURE;
+ break;
- if (pSmsEvent)
- {
- pSmsEventArg = new (std::nothrow) _SmsEventArg(receivedTime, msgSerialNumber, msgSecurityInfo, messgeId, etwsMsgWarningType, _SMS_EVENT_TYPE_ETWS_RECEIVE_RESULT);
- SysTryReturnVoidResult(NID_MSG, pSmsEventArg != null, E_OUT_OF_MEMORY, "memory allocation failed.");
- pSmsEvent->Fire(*pSmsEventArg);
+ default:
+ r = E_SYSTEM;
+ break;
}
+
+ return r;
}
} } // Tizen::Messaging
*/
virtual ~_SmsMmsCallbackHandler(void);
+ /**
+ * Initializes the Messaging Hash Map table
+ *
+ * @since 3.0
+ * @return An error code
+ * @exception E_SUCCESS The method was successful.
+ * @exception E_INVALID_ARG Input parameter is NULL.
+ * @exception E_OUT_OF_MEMORY Memory error.
+ */
+ result Construct(void);
+
// Operation
public:
/**
/**
* gets the Message Handle for SMS/MMS operation.
*
- * @since 2.1
+ * @since 3.0
* @return An error code
* @param[in] messageHandle message Handle
* @exception MSG_SUCCESS The method was successful.
* @exception MSG_ERR_NULL_POINTER Input parameter is NULL.
* @exception MSG_ERR_MEMORY_ERROR Memory error.
*/
- int OpenMessageHandle(messages_service_h& messageHandle);
+ int OpenMessageHandle(msg_handle_t& messageHandle);
/**
* gets the Message Handle for Cbs message operation.
*
- * @since 2.1
+ * @since 3.0
* @return An error code
* @param[in] cbsSettingsHandle cbs message Handle
* @exception MSG_SUCCESS The method was successful.
* @exception MSG_ERR_NULL_POINTER Input parameter is NULL.
* @exception MSG_ERR_MEMORY_ERROR Memory error.
*/
- int OpenCbsSettingsHandle(messages_cb_settings_h& cbsSettingsHandle);
+ int OpenCbsSettingsHandle(msg_struct_t& cbsSettingsHandle);
+
+ // Adds a CBS channel with specified parameters.
+ result AddCbsChannel(int from, int to, Tizen::Base::String& name, bool activate);
+
+ // Removes a CBS channel with specified parameters.
+ result RemoveCbsChannel(int from, int to);
+
+ // Searches a CBS channel with specified parameters and returns index of channel found.
+ result SearchCbsChannel(int from, int to, int& index);
+
+ // Updates a CBS channel with specified parameters.
+ result UpdateCbsChannel(int from, int to, Tizen::Base::String name, bool activate);
+
+ // Gets a CBS channel data with specified index.
+ result GetCbsChannel(int index, int& from, int& to, Tizen::Base::String& name, bool& activate);
+
+ // Gets a CBS channel count.
+ result GetCbsChannelsCount(int& count);
+
+ /**
+ * loads the Cbs channels list.
+ *
+ * @since 3.0
+ * @return An error code
+ * @exception E_SUCCESS The method was successful.
+ * @exception E_INVALID_ARG Input parameter is NULL.
+ * @exception E_OUT_OF_MEMORY Memory error.
+ */
+ result LoadCbsSettings();
+
+ /**
+ * saves the Cbs channels list.
+ *
+ * @since 3.0
+ * @return An error code
+ * @exception E_SUCCESS The method was successful.
+ * @exception E_INVALID_ARG Input parameter is NULL.
+ * @exception E_OUT_OF_MEMORY Memory error.
+ */
+ result SaveCbsSettings();
+
+ /**
+ * closes the CBS Message Handle.
+ *
+ * @since 3.0
+ * @return An error code
+ * @exception MSG_SUCCESS The method was successful.
+ * @exception MSG_ERR_NULL_POINTER Input parameter is NULL.
+ * @exception MSG_ERR_MEMORY_ERROR Memory error.
+ */
+ int CloseCbsSettingsHandle(void);
/**
* closes the Message Handle for SMS/MMS operation.
*
- * @since 2.1
+ * @since 3.0
* @return An error code
* @exception MSG_SUCCESS The method was successful.
* @exception MSG_ERR_NULL_POINTER Input parameter is NULL.
*/
int CloseMessageHandle(void);
- // for SMS sent status
- static void SentSmsMessageStatusCallback(messages_sending_result_e status, void* pUserEvent);
+ /**
+ * Registers the Message call back for SMS/MMS operation.
+ *
+ * @since 3.0
+ * @return An error code
+ * @exception MSG_SUCCESS The method was successful.
+ * @exception MSG_ERR_NULL_POINTER Input parameter is NULL.
+ * @exception MSG_ERR_MEMORY_ERROR Memory error.
+ */
+ int RegisterMessageCallback(void);
- //for MMS sent status
- static void SentMmsMessageStatusCallback(messages_sending_result_e status, void* pUserEvent);
+ /**
+ * Adds the message requestId/Message Type/Message Event to Message Hash Map table
+ *
+ * @since 3.0
+ * @return An error code
+ * @param[in] reqId SMS/MMS message requestId
+ * @param[in] msgType message type
+ * @param[in] pEvent message Event
+ * @exception E_SUCCESS The method was successful.
+ * @exception E_INVALID_ARG Input parameter is NULL.
+ * @exception E_OUT_OF_MEMORY Memory error.
+ */
+ result AddToMessageMap(int reqId, _MessageType msgType, Tizen::Base::Object* pEvent);
+
+ /**
+ * Gets the Message Type and Message Event based on the message requestId. Also removes the Hashmap elements for the requestId
+ *
+ * @since 3.0
+ * @return An error code
+ * @param[in] reqId SMS/MMS message requestId
+ * @param[in] msgType message type
+ * @param[in] pEvent message Event
+ * @exception E_SUCCESS The method was successful.
+ * @exception E_INVALID_ARG Input parameter is NULL.
+ * @exception E_OUT_OF_MEMORY Memory error.
+ */
+ result GetAndRemoveFromMessageMap(int reqId, _MessageType& msgType, Tizen::Base::Object** pEvent);
+
+ // for SMS and MMS sent status
+ static void SentMessageStatusCallback(msg_handle_t hMsgHandle, msg_struct_t msgStatus, void* pUserParam);
// for incoming SMS
- static void IncomingSmsMessageCallback(messages_message_h incomingMsg, void* pUserParam);
+ static void IncomingSmsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam);
+
+ /**
+ * Sets the __incomingSmsCallbackRegistered flag.
+ *
+ * @since 3.0
+ * @param[in] incomingSmsCallbackRegistered SMS registered flag
+ */
+ void SetInComingSmsCallback(bool incomingSmsCallbackRegistered);
- // for incoming CBS
- static void IncomingCbsMessageCallback(messages_cb_message_h incomingMsg, void* pUserParam);
+ /**
+ * Sets the Cbs And Etws UserEvent.
+ *
+ * @since 3.0
+ * @param[in] msgType message type
+ * @param[in] pEvent message Event
+ */
+ void SetCbsAndEtwsUserEvent(_MessageType msgType, Tizen::Base::Object* pEvent);
+
+ // for incoming CBS/Etws
+ static void IncomingCbsMessageCallback(msg_handle_t hMsgHandle, msg_struct_t newMsg, void* pUserParam);
// for incoming Wap push
- static void IncomingWapPushMessageCallback(const char* pHeader, const char* pBody, int bodyLength, void* pUserParam);
+ static void IncomingWapPushMessageCallback(msg_handle_t hMsgHandle, const char* pHeader, const char* pBody, int bodyLength, void* pUserParam);
- // for incoming Etws cbs
- static void IncomingEtwsMessageCallback(messages_cb_message_h incomingMsg, int etwsWarningType, const char* pEtwsSecurityInfo, void* pUserParam);
+ //get cb message language type
+ static Tizen::Base::String GetCbsLanguageType(byte codingScheme);
// Life cycle
private:
*/
_SmsMmsCallbackHandler(void);
+ result ConvertException(int err) const;
+
private:
static _SmsMmsCallbackHandler* __pMessageCallbackHandler;
- messages_service_h __msgHandle;
- messages_cb_settings_h __cbsSettingsHandle;
+ msg_handle_t __msgHandle;
+ msg_struct_t __cbsSettingsHandle;
+ msg_struct_list_s* __pCbsChannelList;
+ Tizen::Base::Collection::ArrayList* __pTempCbsChannelList;
+ bool __callbackRegistered;
+ bool __incomingSmsCallbackRegistered;
+ Tizen::Base::Collection::MultiHashMap __messageMap;
+ Tizen::Base::Runtime::Mutex __msgMutex;
+ Tizen::Base::Object* __pCbsUserEvent;
+ Tizen::Base::Object* __pEtwsUserEvent;
}; // _SmsMmsCallbackHandler
} } // Tizen::Messaging
#define MAX_EMAIL_BODY_TEXT_LENGTH 2000
// file size
-#define MAX_MMS_FILE_SIZE (295 * 1024) // 295KB = 300KB - 4KB (MMS header margin) - 1KB (my margin for local language size)
+#define MAX_MMS_FILE_SIZE (295 * 1024) // 295KB = 300KB - 4KB (MMS header margin) - 1KB (margin for local language size)
#define MAX_EMAIL_FILE_SIZE (5 * 1024 * 1024) // 5MB
// attachment count
// Cbs channel name length
#define MAX_CBS_CHANNEL_NAME_LENGTH 32
-#define MAX_CBS_CHANNEL_RANGE 900
+#define MAX_CBS_CHANNEL_RANGE 0xFFFF
#define MAX_CBS_CHANNEL_LIMIT 0xFFFF
+#define MESSAGES_ETWS_WARNING_INFO_LEN 50
//Detail email message
_MSG_SMS = 0, /**<SMS message */
_MSG_MMS, /**<MMS message */
_MSG_EMAIL, /**<Email message */
- _MSG_COMPOSER /**<UI Composer */
+ _MSG_COMPOSER, /**<UI Composer */
+ _MSG_CBS, /**<CB message */
+ _MSG_ETWS /**<ETWS message */
};
//
*/
// OAF headers
-#include <messages.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
+#include <app.h>
#include <FMsgWapPushManager.h>
#include <FBaseSysLog.h>
#include <FBase_StringConverter.h>
_WapPushManagerImpl::AddWapPushEventListener(const Tizen::Base::String& wapApplicationId, const IWapPushEventListener& listener)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
char* pWapAppId = null;
ClearLastResult();
// check value of msg handle
SysTryCatch(NID_MSG, __msgHandle > 0, r = E_SYSTEM, r, "failed to get msg handle.");
- err = messages_push_add_incoming_cb(__msgHandle, pWapAppId, &_SmsMmsCallbackHandler::IncomingWapPushMessageCallback, (void*) __pWapPushReceiveEvent);
+ err = msg_reg_push_message_callback(__msgHandle, &_SmsMmsCallbackHandler::IncomingWapPushMessageCallback, pWapAppId, (void*) __pWapPushReceiveEvent);
r = ConvertException(err);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to Add WapPush EventListener.", GetErrorMessage(r));
_WapPushManagerImpl::RemoveWapPushEventListener(const Tizen::Base::String& wapApplicationId, const IWapPushEventListener& listener)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
ClearLastResult();
- char* pWapAppId = null;
SysTryCatch(NID_MSG, __pWapPushReceiveEvent != null, r = E_OBJ_NOT_FOUND, r, "listner not found");
r = __pWapPushReceiveEvent->RemoveListener(listener);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "listner remove failed");
- pWapAppId = _StringConverter::CopyToCharArrayN(wapApplicationId);
- SysTryCatch(NID_MSG, pWapAppId != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
-
- err = messages_push_remove_incoming_cb(__msgHandle, pWapAppId);
-
- r = ConvertException(err);
- SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to Remove WapPush EventListener.", GetErrorMessage(r));
-
- if (pWapAppId)
- {
- delete[] pWapAppId;
- pWapAppId = null;
- }
-
if (__pWapPushReceiveEvent)
{
delete __pWapPushReceiveEvent;
return r;
CATCH:
- if (pWapAppId)
- {
- delete[] pWapAppId;
- pWapAppId = null;
- }
return r;
}
_WapPushManagerImpl::RegisterCondition(const Tizen::Base::String& wapApplicationId, const Tizen::Base::String& contentType)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
char* pWapAppId = null;
char* pContentType = null;
+ msg_struct_t pushInfo;
+ char* pPkgName = null;
ClearLastResult();
pContentType = _StringConverter::CopyToCharArrayN(contentType);
SysTryCatch(NID_MSG, pContentType != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
- err = messages_push_register(__msgHandle, pContentType, pWapAppId);
+ err = app_get_package(&pPkgName);
+ SysTryCatch(NID_MSG, err == APP_ERROR_NONE, r = E_SYSTEM, r, "[%s] Failed to Open Message Handle", GetErrorMessage(r));
+
+ pushInfo = msg_create_struct(MSG_STRUCT_PUSH_CONFIG_INFO);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_CONTENT_TYPE_STR, (char *)pContentType, MAX_WAPPUSH_CONTENT_TYPE_LEN);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_APPLICATON_ID_STR, (char *)pWapAppId, MAX_WAPPUSH_ID_LEN);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_PACKAGE_NAME_STR, pPkgName, MSG_FILEPATH_LEN_MAX);
+ free(pPkgName);
+
+ err = msg_add_push_event(__msgHandle, pushInfo);
+ msg_release_struct(&pushInfo);
r = ConvertException(err);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to register Condition for wap push.", GetErrorMessage(r));
return r;
CATCH:
+ free(pPkgName);
+ msg_release_struct(&pushInfo);
+
if (pWapAppId)
{
delete[] pWapAppId;
_WapPushManagerImpl::UnregisterCondition(const Tizen::Base::String& wapApplicationId, const Tizen::Base::String& contentType)
{
result r = E_SUCCESS;
- int err = MESSAGES_ERROR_NONE;
+ int err = MSG_SUCCESS;
char* pWapAppId = null;
char* pContentType = null;
+ msg_struct_t pushInfo;
+ char* pPkgName = null;
ClearLastResult();
pContentType = _StringConverter::CopyToCharArrayN(contentType);
SysTryCatch(NID_MSG, pContentType != null, r = E_OUT_OF_MEMORY, r, "memory allocation failed");
- err = messages_push_deregister(__msgHandle, pContentType, pWapAppId);
+ err = app_get_package(&pPkgName);
+ SysTryCatch(NID_MSG, err == APP_ERROR_NONE, r = E_SYSTEM, r, "[%s] Failed to Open Message Handle", GetErrorMessage(r));
+
+ pushInfo = msg_create_struct(MSG_STRUCT_PUSH_CONFIG_INFO);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_CONTENT_TYPE_STR, pContentType, MAX_WAPPUSH_CONTENT_TYPE_LEN);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_APPLICATON_ID_STR, pWapAppId, MAX_WAPPUSH_ID_LEN);
+ msg_set_str_value(pushInfo, MSG_PUSH_CONFIG_PACKAGE_NAME_STR, pPkgName, MSG_FILEPATH_LEN_MAX);
+ free(pPkgName);
+
+ err = msg_delete_push_event(__msgHandle, pushInfo);
+ msg_release_struct(&pushInfo);
r = ConvertException(err);
SysTryCatch(NID_MSG, r == E_SUCCESS, , r, "[%s] Failed to Unregister Condition for wap push", GetErrorMessage(r));
return r;
CATCH:
+ free(pPkgName);
+ msg_release_struct(&pushInfo);
+
if (pWapAppId)
{
delete[] pWapAppId;
switch (err)
{
- case MESSAGES_ERROR_NONE:
+ case MSG_SUCCESS:
r = E_SUCCESS;
break;
- case MESSAGES_ERROR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_PARAMETER:
+ case MSG_ERR_INVALID_MESSAGE:
+ case MSG_ERR_NULL_POINTER:
+ case MSG_ERR_NULL_MESSAGE:
r = E_INVALID_ARG;
break;
- case MESSAGES_ERROR_OUT_OF_MEMORY:
+ case MSG_ERR_MEMORY_ERROR:
r = E_OUT_OF_MEMORY;
break;
- case MESSAGES_ERROR_SERVER_NOT_READY: // Communication error between client and server
- case MESSAGES_ERROR_COMMUNICATION_WITH_SERVER_FAILED:
+ case MSG_ERR_SERVER_NOT_READY:
+ case MSG_ERR_TRANSPORT_ERROR:
+ case MSG_ERR_COMMUNICATION_ERROR:
r = E_NETWORK_UNAVAILABLE;
break;
- case MESSAGES_ERROR_NO_SIM_CARD:
+ case MSG_ERR_NO_SIM:
r = E_DEVICE_UNAVAILABLE;
break;
- case MESSAGES_ERROR_OUT_OF_RANGE:
- r = E_OBJ_ALREADY_EXIST;
- break;
-
- case MESSAGES_ERROR_SENDING_FAILED:
- case MESSAGES_ERROR_OPERATION_FAILED:
+ case MSG_ERR_PLUGIN_TAPI_FAILED:
r = E_FAILURE;
break;
_WapPushManagerImpl& operator =(const _WapPushManagerImpl& rhs);
private:
- messages_service_h __msgHandle;
+ msg_handle_t __msgHandle;
_SmsEvent* __pWapPushReceiveEvent;
}; // _WapPushManagerImpl
* This file contains the implementation of the %__WapPushMessageImpl class.
*/
-#include <messages.h>
+#include <msg.h>
+#include <msg_transport.h>
+#include <msg_storage.h>
#include <FMsgWapPushMessage.h>
#include <FBaseByteBuffer.h>
#include <FBaseSysLog.h>