1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_ucb_XSimpleFileAccess_idl__
20 #define __com_sun_star_ucb_XSimpleFileAccess_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
23 #include
<com
/sun
/star
/uno
/RuntimeException.idl
>
24 #include
<com
/sun
/star
/uno
/Exception.idl
>
25 #include
<com
/sun
/star
/ucb
/CommandAbortedException.idl
>
26 #include
<com
/sun
/star
/task
/XInteractionHandler.idl
>
27 #include
<com
/sun
/star
/util
/DateTime.idl
>
28 #include
<com
/sun
/star
/io
/XOutputStream.idl
>
29 #include
<com
/sun
/star
/io
/XInputStream.idl
>
30 #include
<com
/sun
/star
/io
/XStream.idl
>
35 module com
{ module sun
{ module star
{ module ucb
{
37 /** This is the basic interface to read data from a stream.
39 published
interface XSimpleFileAccess
: com
::sun
::star
::uno
::XInterface
45 URL of the file to be copied
47 URL of the location the file should be copied to
51 void copy
( [in] string SourceURL
, [in] string DestURL
)
52 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
57 URL of the file to be moved
59 URL of the location the file should be moved to
63 void move
( [in] string SourceURL
, [in] string DestURL
)
64 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
66 /** Removes a file. If the URL represents a folder, the folder will be
67 removed, even if it's not empty.
70 File/folder to be removed
74 void kill
( [in] string FileURL
)
75 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
77 /** Checks if an URL represents a folder
83 true, if the given URL represents a folder, otherwise false
85 boolean isFolder
( [in] string FileURL
)
86 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
88 /** Checks if a file is "read only"
94 true, if the given File is "read only", false otherwise
96 boolean isReadOnly
( [in] string FileURL
)
97 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
99 /** Sets the "read only" of a file according to the boolean parameter,
100 if the actual process has the right to do so.
106 true; "read only" flag will be set, false; "read only" flag will be reset
108 void setReadOnly
( [in] string FileURL
, [in] boolean bReadOnly
)
109 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
111 /** Creates a new Folder
114 URL describing the location of the new folder
116 void createFolder
( [in] string NewFolderURL
)
117 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
119 /** Returns the size of a file.
124 @return Size of the file in bytes
126 long getSize
( [in] string FileURL
)
127 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
129 /** Returns the content type of a file.
131 @see XContent::getContentType
136 @return Content type of the file
138 string getContentType
( [in] string FileURL
)
139 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
141 /** Returns the last modified date for the file
146 @return Last modified date for the file
148 ::com
::sun
::star
::util
::DateTime getDateTimeModified
( [in] string FileURL
)
149 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
151 /** Returns the contents of a folder
155 @param bIncludeFolders
156 true: Subfolders are included, false: No subfolders
158 @return The content of a folder, each file as one string
161 sequence
<string> getFolderContents
( [in] string FolderURL
, [in] boolean bIncludeFolders
)
162 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
164 /** Checks if a file exists
170 true, if the File exists, false otherwise
172 boolean exists
( [in] string FileURL
)
173 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
176 /** Opens file to read
182 An XInputStream, if the file can be opened for reading
184 com
::sun
::star
::io
::XInputStream openFileRead
( [in] string FileURL
)
185 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
187 /** Opens file to write.
193 An XOutputStream, if the file can be opened for writing
196 UnsupportedDataSinkException, if the file cannot be
197 opened for random write access. Some resources do not allow random
198 write access. To write data for those resources
199 XSimpleFileAccess2::writeFile() may be used.
201 com
::sun
::star
::io
::XOutputStream openFileWrite
( [in] string FileURL
)
202 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
204 /** Opens file to read and write
210 An XStream, if the file can be opened for reading and writing
213 UnsupportedDataSinkException, if the file cannot be
214 opened for random write access. Some resources do not allow random
215 write access. To write data for those resources
216 XSimpleFileAccess2::writeFile() may be used.
218 com
::sun
::star
::io
::XStream openFileReadWrite
( [in] string FileURL
)
219 raises
( com
::sun
::star
::ucb
::CommandAbortedException
, com
::sun
::star
::uno
::Exception
);
221 /** Sets an interaction handler to be used for further operations.
224 A default interaction handler is available as service
225 com::sun::star::task::InteractionHandler.
226 The documentation of this service also contains further
227 information about the interaction handler concept.
230 @see com::sun::star::task::InteractionHandler
233 The interaction handler to be set
235 void setInteractionHandler
( [in] com
::sun
::star
::task
::XInteractionHandler Handler
);
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */