3f75d6a52493e498bdf6e7b4a191ee3441ec0416
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Messaging / StorageChangesConversationFilterValidatorFactory.cpp
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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. 
15 */
16 /*
17  * StorageChangesConversationFilterValidatorFactory.cpp
18  *
19  *  Created on: 2011. 10. 27.
20  *      Author: sangtai
21  */
22
23 #include "StorageChangesConversationFilterValidatorFactory.h"
24
25 using namespace TizenApis::Api::Tizen;
26
27 namespace TizenApis {
28         namespace Platform {
29                 namespace Messaging {
30
31                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TYPE             = "type";
32                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TIMESTAMP        = "timestamp";
33                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_MESSAGE_COUNT    = "messageCount";
34                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_UNREAD_MESSAGES  = "unreadMessages";
35                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_PREVIEW          = "preview";
36                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_IS_READ          = "isRead";
37                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_FROM             = "from";
38                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TO               = "to";
39                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_CC               = "cc";
40                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_BCC              = "bcc";
41                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_SUBJECT          = "subject";
42                 const std::string StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_LAST_MESSAGE_ID  = "lastMessageId";
43
44                 static PropertyStructArray properties =
45                 {
46                                 {"type",             Api::Tizen::PrimitiveType_String},
47                                 {StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TIMESTAMP.c_str(), Api::Tizen::PrimitiveType_Time},
48                                 {"messageCount",         Api::Tizen::PrimitiveType_Number},
49                                 {"unreadMessages",       Api::Tizen::PrimitiveType_Number},
50                                 {"preview",                      Api::Tizen::PrimitiveType_String},
51                                 {"isRead",                       Api::Tizen::PrimitiveType_Number},
52                                 {"from",             Api::Tizen::PrimitiveType_String},
53                                 {"to",               Api::Tizen::PrimitiveType_String},
54                                 {"cc",               Api::Tizen::PrimitiveType_String},
55                                 {"bcc",              Api::Tizen::PrimitiveType_String},
56                                 {"subject",          Api::Tizen::PrimitiveType_String},
57                                 {"lastMessageId",        Api::Tizen::PrimitiveType_String},                             
58                                 {0,                  Api::Tizen::PrimitiveType_Notype}
59                 };
60
61                 static MatchFlagStrArray matchFlag{
62                         "EXACTLY",
63                         "CONTAINS",
64                         "STARTSWITH",
65                         "ENDSWITH",
66                         0
67                 };
68
69                 StorageChangesConversationFilterValidatorPtr StorageChangesConversationFilterValidatorFactory::getStorageChangesConversationFilterValidator()
70                 {
71                     static StorageChangesConversationFilterValidatorPtr theInstance =
72                                 StorageChangesConversationFilterValidatorPtr(new StorageChangesConversationFilterValidator(properties, matchFlag, Api::Tizen::PrimitiveType_Int));
73
74                     return theInstance;
75                 }
76
77                 }
78         }       //naspace Platform
79 } //naspace WrtPlugins