interface.h 4.23 KB
Newer Older
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
1
/*****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
2
 * Copyright © 2015-2016 VideoLAN, VideoLabs SAS
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *****************************************************************************
 *
 * Authors: Nicolas Rechatin [nicolas@videolabs.io]
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
/*
 * By committing to this project, you allow VideoLAN and VideoLabs to relicense
 * the code to a different OSI approved license, in case it is required for
 * compatibility with the Store
 *****************************************************************************/

#ifndef INTERFACE_H_
#define INTERFACE_H_

30
#include "common.h"
31
#include "application.h"
32

33
#include "media/library/media_library.hpp"
34

Thomas Guillem's avatar
Thomas Guillem committed
35
typedef struct interface interface;
36

37

38
/* Creation / Destruction */
39
interface *
40
intf_create(application *);
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
41

42 43 44
application *
intf_get_application(interface *);

45 46
void
intf_destroy(interface *);
47

48
/* Views */
49 50
typedef struct view_sys view_sys;

51
typedef enum interface_view_event {
52 53 54
    INTERFACE_VIEW_EVENT_NONE,
    INTERFACE_VIEW_EVENT_BACK,
    INTERFACE_VIEW_EVENT_MENU,
55 56
    INTERFACE_VIEW_EVENT_PAUSE,
    INTERFACE_VIEW_EVENT_RESUME,
57
}interface_view_event;
58 59

typedef enum view_e {
Thomas Guillem's avatar
Thomas Guillem committed
60 61 62 63
    VIEW_AUTO = -1,
    VIEW_VIDEO,
    VIEW_AUDIO,
    VIEW_FILES,
Ludovic Fauvet's avatar
Ludovic Fauvet committed
64
    VIEW_STREAM,
Thomas Guillem's avatar
Thomas Guillem committed
65 66 67
    VIEW_SETTINGS,
    VIEW_ABOUT,
    VIEW_MAX,
68 69
} view_e;

70
typedef struct interface_view {
71
    Evas_Object *view;                      /* The Evas View prepared to be stacked */
72
    view_sys *p_view_sys;                   /* The view private data */
73
    view_e i_type;                          /* The view type */
74

75 76 77 78
    void (*pf_start)(view_sys *p_view_sys);    /* CB when the view is started/resumed */
    void (*pf_stop) (view_sys *p_view_sys);    /* CB when the view is stoped/paused */

    bool (*pf_has_menu)(view_sys *p_view_sys); /* Does the view needs an overflow menu? */
79
    bool (*pf_event)(view_sys *p_view_sys, interface_view_event event); /* */
80

81 82
} interface_view;

83
void
84
intf_show_view(interface *, view_e);
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
85

86
// FIXME REMOVE
87
void
88
intf_show_previous_view(interface *);
89

90
/* Video and Audio players */
91
void
92
intf_video_player_play(interface *intf, const char *psz_path, double time);
93

94
void
95
intf_start_audio_player(interface *intf, Eina_Array *array, int pos);
96

97 98 99
void
intf_raise(interface *p_intf);

100 101 102 103 104 105
/* Mini Player */
bool
intf_mini_player_visible_get(interface *);

bool
intf_mini_player_visible_set(interface *intf, bool visible);
106

107
//FIXME REMOVE
108
void
Thomas Guillem's avatar
Thomas Guillem committed
109 110
intf_update_mini_player(interface *);

111
/* Other */
112 113 114
Evas_Object *
intf_get_main_naviframe(interface *intf);

115 116 117
Evas_Object *
intf_get_window(interface *intf);

118
/* Media Library */
119 120 121 122 123 124 125
void
intf_register_file_changed(interface *intf, view_e type,
        media_library_file_list_changed_cb cb, void* p_user_data);

void
intf_ml_file_changed( void* p_user_data );

126 127 128
void
intf_propagate_event(interface *intf, interface_view_event event);

129 130 131
/* List view items */
typedef struct list_sys list_sys;
typedef struct list_view list_view;
132
typedef struct list_view_item list_view_item;
133 134 135
typedef struct list_view
{
    list_sys* p_sys;
136 137 138 139 140
    void            (*pf_del)(list_sys* p_sys);
    list_view_item* (*pf_append_item)(list_sys* p_sys, void* p_item);
    void            (*pf_clear)(list_sys* p_sys);
    const void*     (*pf_get_item)(list_view_item* p_list_item);
    void            (*pf_set_item)(list_view_item* p_list_item, void* p_item);
141
    Evas_Object*    (*pf_get_widget)(list_sys* p_sys);
142
    Evas_Object*    (*pf_get_list)(list_sys* p_list_sys);
143
    bool            (*pf_view_event_back)(list_sys* p_sys);
144 145
} list_view;

Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
146
#endif /* INTERFACE_H_ */