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_text_XTextContent_idl__
20 #define __com_sun_star_text_XTextContent_idl__
22 #include
<com
/sun
/star
/lang
/XComponent.idl
>
23 #include
<com
/sun
/star
/text
/XTextRange.idl
>
24 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
28 module com
{ module sun
{ module star
{ module text
{
31 /** enables objects to be inserted into a text and to provide their
32 location in a text once they are inserted into it.
34 published
interface XTextContent
: com
::sun
::star
::lang
::XComponent
37 /** is called when this object gets embedded in a text.
39 <p>This acts like a multi-phase construction, thus the object may be
40 invalid until it is attached to a text position. Usually this method
41 is called from within XText::insertTextContent().
44 <p>Both text objects and text content objects may only be connected
45 to each other if they are created by the same component. When
46 implementing new components, this behavior is deprecated.</p>
48 void attach
( [in] com
::sun
::star
::text
::XTextRange xTextRange
)
49 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
53 the text range to which the content is attached.
55 <p>Note: The anchor of the actual implementation for text tables
56 does not have a position in the text. Thus that anchor can not be
57 used for some operation like attach() for example or
58 com::sun::star::text::insertTextContent
59 or other function that require the object to have a position in the text.</p>
61 <p>The reason why a text table still needs an anchor is that for example
62 tables should be insertable via com::sun::star::text::insertTextContent
63 and that interface uses a parameter of that type.</p>
65 com
::sun
::star
::text
::XTextRange getAnchor
();
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */