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.
19 #ifndef _PLATFORM_MEDIA_CONTENT_H_
20 #define _PLATFORM_MEDIA_CONTENT_H_
24 #include "API/Mediacontent/IMediacontent.h"
25 #include "API/Mediacontent/IEventFindFolder.h"
26 #include "API/Mediacontent/IEventFindMedia.h"
27 #include "API/Mediacontent/IEventUpdateMedia.h"
29 #include <API/Mediacontent/MediacontentImage.h>
30 #include <API/Mediacontent/MediacontentVideo.h>
31 #include <API/Mediacontent/MediacontentAudio.h>
32 #include <API/Mediacontent/MediacontentLyrics.h>
37 #define MEDIA_DB_PATH "/opt/dbspace/.media.db"
38 typedef struct _media_folder_s
48 using namespace TizenApis::Api::Mediacontent;
53 namespace Mediacontent {
55 class Mediacontent : public Api::Mediacontent::IMediacontent
60 virtual ~Mediacontent();
63 virtual void OnRequestReceived(const IEventFindMediaPtr &ptr);
64 virtual void OnRequestReceived(const IEventFindFolderPtr &ptr);
65 virtual void OnRequestReceived(const IEventUpdateMediaPtr &ptr);
68 void convertToPlatformFolder(folder_s &media_folder, MediacontentFolderPtr& newFolder);
69 void readImageFromDB(sqlite3_stmt* pStmt, MediacontentImage* newImage);
70 void readVideoFromDB(sqlite3_stmt* pStmt, MediacontentVideo* newVideo);
71 void readAudioFromDB(sqlite3_stmt* pStmt, MediacontentAudio* newAudio);
72 tm toDateTm(time_t date);
74 string makeQuerySortMode(SortModeArrayPtr attr);
78 int db_connnect_count;
87 #endif /* _PLATFORM_MEDIA_CONTENT_H_ */