]> git.sesse.net Git - vlc/blob - modules/gui/macosx/playlist.h
Revert "macosx: clean code of objectAtIndex"
[vlc] / modules / gui / macosx / playlist.h
1 /*****************************************************************************
2  * playlist.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2012 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Derk-Jan Hartman <hartman at videolan dot org>
9  *          Felix Paul Kühne <fkuehne at videolan dot org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 #import "PXSourceList.h"
27
28 /* playlist column definitions */
29 #define TRACKNUM_COLUMN @"tracknumber"
30 #define TITLE_COLUMN @"name"
31 #define ARTIST_COLUMN @"artist"
32 #define DURATION_COLUMN @"duration"
33 #define GENRE_COLUMN @"genre"
34 #define ALBUM_COLUMN @"album"
35 #define DESCRIPTION_COLUMN @"description"
36 #define DATE_COLUMN @"date"
37 #define LANGUAGE_COLUMN @"language"
38 #define URI_COLUMN @"uri"
39
40 /*****************************************************************************
41  * VLCPlaylistView interface
42  *****************************************************************************/
43 @interface VLCPlaylistView : NSOutlineView
44
45 @end
46
47 /*****************************************************************************
48  * VLCPlaylistCommon interface
49  *****************************************************************************/
50 @interface VLCPlaylistCommon : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate>
51 {
52     IBOutlet VLCPlaylistView* o_outline_view;
53
54     IBOutlet id o_tc_name_other;
55     IBOutlet id o_tc_author_other;
56     IBOutlet id o_tc_duration_other;
57     IBOutlet VLCPlaylistView* o_outline_view_other;
58
59     NSMutableDictionary *o_outline_dict;
60     playlist_item_t * p_current_root_item;
61 }
62
63 - (void)setPlaylistRoot: (playlist_item_t *)root_item;
64 - (playlist_item_t *)currentPlaylistRoot;
65 - (playlist_item_t *)selectedPlaylistItem;
66 - (NSOutlineView *)outlineView;
67 @end
68
69 /*****************************************************************************
70  * VLCPlaylistWizard interface
71  *****************************************************************************/
72 @interface VLCPlaylistWizard : VLCPlaylistCommon
73 - (IBAction)reloadOutlineView;
74
75 @end
76
77 /*****************************************************************************
78  * VLCPlaylist interface
79  *****************************************************************************/
80 @interface VLCPlaylist : VLCPlaylistCommon
81 {
82     IBOutlet id o_controller;
83     IBOutlet id o_playlist_wizard;
84
85     IBOutlet id o_btn_playlist;
86     IBOutlet id o_playlist_view;
87     IBOutlet id o_search_field;
88     IBOutlet id o_search_field_other;
89     IBOutlet id o_mi_save_playlist;
90     IBOutlet id o_ctx_menu;
91
92     IBOutlet id o_mi_play;
93     IBOutlet id o_mi_delete;
94     IBOutlet id o_mi_info;
95     IBOutlet id o_mi_preparse;
96     IBOutlet id o_mi_revealInFinder;
97     IBOutlet id o_mm_mi_revealInFinder;
98     IBOutlet id o_mi_dl_cover_art;
99     IBOutlet id o_mi_selectall;
100     IBOutlet id o_mi_sort_name;
101     IBOutlet id o_mi_sort_author;
102     IBOutlet id o_mi_recursive_expand;
103
104     IBOutlet id o_save_accessory_view;
105     IBOutlet id o_save_accessory_popup;
106     IBOutlet id o_save_accessory_text;
107
108     IBOutlet id o_playlist_header;
109
110     NSImage *o_descendingSortingImage;
111     NSImage *o_ascendingSortingImage;
112
113     NSMutableArray *o_nodes_array;
114     NSMutableArray *o_items_array;
115
116     BOOL b_selected_item_met;
117     BOOL b_isSortDescending;
118     id o_tc_sortColumn;
119 }
120
121 - (void)searchfieldChanged:(NSNotification *)o_notification;
122 - (NSMenu *)menuForEvent:(NSEvent *)o_event;
123
124 - (IBAction)searchItem:(id)sender;
125
126 - (void)playlistUpdated;
127 - (void)outlineViewSelectionDidChange:(NSNotification *)notification;
128 - (void)sortNode:(int)i_mode;
129 - (void)updateRowSelection;
130
131 - (BOOL)isSelectionEmpty;
132
133 - (IBAction)playItem:(id)sender;
134 - (IBAction)revealItemInFinder:(id)sender;
135 - (IBAction)preparseItem:(id)sender;
136 - (IBAction)downloadCoverArt:(id)sender;
137 - (IBAction)savePlaylist:(id)sender;
138 - (IBAction)deleteItem:(id)sender;
139 - (IBAction)selectAll:(id)sender;
140 - (IBAction)sortNodeByName:(id)sender;
141 - (IBAction)sortNodeByAuthor:(id)sender;
142 - (IBAction)recursiveExpandNode:(id)sender;
143
144 - (id)playingItem;
145 - (NSArray *)draggedItems;
146
147 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
148 - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;
149
150 - (void)setColumn: (NSString *)o_column state: (NSInteger)i_state translationDict:(NSDictionary *)o_dict;
151 @end