summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/resource/XStringResourcePersistence.idl
blob: 496ec34567e2c8bfd59e044c70eac95151ab0380 (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef __com_sun_star_resource_XStringResourcePersistence_idl__
#define __com_sun_star_resource_XStringResourcePersistence_idl__

#include <com/sun/star/resource/XStringResourceManager.idl>
#include <com/sun/star/embed/XStorage.idl>
#include <com/sun/star/task/XInteractionHandler.idl>



module com { module sun { module star { module resource {

/**
    Interface derived from XStringResourceManager containing
    basic persistence functionality limited to operations that
    are independent from an associated location or storage.

    @see XStringResourceManager.
*/
interface XStringResourcePersistence: com::sun::star::resource::XStringResourceManager
{
    /**
        Stores all string table data respectively all data modified since
        the last call to store() to the location or storage
        associated with the StringResourceManager. Each locale is stored
        in a single file following the format of Java properties files.

        This interface is supported by the services
        StringResourceWithLocation and
        StringResourceWithStorage

        The StringResourceWithLocation is initialized with a URL
        specifying a location used to load data from and store data to,
        see StringResourceWithLocation.

        The StringResourceWithStorage is initialized with an instance
        of com::sun::star::embed::XStorage
        used to load data from and store data to,
        see StringResourceWithStorage.

        If the string table isn't modified (see isModified())
        this method does nothing.

        This method can throw all exceptions thrown by the methods of
        com::sun::star::embed::XStorage respectively
        a com::sun::star::ucb::CommandAbortedException in
        case of a StringResourceWithLocation for all exceptions that are
        not handled by a previously specified
        com::sun::star::task::XInteractionHandler.
        The handler to be used for the store operation can be specified
        during initialization of StringResourceWithLocation.

        @throws com::sun::star::lang::NoSupportException
            if no URL or no valid storage are provided.
    */
    void store()
        raises( com::sun::star::lang::NoSupportException,
                com::sun::star::uno::Exception );


     /**
        provides the current modify state of the StringResourceManager instance.

        @return
            `TRUE` if the string table has changed since the last call to
            store() or, if supported
            <code>XStringResourceWithStorage::storeAsStorage</code>.
            `FALSE` if the table hasn't changed.
    */
    boolean isModified();


    /**
        Sets the comment stored first in each locale data file.

        This interface method can be used to overwrite the comment used
        during initialization of the services
        StringResourceWithLocation or
        StringResourceWithStorage

        @param Comment
            Comment stored first in each properties file followed by a line
            feed character. The line feed character is added automatically
            and hasn't to be part of the comment string. The caller is
            responsible that the passed string is a valid comment in a Java
            properties file, e.g. "# My strings". The string may be empty.
    */
    void setComment( [in] string Comment );


    /**
        Stores all string table data to the provided storage.

        Calling this method does not affect the association with a location
        (in case of a StringResourceWithLocation instance)
        respectively with a storage (in case of a
        StringResourceWithStorage instance).
        The modified state isn't affected either.

        This method can be used to make a copy of the current string
        table data to a storage. This method can throw all exceptions
        thrown by the methods of com::sun::star::embed::XStorage

        @param Storage
            all string table data will be stored to this storage.

        @param BaseName
            Base string for the file names used to store the locale data.
            The locale data is stored in Java properties files also following
            the corresponding naming scheme. The files will be named like this:
            "[BaseName]_[Language]_[Country].properties",
            e.g. "MyBaseName_en_US.properties"
            If an empty string is passed for BaseName, "strings" will be used
            as BaseName.

        @param Comment
            Comment stored first in each properties file,
            for a detailed description see setComment().

        This method can throw all exceptions thrown by the methods of
        com::sun::star::embed::XStorage
    */
    void storeToStorage( [in] ::com::sun::star::embed::XStorage Storage,
        [in] string BaseName, [in] string Comment )
            raises ( com::sun::star::uno::Exception );


    /**
        Stores all string table data to the location specified by the
        passed URL string.

        Calling this method does not affect the association with a location
        (in case of a StringResourceWithLocation instance)
        respectively with a storage (in case of a
        StringResourceWithStorage instance).
        The modified state isn't affected either.

        This method can be used to make a copy of the current string
        table data to a location.

        @param URL
            the location the string table data should be stored to.

        @param BaseName
            Base string for the file names used to store the locale data.
            The locale data is stored in Java properties files also following
            the corresponding naming scheme. The files will be named like this:
            "[BaseName]_[Language]_[Country].properties",
            e.g. "MyBaseName_en_US.properties"
            If an empty string is passed for BaseName, "strings" will be used
            as BaseName.

        @param Comment
            Comment stored first in each properties file,
            for a detailed description see setComment().

        @param Handler
            a com::sun::star::task::XInteractionHandler.
            It will be passed to ucb handle exceptions. Exceptions not processed
            by this handler will be passed as com::sun::star::uno::Exception. If
            this parameter is null this applies to all exceptions thrown by ucb.

        @see com::sun::star::task::InteractionHandler
    */
    void storeToURL( [in] string URL, [in] string BaseName, [in] string Comment,
        [in] com::sun::star::task::XInteractionHandler Handler )
            raises( com::sun::star::uno::Exception );


    /**
        Returns a sequence of byte representing the complete string resource
        in a binary format.

        This method is intended to support datatransfer functionality, e.g. provided
        by com::sun::star::datatransfer::XTransferable and
        related interfaces.

        See importBinary()).

        @return  a sequence of byte representing the string resource.
    */
    sequence<byte> exportBinary();


    /**
        Initializes the string resource with binary data. This method
        expects the data format returned by exportBinary().

        All locales and strings previously added to the string resource
        will be deleted. So after calling this method the string resource
        only contains the locales and strings specified in the binary data.

        This method is intended to support datatransfer functionality, e.g. provided
        by com::sun::star::datatransfer::XTransferable and
        related interfaces.

        See importBinary()).

        @throws com::sun::star::lang::IllegalArgumentException
        if Data is empty or does not meet the binary format returned by
        the current or earlier version of exportBinary()).
    */
    void importBinary( [in] sequence<byte> Data )
        raises ( com::sun::star::lang::IllegalArgumentException );

};


}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */