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 #include "MediaFilterValidator.h"
19 #include <dpl/log/log.h>
23 namespace Mediacontent{
25 static PropertyStructArray folderProperties =
27 {"id", PrimitiveType_String},
28 {"folderURL", PrimitiveType_String},
29 {"storageType", PrimitiveType_String},
30 {"title", PrimitiveType_String},
31 {"modifiedDate", PrimitiveType_Time},
32 {0, PrimitiveType_NoType}
35 static PropertyStructArray mediaProperties =
37 {"folder.id", PrimitiveType_String},
38 {"folder.title", PrimitiveType_String},
39 {"folder.folderURL", PrimitiveType_String},
40 {"folder.storageType", PrimitiveType_String},
41 {"id", PrimitiveType_String},
42 {"type", PrimitiveType_String},
43 {"mimeType", PrimitiveType_String},
44 {"title", PrimitiveType_String},
45 {"fileURL", PrimitiveType_String},
46 {"thumbnailURL", PrimitiveType_String},
47 {"description", PrimitiveType_String},
48 {"rating", PrimitiveType_Int},
49 {"fileURL", PrimitiveType_String},
50 {"createdDate", PrimitiveType_Time},
51 {"releasedDate", PrimitiveType_Time},
52 {"modifiedDate", PrimitiveType_Time},
53 {"geolocation.latitude", PrimitiveType_Double},
54 {"geolocation.longitude", PrimitiveType_Double},
55 {"album", PrimitiveType_String},
56 {"artist", PrimitiveType_String},
57 {"width", PrimitiveType_String},
58 {"height", PrimitiveType_String},
59 {"playedTime", PrimitiveType_Long},
60 {"playCount", PrimitiveType_Long},
61 {"genre", PrimitiveType_String},
62 {"artist", PrimitiveType_String},
63 {0, PrimitiveType_NoType}
66 FilterValidatorPtr MediaFilterValidatorFactory::getMediaFilterValidator(QueryType value)
68 static FilterValidatorPtr theFolderInstance;
69 static FilterValidatorPtr theMediaInstance;
71 if(value == QUERY_FOLDER)
73 theFolderInstance = FilterValidatorPtr(new FilterValidator(folderProperties));
74 return theFolderInstance;
76 else if(value == QUERY_MEDIA)
78 theMediaInstance = FilterValidatorPtr(new FilterValidator(mediaProperties));
79 return theMediaInstance;