7367c1d313eb5888ab287776197f7b9de9b7901f
[platform/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     virtual ~IMediaItem()
57     {}
58
59     virtual const std::string   &getFileName() const
60     {
61         return m_fileName;
62     }
63     virtual unsigned long       getId() const
64     {
65         return m_id;
66     }
67     virtual const std::string   &getMimeType() const
68     {
69         return m_mimeType;
70     }
71     virtual MediaType           getType() const
72     {
73         return m_type;
74     }
75     virtual unsigned long       getDate() const
76     {
77         return m_date;
78     }
79
80     virtual void setFileName(const std::string &fileName)
81     {
82         m_fileName = fileName;
83     }
84     virtual void setId(unsigned long id)
85     {
86         m_id = id;
87     }
88     virtual void setMimeType(const std::string &mimeType)
89     {
90         m_mimeType = mimeType;
91     }
92     virtual void setType(MediaType type)
93     {
94         m_type = type;
95     }
96     virtual void setDate(unsigned long date)
97     {
98         m_date = date;
99     }
100 };
101
102 typedef DPL::SharedPtr<IMediaItem> IMediaItemPtr;
103 typedef std::list<IMediaItemPtr> IMediaItemsSet;
104 typedef DPL::SharedPtr<IMediaItemsSet> IMediaItemsSetPtr;
105 typedef std::list<IMediaItemPtr>::iterator IMediaItemsSetIterator;
106 typedef std::list<IMediaItemPtr>::const_iterator IMediaItemsSetConstIterator;
107 } // Gallery
108 } // Api
109 } // WrtPlugins
110
111 #endif //WRT_PLUGINS_IMEDIA_ITEM_H_