tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / Gallery / IMediaItem.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @author      Wojciech Bielawski (w.bielawski@samsung.com)
18  * @version     0.1
19  * @brief
20  */
21
22 #ifndef WRT_PLUGINS_IMEDIA_ITEM_H_
23 #define WRT_PLUGINS_IMEDIA_ITEM_H_
24
25 #include <string>
26 #include <list>
27 #include <dpl/shared_ptr.h>
28 #include <dpl/log/log.h>
29
30 namespace WrtPlugins {
31 namespace Api {
32 namespace Gallery {
33 class IMediaItem
34 {
35   public:
36     typedef enum
37     {
38         AUDIO,
39         VIDEO,
40         IMAGE,
41         UNDEFINED
42     } MediaType;
43
44   private:
45     unsigned long m_id;
46     MediaType m_type;
47     std::string m_mimeType;
48     std::string m_fileName;
49     unsigned long m_date;
50
51   public:
52     IMediaItem() : m_id(0),
53         m_type(UNDEFINED),
54         m_date(0)
55     {
56     }
57     virtual ~IMediaItem()
58     {
59     }
60
61     virtual const std::string   &getFileName() const
62     {
63         return m_fileName;
64     }
65     virtual unsigned long       getId() const
66     {
67         return m_id;
68     }
69     virtual const std::string   &getMimeType() const
70     {
71         return m_mimeType;
72     }
73     virtual MediaType           getType() const
74     {
75         return m_type;
76     }
77     virtual unsigned long       getDate() const
78     {
79         return m_date;
80     }
81
82     virtual void setFileName(const std::string &fileName)
83     {
84         m_fileName = fileName;
85     }
86     virtual void setId(unsigned long id)
87     {
88         m_id = id;
89     }
90     virtual void setMimeType(const std::string &mimeType)
91     {
92         m_mimeType = mimeType;
93     }
94     virtual void setType(MediaType type)
95     {
96         m_type = type;
97     }
98     virtual void setDate(unsigned long date)
99     {
100         m_date = date;
101     }
102 };
103
104 typedef DPL::SharedPtr<IMediaItem> IMediaItemPtr;
105 typedef std::list<IMediaItemPtr> IMediaItemsSet;
106 typedef DPL::SharedPtr<IMediaItemsSet> IMediaItemsSetPtr;
107 typedef std::list<IMediaItemPtr>::iterator IMediaItemsSetIterator;
108 typedef std::list<IMediaItemPtr>::const_iterator IMediaItemsSetConstIterator;
109 } // Gallery
110 } // Api
111 } // WrtPlugins
112
113 #endif //WRT_PLUGINS_IMEDIA_ITEM_H_