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.
17 * StorageChangesConversationGenerator.h
19 * Created on: 2011. 10. 28.
23 #ifndef STORAGECHANGESCONVERSATIONGENERATOR_H_
24 #define STORAGECHANGESCONVERSATIONGENERATOR_H_
26 #include <API/Filter/IFilterVisitor.h>
27 #include <API/Filter/SortMode.h>
28 #include <API/Messaging/IMessaging.h>
37 // using namespace std;
39 class StorageChangesConversationGenerator: public TizenApis::Api::Tizen::IFilterVisitor{
47 operandIntersection = 4
50 StorageChangesConversationGenerator(Api::Messaging::IConversationPtr conv);
51 virtual ~StorageChangesConversationGenerator();
53 void visitPreComposite(Api::Tizen::FilterType& type, int depth);
54 void visitInComposite(Api::Tizen::FilterType& type, int depth);
55 void visitPostComposite(Api::Tizen::FilterType& type, int depth);
56 void visitAttribute(std::string& attrName,
57 Api::Tizen::AnyArrayPtr& values, std::string& matchFlag, bool caseSensitive, int depth);
59 void visitAttributeRange(std::string& attrName, Api::Tizen::AnyPtr& initialValue, Api::Tizen::AnyPtr& endValue, int depth);
61 bool getMatchFlagResult(Api::Tizen::AnyPtr& value, std::string& valueString, std::string& matchFlag);
62 bool getCompareResult();
65 bool getMatchExactlyClause(std::string& attrName, Api::Tizen::AnyPtr& value);
66 bool getMatchContainsClause(std::string& attrName, Api::Tizen::AnyPtr& value);
67 bool getMatchStartwithClause(std::string& attrName, Api::Tizen::AnyPtr& value);
68 bool getMatchEndwithClause(std::string& attrName, Api::Tizen::AnyPtr& value);
69 bool getBetweenRangeClause(struct tm initialValue, struct tm endValue);
71 void visitAttributeEach(std::string& attrName, Api::Tizen::AnyPtr& value, std::string& matchFlag, int depth);
72 int convertMessageType(std::string& stringType);
73 std::string convertBooleanStringToIntegerString(std::string& booleanString);
75 struct tm convertToTimeFormat(const std::string& timeString);
76 std::string createTimeString(std::string& timeString);
77 std::string createFolderType(std::string& value);
78 std::string createPriorityType(std::string& value);
79 std::string createDateTimeType(Api::Tizen::AnyPtr& value);
84 std::vector<std::string> typeVector;
85 std::map<std::string, std::string> attributeMap;
87 std::vector<bool> m_result;
88 std::vector<int> m_operand;
91 unsigned short int m_type;
93 unsigned long m_messageCount;
94 unsigned long m_unreadMessages;
95 std::string m_preview;
98 std::string m_subject;
99 std::vector<std::string> m_to;
100 std::vector<std::string> m_cc;
101 std::vector<std::string> m_bcc;
102 unsigned int m_lastMessageId;
104 Api::Messaging::RecipientsPtr Recipents;
105 std::string m_currentType;
107 static const std::string STRING_MATCH_EXCACTLY;
108 static const std::string STRING_MATCH_CONTAINS;
109 static const std::string STRING_MATCH_STARTSWITH;
110 static const std::string STRING_MATCH_ENDSWITH;
111 static const std::string STRING_MATCH_CASESENSITIVE;
113 static const int MESSAGE_TYPE_NOT_INITIALIZED;
117 typedef DPL::SharedPtr<StorageChangesConversationGenerator> StorageChangesConversationGeneratorPtr;
118 } // namespace Platform
119 } // namespace WrtPlugins
121 #endif /* MESSAGEQUERYGENERATOR_H_ */