tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / offapi / com / sun / star / packages / Package.idl
blob36910367446c470c96adbf11ae9c53b7c6957f13
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
22 module com { module sun { module star { module packages {
24 /** The Package is a service that provides access to a set of
25 files and folders contained within a Package. One instance of the
26 Package service exists for each Package file to be manipulated.
28 Each instance is created with an argument which specifies the URL of
29 the Package file to which the user requires access. If the instance is
30 created without arguments, it must be initialized with the
31 com::sun::star::lang::XInitialization service methods
32 before it is a valid instance of the service.
34 published service Package
36 /**
37 A Package can be initialized with one of the following:
39 1. A file URL referring to a package.
40 2. An XInputStream referring to a package (it must also
41 support an XSeekable interface).
42 3. An XStream referring to a package. The XInputStream must support
43 an XSeekable interface, and the XOutputStream must support an
44 XTruncate interface.
46 It will throw a css::uno::Exception if initialized with bad data or
47 if the package has an invalid format (for example, a corrupt central
48 directory record if the file is a ZIP file).
50 interface com::sun::star::lang::XInitialization;
51 /**
52 This interface is used to get access to any entry within the package
53 For example:
54 getByHierarchicalName ("folder/subfolder/file1.txt");
55 This will return a PackageStream which refers to the specified stream.
56 This is also used to get access to a particular folder within the
57 Package. For example:
58 getByHierarchicalName ("folder/subfolder/");
59 This will return a PackageFolder which describes the contents of the specified
60 folder.
62 Calls to methods of XHierarchicalNameAccess must NOT have a leading slash.
64 interface com::sun::star::container::XHierarchicalNameAccess;
65 /**
66 This interface is used to create new PackageStream or PackageFolder
67 implementation objects for addition to the Package.
69 createInstance - creates a new stream implementation object (when first
70 created, the new object is not part of the Package). It must be added
71 to the PackageFolder in which it will reside using the methods in the
72 PackageFolder service.
74 createInstanceWithArguments - This accepts one boolean value as an
75 argument. If it set to true, a PackageFolder implementation is created,
76 if it is set to false, a PackageStream implementation is created.
78 Creating and inserting a new stream would be done as follows:
80 1. xNewStream = package->createInstanceWithArguments( false );
81 2. xDataStream = new MyStreamImpl(). (wherever the data comes from)
82 3. xNewStream->setInputStream( xDataStream );
83 4. parentFolder->insertByName( "image.png", xNewStream );
85 Replacing an existing stream would be very similar, except that the
86 call ->insertByName would be replaced by ->replaceByName.
88 interface com::sun::star::lang::XSingleServiceFactory;
89 /**
90 This interface is used to commit any changes to the Package. A new
91 Package file will be written with any new or changed streams/folders and
92 omitting any PackageStream or PackageFolder that has been removed.
94 interface com::sun::star::util::XChangesBatch;
96 }; }; }; };
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */