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, Api::Tizen::MatchFlag& matchFlag,
58 Api::Tizen::AnyPtr& matchValue, 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, Api::Tizen::MatchFlag& matchFlag);
61 bool getCompareResult();
64 bool getMatchExactlyClause(std::string& attrName, Api::Tizen::AnyPtr& value);
65 bool getMatchFullstringClause(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 getMatchExistClause(std::string& attrName);
71 void visitAttributeEach(std::string& attrName, Api::Tizen::MatchFlag& matchFlag, Api::Tizen::AnyPtr& value, int depth);
72 int convertMessageType(std::string& stringType);
73 int convertFolderType(std::string& stringType);
75 void StrLowChange(std::string& tempString);
80 std::vector<std::string> typeVector;
81 std::map<std::string, std::string> attributeMap;
83 std::vector<bool> m_result;
84 std::vector<int> m_operand;
87 unsigned long m_parentid;
88 unsigned long m_accountid;
89 // Api::Messaging::MessageType m_contestType;
90 unsigned short m_contestType;
93 // Api::Messaging::FolderType m_type;
94 unsigned short m_type;
95 bool m_synchronizable;
97 static const int MESSAGE_TYPE_NOT_INITIALIZED;
101 typedef DPL::SharedPtr<StorageChangesFolderGenerator> StorageChangesFolderGeneratorPtr;
102 } // namespace Platform
103 } // namespace WrtPlugins
105 #endif /* MESSAGEQUERYGENERATOR_H_ */