e164fa855ec49f80673e8d85d1e5758a9cacc3f8
[framework/web/wrt-plugins-tizen.git] / src / Content / ContentMedia.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 #ifndef _ABSTRACT_LAYER_CONTENT_MEDIA_H_
20 #define _ABSTRACT_LAYER_CONTENT_MEDIA_H_
21
22 #include <ctime>
23 #include <string>
24 #include <vector>
25 #include <dpl/optional.h>
26 #include <dpl/shared_ptr.h>
27
28 using namespace std;
29
30 namespace DeviceAPI {
31 namespace Content {
32
33 typedef enum 
34 {
35         MEDIA_TYPE_IMAGE        = 1,
36         MEDIA_TYPE_VIDEO        = 2,
37         MEDIA_TYPE_AUDIO        = 3,
38         MEDIA_TYPE_UNKOWN       = 4,
39 }media_type;
40
41
42 typedef vector<std::string> EditableAttributeList;
43 typedef DPL::SharedPtr<EditableAttributeList> EditableAttributeListPtr;
44
45 typedef vector<std::string> StringArray;
46 typedef DPL::SharedPtr<StringArray> StringArrayPtr;
47
48 class MediacontentMedia
49 {
50         public:
51
52         MediacontentMedia();
53         virtual ~MediacontentMedia();
54
55         virtual string getMediaUUID() const;
56         virtual string getMediaType() const;
57         virtual string getMimeType();
58         virtual string getDisplayName() const;
59         virtual string getTitle() const;
60         virtual string getFilePath() const;
61         virtual string getThumbnailPath() const;
62         virtual tm getCreatedDate() const;
63         virtual tm getReleasedDate() const;
64         virtual tm getModifiedDate() const;
65         virtual string getDescription() const;  
66         virtual bool getFavorite() const;
67         virtual unsigned long long getSize() const;
68         virtual int getRating() const;
69
70         bool getIsChangedFavorite() const;
71         bool isChangedRating() const;
72         bool isChangedDisplayName() const;
73         bool isChangedDescription() const;
74
75         virtual void setMediaUUID(const string &value);
76         virtual void setMediaType(const string &value);
77         virtual void setMimeType(const string &value);
78         virtual void setDisplayName(const string &value, bool isChanged=false);
79         virtual void setTitle(const string &value);
80         virtual void setFilePath(const string &value);
81         virtual void setThumbnailPath(const string &value);
82         virtual void setCreatedDate(const tm &value);
83         virtual void setReleasedDate(const tm &value);
84         virtual void setModifiedDate(const tm &value);  
85         virtual void setFavorite( bool value);
86         virtual void setDescription(const string &value, bool isChanged=false);
87         virtual void setSize(unsigned long long value);
88         virtual void setRating(int value, bool isChanged=false);
89
90         void display() const;
91         virtual vector<std::string>     getEditableAttr() const;
92
93         private:
94         string m_mediaUUID;
95         string m_mediaType;
96         string m_mimeType;
97         string m_displayName;
98         string m_title;
99         string m_filePath;
100         string m_thumbnailPath;
101         string m_description;
102         tm m_createdDate;
103         tm m_releasedDate;
104         tm m_modifiedDate;
105         unsigned long long m_size;
106         int m_rating;
107         bool m_favorite;  //unused.
108         bool m_isChangedFavorite;
109         bool m_isChangedRating;
110         bool m_isChangedDisplayName;
111         bool m_isChangedDescription;
112         
113         protected:
114         vector<std::string> m_editableAttrList;
115
116 };
117
118
119 typedef DPL::SharedPtr<MediacontentMedia> MediacontentMediaPtr;
120 typedef std::vector<MediacontentMediaPtr> MediacontentMediaList;
121 typedef DPL::SharedPtr<MediacontentMediaList> MediacontentMediaListPtr;
122
123
124 }
125 }
126
127
128 #endif /* _ABSTRACT_LAYER_CONTENT_MEDIA_H_ */
129