2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_CONTENT_HELPER_H__
19 #define __TIZEN_CONTENT_HELPER_H__
23 #include <media_content.h>
24 //#include <IFilter.h>
25 //#include <SortMode.h>
28 #include "ContentDirectory.h"
29 #include "ImageContent.h"
30 #include "VideoContent.h"
31 #include "AudioContent.h"
37 const guint G_IDLE_FAILED = 0;
45 virtual ~ContentHelper();
46 static bool Connect();
47 static bool DisConnect();
49 static int getCallbackCompleted(void *data);
50 static int getCallbackCanceled(void *data);
52 static gboolean getDirectoryWork(void* data);
53 static bool getDirectoryCallback(media_folder_h folder, void *user_data);
55 static gboolean findWork(void* data);
56 static bool findCallback(media_info_h info, void *user_data);
58 static gboolean scanFileWork(void* data);
60 static bool update(ContentPtr content);
62 static gboolean updateBatchWork(void* content);
64 static void changeCallbackWork(
65 media_content_error_e error,
67 media_content_db_update_item_type_e update_item,
68 media_content_db_update_type_e update_type,
69 media_content_type_e media_type,
78 static int get_utc_offset();
79 static bool loadContent(media_info_h info, void* user_data);
80 static bool updateContentToPlatform(ContentPtr content);
81 static void loadContentFromPlatform(media_info_h info, ContentPtr content);
82 static ImageContentPtr loadImageContentFromPlatform(media_info_h info,
83 ImageContentPtr image);
84 static VideoContentPtr loadVideoContentFromPlatform(media_info_h info,
85 VideoContentPtr video);
86 static AudioContentPtr loadAudioContentFromPlatform(media_info_h info,
87 AudioContentPtr audio);
89 friend class Playlist;
90 friend class JSPlaylistItem;
96 #endif // __TIZEN_CONTENT_DIRECTORY_H__