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"
28 #include "API/Mediacontent/IEventUpdateMediaItems.h"
31 #include <API/Mediacontent/MediacontentImage.h>
32 #include <API/Mediacontent/MediacontentVideo.h>
33 #include <API/Mediacontent/MediacontentAudio.h>
34 #include <API/Mediacontent/MediacontentLyrics.h>
39 #define MEDIA_DB_PATH "/opt/dbspace/.media.db"
40 typedef struct _media_folder_s
50 using namespace TizenApis::Api::Mediacontent;
55 namespace Mediacontent {
57 class Mediacontent : public Api::Mediacontent::IMediacontent
62 virtual ~Mediacontent();
65 virtual void OnRequestReceived(const IEventFindMediaPtr &ptr);
66 virtual void OnRequestReceived(const IEventFindFolderPtr &ptr);
67 virtual void OnRequestReceived(const IEventUpdateMediaPtr &ptr);
68 virtual void OnRequestReceived(const IEventBrowseFolderPtr &ptr);
69 virtual void OnRequestReceived(const IEventUpdateMediaItemsPtr &ptr);
72 void convertToPlatformFolder(folder_s &media_folder, MediacontentFolderPtr& newFolder);
73 void readImageFromDB(sqlite3_stmt* pStmt, MediacontentImage* newImage);
74 void readVideoFromDB(sqlite3_stmt* pStmt, MediacontentVideo* newVideo);
75 void readAudioFromDB(sqlite3_stmt* pStmt, MediacontentAudio* newAudio);
76 bool updateMediaToDB(MediacontentMediaPtr mediaPtr);
77 tm toDateTm(time_t date);
79 string makeQuerySortMode(SortModeArrayPtr attr);
83 int db_connnect_count;
92 #endif /* _PLATFORM_MEDIA_CONTENT_H_ */