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.
18 #ifndef _PLATFORM_MEDIA_CONTENT_SEARCH_VISITOR_H_
19 #define _PLATFORM_MEDIA_CONTENT_SEARCH_VISITOR_H_
23 #include <dpl/shared_ptr.h>
24 #include <API/Filter/IFilter.h>
25 #include <API/Filter/IFilterVisitor.h>
26 #include <API/Filter/SortMode.h>
28 #include <API/Mediacontent/IMediacontent.h>
30 using namespace TizenApis::Api::Tizen;
31 using namespace WrtDeviceApis::Commons;
38 namespace Mediacontent {
46 GREATER_THAN_OR_EQUAL,
53 static string operatorKey[] =
64 class MediaSearchVisitor : public TizenApis::Api::Tizen::IFilterVisitor
67 typedef enum _QueryType { QUERY_FOLDER, QUERY_MEDIA } QueryType;
71 virtual ~MediaSearchVisitor();
73 virtual void visitPreComposite(FilterType& type, int depth);
74 virtual void visitInComposite(FilterType& type, int depth);
75 virtual void visitPostComposite(FilterType& type, int depth);
76 virtual void visitAttribute(string& attrName, MatchFlag& matchFlag, AnyArrayPtr& matchValues, int depth);
77 virtual void visitAttributeRange(string& attrName,AnyPtr& initialValue,AnyPtr& endValue,int depth);
79 string getPlatformAttr(string attrName);
80 string getResult() const;
82 void setQueryType(QueryType value);
85 string toDateDbStr(const tm &date) const;
86 string convertAttribute(string &attrname, AnyPtr& matchValue, MatchFlag& matchFlag);
91 static map<string, string> attrFolderEnumMap;
92 static map<string, string> attrMediaEnumMap;
96 typedef DPL::SharedPtr<MediaSearchVisitor> MediaSearchVisitorPtr;
102 #endif // _PLATFORM_MEDIA_CONTENT_SEARCH_VISITOR_H_