]> git.sesse.net Git - vlc/blob - modules/gui/macosx/playlist.h
macosx: implemented the sidebar completely to support switching between the playlist...
[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 /*****************************************************************************
29  * VLCPlaylistView interface
30  *****************************************************************************/
31 @interface VLCPlaylistView : NSOutlineView
32 {
33 }
34
35 @end
36
37 /*****************************************************************************
38  * VLCPlaylistCommon interface
39  *****************************************************************************/
40 @interface VLCPlaylistCommon : NSObject <NSOutlineViewDataSource, NSOutlineViewDelegate>
41 {
42     IBOutlet id o_tc_name;
43     IBOutlet id o_tc_author;
44     IBOutlet id o_tc_duration;
45     IBOutlet VLCPlaylistView* o_outline_view;
46
47     IBOutlet id o_tc_name_other;
48     IBOutlet id o_tc_author_other;
49     IBOutlet id o_tc_duration_other;
50     IBOutlet VLCPlaylistView* o_outline_view_other;
51
52     NSMutableDictionary *o_outline_dict;
53     playlist_item_t * p_current_root_item;
54 }
55
56 - (void)setPlaylistRoot: (playlist_item_t *)root_item;
57 - (playlist_item_t *)currentPlaylistRoot;
58 - (void)initStrings;
59 - (playlist_item_t *)selectedPlaylistItem;
60 - (NSOutlineView *)outlineView;
61 - (void)swapPlaylists:(id)newList;
62 @end
63
64 /*****************************************************************************
65  * VLCPlaylistWizard interface
66  *****************************************************************************/
67 @interface VLCPlaylistWizard : VLCPlaylistCommon
68 {
69 }
70
71 - (IBAction)reloadOutlineView;
72
73 @end
74
75 /*****************************************************************************
76  * VLCPlaylist interface
77  *****************************************************************************/
78 @interface VLCPlaylist : VLCPlaylistCommon
79 {
80     IBOutlet id o_controller;
81     IBOutlet id o_playlist_wizard;
82
83     IBOutlet id o_btn_playlist;
84     IBOutlet id o_playlist_view;
85     IBOutlet id o_search_field;
86     IBOutlet id o_search_field_other;
87     IBOutlet id o_mi_save_playlist;
88     IBOutlet id o_ctx_menu;
89
90     IBOutlet id o_mi_play;
91     IBOutlet id o_mi_delete;
92     IBOutlet id o_mi_info;
93     IBOutlet id o_mi_preparse;
94     IBOutlet id o_mi_revealInFinder;
95     IBOutlet id o_mm_mi_revealInFinder;
96     IBOutlet id o_mi_dl_cover_art;
97     IBOutlet id o_mi_selectall;
98     IBOutlet id o_mi_sort_name;
99     IBOutlet id o_mi_sort_author;
100     IBOutlet id o_mi_recursive_expand;
101
102     /* "services discovery" menu in the playlist menu */
103     IBOutlet id o_mi_services;
104     IBOutlet id o_mu_services;
105
106     /* "services discovery" menu in the main menu */
107     IBOutlet id o_mm_mi_services;
108     IBOutlet id o_mm_mu_services;
109
110     IBOutlet id o_save_accessory_view;
111     IBOutlet id o_save_accessory_popup;
112     IBOutlet id o_save_accessory_text;
113
114
115     NSImage *o_descendingSortingImage;
116     NSImage *o_ascendingSortingImage;
117
118     NSMutableArray *o_nodes_array;
119     NSMutableArray *o_items_array;
120
121     BOOL b_selected_item_met;
122     BOOL b_isSortDescending;
123     id o_tc_sortColumn;
124 }
125
126 - (void)searchfieldChanged:(NSNotification *)o_notification;
127 - (NSMenu *)menuForEvent:(NSEvent *)o_event;
128
129 - (IBAction)searchItem:(id)sender;
130
131 - (void)playlistUpdated;
132 - (void)outlineViewSelectionDidChange:(NSNotification *)notification;
133 - (void)sortNode:(int)i_mode;
134 - (void)updateRowSelection;
135
136 - (BOOL)isSelectionEmpty;
137
138 - (IBAction)servicesChange:(id)sender;
139 - (IBAction)playItem:(id)sender;
140 - (IBAction)revealItemInFinder:(id)sender;
141 - (IBAction)preparseItem:(id)sender;
142 - (IBAction)downloadCoverArt:(id)sender;
143 - (IBAction)savePlaylist:(id)sender;
144 - (IBAction)deleteItem:(id)sender;
145 - (IBAction)selectAll:(id)sender;
146 - (IBAction)sortNodeByName:(id)sender;
147 - (IBAction)sortNodeByAuthor:(id)sender;
148 - (IBAction)recursiveExpandNode:(id)sender;
149
150 - (id)playingItem;
151
152 - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
153 - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue;
154
155 @end