summaryrefslogtreecommitdiff
path: root/core/source/org/openoffice/ide/eclipse/core/preferences/IOOo.java
blob: 8261e8e1c565c2e5bae6307eadd665ad5982545b (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*************************************************************************
 *
 * $RCSfile: IOOo.java,v $
 *
 * $Revision: 1.6 $
 *
 * last change: $Author: cedricbosdo $ $Date: 2008/12/13 13:42:50 $
 *
 * The Contents of this file are made available subject to the terms of
 * the GNU Lesser General Public License Version 2.1
 *
 * Sun Microsystems Inc., October, 2000
 *
 *
 * GNU Lesser General Public License Version 2.1
 * =============================================
 * Copyright 2000 by Sun Microsystems, Inc.
 * 901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 * 
 * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
 *
 * Copyright: 2002 by Sun Microsystems, Inc.
 *
 * All Rights Reserved.
 *
 * Contributor(s): Cedric Bosdonnat
 *
 *
 ************************************************************************/
package org.openoffice.ide.eclipse.core.preferences;

import java.io.File;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;

/**
 * Interface for an OpenOffice.org configuration instance. This can even
 * be implemented as an URE instance.
 * 
 * @author cedricbosdo
 */
public interface IOOo {

    /**
     * Set the home directory.
     * 
     * @param pHome the absolute path to the home directory
     * @throws InvalidConfigException is thrown if the path doesn't match the 
     *         implementation requirement for an OOo instance. The error code will
     *         be {@link InvalidConfigException#INVALID_OOO_HOME}
     */
    public void setHome(String pHome) throws InvalidConfigException;
    
    /**
     * Returns the path to the OpenOffice.org home directory. This string could 
     * be passed to the Path constructor to get the folder object. 
     * 
     * @return path to the OpenOffice.org home directory.
     */
    public String getHome();
    
    /**
     * Returns the OOo name. It should be a unique identifier
     * 
     * @return ooo name
     */
    public String getName();
    
    /**
     * <p>Returns the path to the OpenOffice.org classes directory. 
     * These strings could be passed to the Path constructor to get the 
     * folder object.</p> 
     * 
     * <p><em>This method should be used for future compatibility with 
     * URE applications</em></p>
     * 
     * @return path to the OpenOffice.org classes directory
     */
    public String[] getClassesPath();
    
    /**
     * <p>Returns the path to the OpenOffice.org shared libraries. This string
     * could be passed to the Path constructor to get the folder object.</p>
     * 
     * @return path to the OpenOffice.org libraries directory
     */
    public String[] getLibsPath();
    
    /**
     * <p>Returns the path to any folder containing binaries in the OOo installation. 
     * This string could be passed to the Path constructor to get the folder object.</p>
     * 
     * @return paths to the OpenOffice.org binary directories
     */
    public String[] getBinPath();
    
    /**
     * @return the path to the <code>types.rdb</code> file of the OOo or URE
     * instance.
     */
    public String[] getTypesPath();
    
    /**
     * @return the path to the <code>services.rdb</code> file of the OOo or URE
     * instance.
     */
    public String[] getServicesPath();
    
    /**
     * @return the path to the UNO bootstrap properties file.
     */
    public String getUnorcPath();
    
    /**
     * @return the path to the UNO executable file
     */
    public String getUnoPath();
    
    /**
     * @return the path to the <code>javaldx</code> executable 
     */
    public String getJavaldxPath();
    
    /**
     * Returns a command to execute a <code>uno</code> component.
     * 
     * @param pImplementationName the name of the component implementation to run
     * @param pLibLocation the name of the library containing the implementation
     * @param pRegistriesPaths the path to the additional registries
     * @param pArgs the argument for the component launch
     * 
     * @return the command to execute the <code>uno</code> binary
     */
    public String createUnoCommand(String pImplementationName, 
            String pLibLocation, String[] pRegistriesPaths, String[] pArgs);
    
    /**
     * Run the <code>uno</code> executable with the given Main implementation, 
     * the arguments and the launcher.
     * 
     * @param pPrj the project to run
     * @param pMain the main implementation
     * @param pArgs the argument to pass to the main implementation
     * @param pLaunch the launcher
     * @param pMonitor a monitor to follow the progress
     */
    public void runUno(IUnoidlProject pPrj, String pMain, String pArgs, 
            ILaunch pLaunch, IProgressMonitor pMonitor);
    
    /**
     * @return <code>true</code> if the OOo instance has a package manager.
     */
    public boolean canManagePackages();
    
    /**
     * Update a package in the OOo instance if it can manages packages.
     * 
     * @param pPackageFile the package to add or update
     */
    public void updatePackage(File pPackageFile);
}