MLMediaLibrary.h 1.95 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/*****************************************************************************
 * MLMediaLibrary.h
 * MobileMediaLibraryKit
 *****************************************************************************
 * Copyright (C) 2010 Pierre d'Herbemont
 * Copyright (C) 2010-2013 VLC authors and VideoLAN
 * $Id$
 *
 * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
 *
11 12 13
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
14 15 16 17
 * (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
18 19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
20
 *
21 22 23
 * You should have received a copy of the GNU Lesser 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.
24
 *****************************************************************************/
Pierre's avatar
Pierre committed
25

Pierre's avatar
Pierre committed
26
#import <CoreData/CoreData.h>
Pierre's avatar
Pierre committed
27 28

@interface MLMediaLibrary : NSObject {
Pierre's avatar
Pierre committed
29 30
    NSManagedObjectContext *_managedObjectContext;
    NSManagedObjectModel   *_managedObjectModel;
31 32

    BOOL _allowNetworkAccess;
Pierre's avatar
Pierre committed
33 34
}

35 36 37
@property (readonly) BOOL libraryNeedsUpgrade;
@property (nonatomic, retain) id delegate;

Pierre's avatar
Pierre committed
38 39
+ (id)sharedMediaLibrary;

Pierre's avatar
Pierre committed
40
- (void)addFilePaths:(NSArray *)filepaths;
41
- (void)upgradeLibrary;
42
- (void)updateMediaDatabase;
Pierre's avatar
Pierre committed
43 44 45 46

// May be internal
- (NSFetchRequest *)fetchRequestForEntity:(NSString *)entity;
- (id)createObjectForEntity:(NSString *)entity;
47
- (NSString *)thumbnailFolderPath;
Pierre's avatar
Pierre committed
48

Pierre's avatar
Pierre committed
49
- (void)applicationWillStart;
50 51
- (void)applicationWillExit;

Pierre's avatar
Pierre committed
52 53 54
- (void)save;
- (void)libraryDidDisappear;
- (void)libraryDidAppear;
Pierre's avatar
Pierre committed
55
@end
56 57 58 59 60 61 62

@protocol MLMediaLibrary <NSObject>

@optional
- (void)libraryUpgradeComplete;

@end