summaryrefslogtreecommitdiff
path: root/bindings/objc/src/SwordInstallSourceController.h
blob: 1f5dda5f0941f6ed6825558428e557a16232ca13 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
//  SwordInstallManager.h
//  Eloquent
//
//  Created by Manfred Bergmann on 13.08.07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#ifdef __cplusplus
#include <swmgr.h>
#include <installmgr.h>
#include <swconfig.h>
#include <multimapwdef.h>
class sword::SWModule;
class sword::InstallMgr;
using sword::SWModule;
using sword::InstallMgr;
#endif

@class SwordInstallSource;
@class SwordModule;
@class SwordManager;

typedef enum _ModuleStatusConst {
    ModStatOlder = 0x001,
    ModStatSameVersion = 0x002,
    ModStatUpdated = 0x004,
    ModStatNew = 0x008,
    ModStatCiphered = 0x010,
    ModStatCipheredKeyPresent = 0x020
}ModuleStatusConst;

@interface SwordInstallSourceController : NSObject {
@private
#ifdef __cplusplus
    sword::InstallMgr *swInstallMgr;
#endif
    
    BOOL createPath;
    
    NSString *configPath;
    NSString *configFilePath;
    
    /** the dictionary holding the install sources. caption is the key */
    NSMutableDictionary *installSources;
    NSMutableArray *installSourceList;
}

// ------------------- getter / setter -------------------
@property (retain, readwrite) NSString *configPath;
@property (retain, readwrite) NSString *configFilePath;
@property (retain, readwrite) NSMutableDictionary *installSources;
@property (retain, readwrite) NSMutableArray *installSourceList;

// -------------------- methods --------------------

// initialization
+ (SwordInstallSourceController *)defaultController;

/**
base path of the module installation
 */
- (id)init;
- (id)initWithPath:(NSString *)aPath createPath:(BOOL)create;

/** re-init after adding or removing new modules */
- (void)reinitialize;

// installation/uninstallation
- (int)installModule:(SwordModule *)aModule fromSource:(SwordInstallSource *)is withManager:(SwordManager *)manager;
- (int)uninstallModule:(SwordModule *)aModule fromManager:(SwordManager *)swManager;

// add/remove install sources
- (void)addInstallSource:(SwordInstallSource *)is;
- (void)addInstallSource:(SwordInstallSource *)is withReinitialize:(BOOL)reinit;
- (void)removeInstallSource:(SwordInstallSource *)is;
- (void)removeInstallSource:(SwordInstallSource *)is withReinitialize:(BOOL)reinit;
- (void)updateInstallSource:(SwordInstallSource *)is;
- (int)refreshMasterRemoteInstallSourceList;

// disclaimer
- (BOOL)userDisclaimerConfirmed;
- (void)setUserDisclainerConfirmed:(BOOL)flag;

// list modules in sources
- (NSArray *)listModulesForSource:(SwordInstallSource *)is;

// remote source list
- (int)refreshInstallSource:(SwordInstallSource *)is;

// get module status
- (NSArray *)moduleStatusInInstallSource:(SwordInstallSource *)is baseManager:(SwordManager *)baseMgr;

// low level access
#ifdef __cplusplus
- (sword::InstallMgr *)installMgr;
#endif

@end