3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
5 * This file is part of msg-service.
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 * Sangkoo Kim <sangkoo.kim@samsung.com>
9 * Seunghwan Lee <sh.cat.lee@samsung.com>
10 * SoonMin Jung <sm0415.jung@samsung.com>
11 * Jae-Young Lee <jy4710.lee@samsung.com>
12 * KeeBum Kim <keebum.kim@samsung.com>
14 * PROPRIETARY/CONFIDENTIAL
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
34 * @brief Defines function for test application of messaging framework
38 #ifndef MSG_TEST_MAIN_H
39 #define MSG_TEST_MAIN_H
43 * @section Introduction
44 * - This document includes as follows : \n
45 * What is Messaging API \n
46 * What are included in Messaging API, such as data types, functions, and so on \n
57 * MAPI provides a service to send, receive, parse and assemble messages over arbitrary message delivery mechanisms such as SMS, MMS, and E-mail.
58 * Messaging Service consists of a collection of common functionality and sets of service specific functionality.
59 * Use of particular messaging service specific functionality shall be possible.
60 * MAPI provides a collection of data structures as well as functions to implement the functionality. \n\n
61 * The data structures and functions are grouped into modules, as listed below:
62 * - Message sending and reception
63 * - Storage management
68 * A message represents a generic data collection of SMS, MMS, and E-mail.
69 * This is not specific to any service, but supports the extension of this structure.
70 * For service specific message, please refer to extendability of common structure.
71 * Each message has a unique message ID in the entire messaging framework.
72 * The message information can be retrieved from the storage by its message ID. \n\n
73 * This concept is defined in MsgTypes.h. \n\n
75 * A folder represents a container of messages.
76 * Each folder has a unique folder ID in the entire messaging framework.
77 * The folder information can be retrieved from the storage by its folder ID.
78 * A folder can specify where it is stored.
79 * The storage where a folder is stored can be different from the storage where its containing messages are stored. \n\n
80 * This concept is defined in MsgStorageTypes.h. \n\n
81 * @section MessageHandle
82 * MessageHandle is the connection between application and MAPI.
83 * When an application wants to send, receive, add, or get a message, it must open a MessageHandle first.
84 * To know how to use asynchronous callback for communication between application and framework, please refer to Callback. \n\n
85 * A MessageHandle can be assigned with following information: \n
86 * - Register MsgOnMessageIncomingCallback function.
87 * - Register MsgOnStatusChangedCallback function.
90 * A request contains the information that is used to command framework for services, such as sending a message.
91 * A request is sent to Messaging Framework via a MessageHandle, and Messaging Framework chooses proper plugin to handle the request.
92 * A common usage for the request is to send a message. \n\n
93 * This concept is defined in MsgTypes.h. \n\n
95 * Callback is used by application to detect incoming message and underlayer status change.
96 * Two callback functions are implemented by applications and should be bound to a MessageHandle.
97 * Both prototypes are provided: \n
98 * - One is MsgOnMessageIncomingCallback, which is to listen incoming message.
99 * - The other is MsgOnStatusChangedCallback, which is to listen underlayer status change.
101 * When an application is only interested in some kinds of messages, filter list is used to filter these specific messages and return them to the application.
102 * Noted that filter is for filtering incoming messages, not a storage concept.
103 * Filter is the basic unit to set the rules, it tells the filter service how to filter the message.
104 * Filter list is composed of various filters. \n\n
105 * They are defined in MsgFilterTypes.h. \n\n
106 * Application can set a filter list for a MessageHandle to get the interesting message.
107 * Please refer to MSG_FILTER_S and MSG_FILTER_LIST_S for details.
108 * MAPI does NOT define any filters.
109 * Application developers should refer to the specific implementation of filter service to get the supported filters.
111 * Storage is a collection of messages and related information that are stored on one storage media.
112 * Storage media is the physical data storage device, such as SD card and Flash.
113 * One storage media can have more than one storages.
114 * Since storage media can be removable, the storages on the media can be detached and attached dynamically.
115 * For instance, user plugs out SD card from UE 1 and plugs in this card into UE 2, all the messages stored in this card will be hidden from UE 1 and be visible to UE 2.
116 * For details information, please refer to MSG_STORAGE_LIST_S.
117 * Application can query supported storages by MAPI method MsgGetStorageList.
118 * @section Extendability
119 * There are several structures in LiMo Messageing designed to be extended. They are: \n
120 * - MSG_FOLDER_INFO_S
125 /*==================================================================================================
127 ==================================================================================================*/
129 #include <sys/types.h>
132 #include <sys/time.h>
135 #include "MsgTypes.h"
137 #define TEST_APP_PIRNT_STR_LEN 128
140 * @ingroup MESSAGING_FRAMEWORK
141 * @defgroup MESSAGING_TEST_APPLICATION_BASIC_FUNCTION Messaging Test Application Basic Function
146 /*==================================================================================================
148 ==================================================================================================*/
149 #define MSG_FATAL(fmt, ...) \
152 printf("\n[%d] [MSGFW: %s: %s(): %d] *FAILED* << " fmt" >>\n", get_tid(), rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
155 #define MSG_DEBUG(fmt, ...) \
158 printf("\n[%d] [MSGFW: %s: %s(): %d] " fmt"\n", get_tid(), rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__);\
161 #define MSG_BEGIN() \
164 printf("\n[%d] BEGIN >>>> %s() at [MSGFW: %s: %d]\n", get_tid(),__FUNCTION__, rindex(__FILE__, '/')+1, __LINE__ );\
170 printf("\n[%d] END <<<< %s() at [MSGFW: %s: %d]\n", get_tid(), __FUNCTION__, rindex(__FILE__, '/')+1, __LINE__); \
175 /*==================================================================================================
177 ==================================================================================================*/
179 void print(const char* string);
188 /** @fn MSG_ERROR_T init_app()
189 * @brief Initializes a test application.
190 * @return MSG_ERROR_T
191 * @retval MSG_SUCCESS Success in operation. \n
192 * @retval MSG_ERR_NULL_POINTER pMsg is NULL. \n
193 * @retval MSG_ERR_MEMORY_ERROR Memory is error. \n
194 * @retval MSG_ERR_INVALID_MSGHANDLE Message handle is invalid. \n
195 * @retval MSG_ERR_INVALID_PARAMETER Parameter is invalid. \n
197 MSG_ERROR_T init_app();
200 /** @fn void show_menu()
201 * @brief Shows folder information and the test menu list.
203 void* show_menu(void*);
206 /** @fn void run_app(char menu)
207 * @brief Runs a selected menu in the test menu list.
208 * @param[in] Menu indicates which menu is selected.
210 void run_app(char *pMenu);
216 #endif //MSG_TEST_MAIN_H