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 * StorageChangesFolderGenerator.h
19 * Created on: 2011. 10. 28.
23 #ifndef STORAGECHANGESFOLDERGENERATOR_H_
24 #define STORAGECHANGESFOLDERGENERATOR_H_
26 #include <API/Filter/IFilterVisitor.h>
27 #include <API/Filter/SortMode.h>
28 #include <API/Messaging/IMessaging.h>
38 // using namespace std;
40 class StorageChangesFolderGenerator: public TizenApis::Api::Tizen::IFilterVisitor{
48 operandIntersection = 4
51 StorageChangesFolderGenerator(Api::Messaging::IMessageFolderPtr conv);
52 virtual ~StorageChangesFolderGenerator();
54 void visitPreComposite(Api::Tizen::FilterType& type, int depth);
55 void visitInComposite(Api::Tizen::FilterType& type, int depth);
56 void visitPostComposite(Api::Tizen::FilterType& type, int depth);
57 void visitAttribute(std::string& attrName,
58 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);
60 bool getMatchFlagResult(Api::Tizen::AnyPtr& value, std::string& valueString, std::string& matchFlag);
61 bool getCompareResult();
64 bool getMatchExactlyClause(std::string& attrName, Api::Tizen::AnyPtr& value);
65 bool getMatchContainsClause(std::string& attrName, Api::Tizen::AnyPtr& value);
66 bool getMatchStartwithClause(std::string& attrName, Api::Tizen::AnyPtr& value);
67 bool getMatchEndwithClause(std::string& attrName, Api::Tizen::AnyPtr& value);
69 void visitAttributeEach(std::string& attrName, Api::Tizen::AnyPtr& value, std::string& matchFlag, int depth);
70 int convertMessageType(std::string& stringType);
71 int convertFolderType(std::string& stringType);
77 std::vector<std::string> typeVector;
78 std::map<std::string, std::string> attributeMap;
80 std::vector<bool> m_result;
81 std::vector<int> m_operand;
84 unsigned long m_parentid;
85 unsigned long m_accountid;
86 // Api::Messaging::MessageType m_contestType;
87 unsigned short m_contestType;
90 // Api::Messaging::FolderType m_type;
91 unsigned short m_type;
92 bool m_synchronizable;
94 static const std::string STRING_MATCH_EXCACTLY;
95 static const std::string STRING_MATCH_CONTAINS;
96 static const std::string STRING_MATCH_STARTSWITH;
97 static const std::string STRING_MATCH_ENDSWITH;
98 static const std::string STRING_MATCH_CASESENSITIVE;
100 static const int MESSAGE_TYPE_NOT_INITIALIZED;
104 typedef DPL::SharedPtr<StorageChangesFolderGenerator> StorageChangesFolderGeneratorPtr;
105 } // namespace Platform
106 } // namespace WrtPlugins
108 #endif /* MESSAGEQUERYGENERATOR_H_ */