]> git.sesse.net Git - vlc/blob - modules/gui/macosx/PLModel.h
macosx: select currently played item
[vlc] / modules / gui / macosx / PLModel.h
1 /*****************************************************************************
2  * PLItem.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2014 VLC authors and VideoLAN
5  * $Id$
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20  *****************************************************************************/
21
22 #import <Cocoa/Cocoa.h>
23
24 #import "PLItem.h"
25
26 #include <vlc_common.h>
27
28 #define VLCPLItemPasteboadType @"VLCPlaylistItemPboardType"
29
30 /* playlist column definitions */
31 #define STATUS_COLUMN @"status"
32 #define TRACKNUM_COLUMN @"tracknumber"
33 #define TITLE_COLUMN @"name"
34 #define ARTIST_COLUMN @"artist"
35 #define DURATION_COLUMN @"duration"
36 #define GENRE_COLUMN @"genre"
37 #define ALBUM_COLUMN @"album"
38 #define DESCRIPTION_COLUMN @"description"
39 #define DATE_COLUMN @"date"
40 #define LANGUAGE_COLUMN @"language"
41 #define URI_COLUMN @"uri"
42 #define FILESIZE_COLUMN @"file-size"
43
44 @class VLCPlaylist;
45
46 @interface PLModel : NSObject<NSOutlineViewDataSource>
47 {
48     PLItem *_rootItem;
49
50     playlist_t *p_playlist;
51     NSOutlineView *_outlineView;
52
53     // TODO: write these objects to the pastboard properly?
54     NSMutableArray *_draggedItems;
55
56     // TODO: for transition
57     VLCPlaylist *_playlist;
58 }
59
60 @property(readonly) PLItem *rootItem;
61 @property(readonly, copy) NSArray *draggedItems;
62
63
64 - (id)initWithOutlineView:(NSOutlineView *)outlineView playlist:(playlist_t *)pl rootItem:(playlist_item_t *)root playlistObject:(id)plObj;
65
66 - (void)changeRootItem:(playlist_item_t *)p_root;
67
68 - (BOOL)hasChildren;
69
70 typedef enum {
71     ROOT_TYPE_PLAYLIST,
72     ROOT_TYPE_MEDIALIBRARY,
73     ROOT_TYPE_OTHER
74 } PLRootType;
75
76 - (PLRootType)currentRootType;
77
78 - (BOOL)editAllowed;
79
80 - (void)addItem:(int)i_item withParentNode:(int)i_node;
81 - (void)removeItem:(int)i_item;
82
83 - (PLItem *)currentlyPlayingItem;
84
85 - (void)sortForColumn:(NSString *)o_column withMode:(int)i_mode;
86
87 - (void)searchUpdate:(NSString *)o_search;
88
89
90 @end
91