interface.h 3.91 KB
Newer Older
Nicolas Pomepuy's avatar
Nicolas Pomepuy committed
1 2 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
/*****************************************************************************
 * Copyright © 2015 VideoLAN, VideoLabs SAS
 *****************************************************************************
 *
 * 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 52
typedef struct view_sys_cb {
    view_sys* p_sys;
53
    void (*pf_updated)( view_sys* p_sys, bool b_empty );
54 55
} view_sys_cb;

56
typedef enum interface_view_event {
57 58 59
    INTERFACE_VIEW_EVENT_NONE,
    INTERFACE_VIEW_EVENT_BACK,
    INTERFACE_VIEW_EVENT_MENU,
60
}interface_view_event;
61 62

typedef enum view_e {
Thomas Guillem's avatar
Thomas Guillem committed
63 64 65 66 67 68 69
    VIEW_AUTO = -1,
    VIEW_VIDEO,
    VIEW_AUDIO,
    VIEW_FILES,
    VIEW_SETTINGS,
    VIEW_ABOUT,
    VIEW_MAX,
70 71
} view_e;

72
typedef struct interface_view {
73
    Evas_Object *view;                      /* The Evas View prepared to be stacked */
74 75
    view_sys *p_view_sys;                   /* The view private data */

76 77 78 79
    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? */
80
    bool (*pf_event)(view_sys *p_view_sys, interface_view_event event); /* */
81

82 83
} interface_view;

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

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

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

95 96 97 98 99 100 101 102 103
void
intf_create_audio_player(interface *, const char *psz_path);

/* Mini Player */
bool
intf_mini_player_visible_get(interface *);

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

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

109
/* Other */
110 111 112
Evas_Object *
intf_get_main_naviframe(interface *intf);

113
/* Media Library */
114 115 116 117 118 119 120
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 );

121 122 123
/* List view items */
typedef struct list_sys list_sys;
typedef struct list_view list_view;
124
typedef struct list_view_item list_view_item;
125 126 127
typedef struct list_view
{
    list_sys* p_sys;
128 129 130 131 132
    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);
133
    Evas_Object*    (*pf_get_list)(list_sys* p_sys);
134 135
} list_view;

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