Apply IActivatedListener for gengrid / genlist.
[profile/tv/apps/native/musicplayer.git] / include / common.h
1 /*
2  * Copyright (c) 2014 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 #ifndef __COMMON_H__
18 #define __COMMON_H__
19
20
21 struct SCbInfo {
22         void (*cb)(void *dt);
23         void *data;
24         int type;
25 };
26
27 struct SCtxtPlaylistItem {
28         char *name;
29         int id;
30 };
31
32 enum ESourceType {
33         SOURCE_TYPE_NONE = -1,
34         SOURCE_TYPE_ALL,
35         SOURCE_TYPE_TV,
36         SOURCE_TYPE_USB
37 };
38
39 enum sorttype {
40         E_SORT_TITLE_A_Z,
41         E_SORT_TITLE_Z_A,
42         E_SORT_ARTIST_A_Z,
43         E_SORT_ARTIST_Z_A,
44         E_SORT_ALBUM_A_Z,
45         E_SORT_ALBUM_Z_A
46 };
47
48 enum EAddType {
49         ADD_TYPE_FRESH,
50         ADD_TYPE_NEXT,
51         ADD_TYPE_END
52 };
53
54 enum EPlayStatus {
55         PLAY_STATUS_INITIAL = -1,
56         PLAY_STATUS_STOP,
57         PLAY_STATUS_PLAY,
58         PLAY_STATUS_PAUSE
59 };
60
61 enum EShuffleStatus {
62         SHUFFLE_STATUS_OFF = 0,
63         SHUFFLE_STATUS_ON
64 };
65
66 enum ERepeatStatus {
67         REPEAT_STATUS_NONE = 0,
68         REPEAT_STATUS_ALL,
69         REPEAT_STATUS_ONE
70 };
71
72 enum update_type {
73         E_KEY_PRESS,
74         E_KEY_RELEASE,
75         E_PLAYLIST_UPDATE,
76         E_FOCUS_UPDATE,
77         E_LAYOUT_UPDATE,
78         E_DEPTH_UPDATE,
79         E_SONG_UPDATE
80 };
81
82 enum EListType {
83         LIST_TYPE_SONG,
84         LIST_TYPE_ALBUM,
85         LIST_TYPE_ALBUM_SONG,
86         LIST_TYPE_FOLDER,
87         LIST_TYPE_FOLDER_SONG,
88         LIST_TYPE_ARTIST,
89         LIST_TYPE_GENRE,
90         LIST_TYPE_PLAYLISTS,
91         LIST_TYPE_PLAYLISTS_SONG
92 };
93
94 enum cb_type {
95         E_SONG_COMPLETE,
96         E_CONTENT_UPDATE,
97         E_USB_CONNECT,
98         E_PLAYBACK_ERROR,
99         E_CALLBACK_MAX
100 };
101
102 enum EContextType {
103         CONTEXT_TYPE_SONG,
104         CONTEXT_TYPE_ALBUM,
105         CONTEXT_TYPE_ARTIST,
106         CONTEXT_TYPE_GENRE,
107         CONTEXT_TYPE_FOLDER,
108         CONTEXT_TYPE_PLAYLIST,
109         CONTEXT_TYPE_PLAYSONG
110 };
111
112 enum EActionType {
113         ACTION_TYPE_PLAY,
114         ACTION_TYPE_ADDNEXT,
115         ACTION_TYPE_ADDLAST,
116         ACTION_TYPE_DELETE,
117         ACTION_TYPE_ADDTO,
118         ACTION_TYPE_RENAME,
119         ACTION_TYPE_ADDSONG,
120         ACTION_TYPE_REMOVESONG,
121 };
122
123 struct SContentInfo {
124         enum EContextType type;
125         enum EPlayStatus status;
126
127         void (*update)(void *data, enum EActionType type, int id);
128         void (*close)(void *data);
129
130         void *cbdata;
131         void *context;
132 };
133
134 enum ECategoryType {
135         CAT_TYPE_ARTIST,
136         CAT_TYPE_GENRE,
137         CAT_TYPE_PLAYLISTS,
138         CAT_TYPE_PLAYLIST_NEW
139 };
140
141 struct SParcel {
142         SContentInfo *ctxtInfo;
143         int updateType;
144         const char *layoutId;
145         const char *keyEvent;
146 };
147
148 // this values should be defined
149 #define KEY_PLAY "Play"
150 #define KEY_ENTER "Enter"
151 #define KEY_NEXT "Next"
152 #define KEY_PREVIOUS "Previous"
153 #define KEY_EXIT "Exit"
154 #define KEY_BACK "Escape"
155 #define KEY_MENU "Super_L"
156
157 #define SORT_BY_ARTIST_AZ "SORT_BY_ARTIST_AZ"
158 #define SORT_BY_ARTIST_ZA "SORT_BY_ARTIST_ZA"
159 #define SORT_BY_ALBUM_AZ "SORT_BY_ALBUM_AZ"
160 #define SORT_BY_ALBUM_ZA "SORT_BY_ALBUM_ZA"
161
162
163 #endif /* __COMMON_H__ */