1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_rdf_XMetadatable_idl__
29#define __com_sun_star_rdf_XMetadatable_idl__
30
31#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
32#include <com/sun/star/lang/IllegalArgumentException.idl>
33#endif
34
35#ifndef __com_sun_star_beans_StringPair_idl__
36#include <com/sun/star/beans/StringPair.idl>
37#endif
38
39#ifndef __com_sun_star_rdf_XURI_idl__
40#include <com/sun/star/rdf/XURI.idl>
41#endif
42
43
44//=============================================================================
45
46module com {   module sun {   module star {   module rdf {
47
48//=============================================================================
49/** marks an object representing an ODF element that may have RDF meta data
50    attached.
51
52    <p>
53    To make using ODF elements as part of RDF statements more convenient,
54    this interface inherits from <type>XURI</type>.
55    The URI is constructed by concatenating the URI of the document, the
56    stream name, a fragment separator, and the XML ID.
57    </p>
58
59    <p>
60    Note that using the <type>XURI</type> interface on an instance of
61    <type>XMetadatable</type> may have the side effect of creating a metadata
62    reference for the instance.
63    </p>
64
65    @since OOo 3.2
66
67    @see XRepository
68    @see XDocumentMetadataAccess
69 */
70published interface XMetadatable : XURI
71{
72    //-------------------------------------------------------------------------
73    /** a metadata reference, comprising the stream name and the XML ID.
74
75        <p>
76        Note that this metadata reference must be unique for the ODF document.
77        This implies that the XML ID part must be unique for every stream.
78        A pair of two empty strings signifies "no metadata reference".
79        For example: Pair("content.xml", "foo-element-1")
80        </p>
81
82        @throws com::sun::star::lang::IllegalArgumentException
83            if the given metadata reference is invalid, or not unique
84     */
85    [attribute] com::sun::star::beans::StringPair MetadataReference {
86        set raises ( com::sun::star::lang::IllegalArgumentException );
87    };
88
89    //-------------------------------------------------------------------------
90    /** creates a metadata reference for this object, if necessary.
91
92        <p>
93        If this object already has a metadata reference, do nothing;
94        otherwise, create metadata reference with a fresh, unique XML ID
95        and assign it to the MetadataReference attribute.
96        </p>
97     */
98    void ensureMetadataReference();
99
100};
101
102//=============================================================================
103
104}; }; }; };
105
106#endif
107