2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 * @file MessageFactory.h
22 * @author Pawel Misiak (p.misiak@samsung.com)
26 #ifndef MESSAGEFACTORY_H
27 #define MESSAGEFACTORY_H
30 #include "IMessaging.h"
32 #include "EmailAccountInfo.h"
38 //--------------------------------------------------------------------------
45 * Generate message specyfied type
46 * @param[in] msgType type of message to create
47 * @param[in] id if id is set, then is trying to read existing message
48 * from storage by specyfid if
50 static IMessagePtr createMessage(const MessageType msgType,
51 const std::string& id = "");
54 * Generate message specyfied type
55 * @param[in] msgType type of message to create
57 * from storage by specyfid if
59 static IMessagePtr createMessage(const MessageType msgType,
63 * Generate message specyfied type
64 * @param[in] msgType type of message to create
65 * @param[in] account of mail.
67 static IMessagePtr createMessage(const MessageType msgType,
68 Api::Messaging::EmailAccountInfo& account, const std::string& id = "" );
70 static IMessagePtr createEmailMessage ( const int accountId, const int id = 0 );
72 static IMessagePtr createEmailMessage();
75 * Generate virtual message specyfied type, without platform projection
76 * @param[in] msgType type of message to create
78 static IMessagePtr createVirtualMessage();
81 * Convert abstract message (IMessage) to virtual message
82 * @param[in] msg - pointer to message to convert
83 * @throw ConversionException if conversion fail
85 static VirtualMessagePtr convertToVirtualMessage(IMessagePtr msg);
88 * Convert abstract message (IMessage) to abstract sms (ISms)
89 * @param[in] msg - pointer to message to convert
90 * @throw ConversionException if conversion fail
92 static ISmsPtr convertToSms(IMessagePtr msg);
95 * Convert abstract message (IMessage) to abstract binary sms (IBinarySms)
96 * @param[in] msg - pointer to message to convert
97 * @throw ConversionException if conversion fail
99 static IBinarySmsPtr convertToBinarySms(IMessagePtr msg);
102 * Convert abstract message (IMessage) to abstract Mms (IMms)
103 * @param[in] msg - pointer to message to convert
104 * @throw ConversionException if conversion fail
106 static IMmsPtr convertToMms(IMessagePtr msg);
109 * Convert abstract message (IMessage) to abstract email (IEmail)
110 * @param[in] msg - pointer to message to convert
111 * @throw ConversionException if conversion fail
113 static IEmailPtr convertToEmail(IMessagePtr msg);