Get the style color and number just once
[LibreOffice.git] / offapi / com / sun / star / sdbc / XSQLData.idl
blobc75962a88d593ee3d38f49344a74e0ffc1bfeef2
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 .
20 module com { module sun { module star { module sdbc {
22 published interface XSQLInput;
23 published interface XSQLOutput;
26 /** is used for the custom mapping of SQL user-defined types.
29 <p>
30 This interface must be implemented by a service that is
31 registered in a type mapping. It is expected that this interface
32 will normally be implemented by a tool. The methods in this interface
33 are called by the driver and are never called by a programmer
34 directly.
35 </p>
37 published interface XSQLData: com::sun::star::uno::XInterface
40 /** returns the fully-qualified name of the SQL user-defined type
41 that this object represents.
44 <p>
45 This method is called by the SDBC driver to get the name of the
46 UDT instance that is being mapped to this instance of SQLData.
47 </p>
48 @returns
49 the name of the SQL type.
50 @throws SQLException
51 if a database access error occurs.
53 string getSQLTypeName() raises (SQLException);
56 /** populates this object with data read from the database.
59 <p>
60 The implementation of the method must follow this protocol:
61 <br/>
62 It must read each of the attributes or elements of the SQL
63 type from the given input stream. This is done
64 by calling a method of the input stream to read each
65 item, in the order that they appear in the SQL definition
66 of the type. The method
67 <code>readSQL</code>
68 then assigns the data to appropriate fields or elements (of this
69 or other objects).
70 <br/>
71 Specifically, it must call the appropriate
72 <code>XSQLInput.readXXX</code>
73 method(s) to do the following:
74 for a Distinct Type, read its single data element;
75 for a Structured Type, read a value for each attribute of the SQL type.
76 </p>
77 <p>
78 The SDBC driver initializes the input stream with a type map
79 before calling this method, which is used by the appropriate
80 <code>SQLInput.readXXX</code>
81 method on the stream.
82 </p>
84 @param stream
85 the input SQL data stream
86 @param typeName
87 the SQL type of the value on the data stream
88 @throws SQLException
89 if a database access error occurs.
91 @see com::sun::star::sdbc::XSQLInput
93 void readSQL([in]XSQLInput stream, [in]string typeName)
94 raises (SQLException);
96 /** writes this object to the given SQL data stream.
99 <p>
100 The implementation of the method must follow this protocol:
101 <br/>
102 It must write each of the attributes of the SQL type to the given output
103 stream. This is done by calling a method of the output stream to write
104 each item, in the order that they appear in the SQL definition of the type.
105 Specifically, it must call the appropriate
106 <code>XSQLOutput.writeXXX</code>
107 method(s) to do the following:<br>
108 for a Distinct Type, write its single data element;
109 for a Structured Type, write a value for each attribute of the SQL type.
110 </p>
111 @param stream
112 the output SQL data stream
113 @throws SQLException
114 if a database access error occurs.
115 @see com::sun::star::sdbc::XSQLOutput
117 void writeSQL([in]XSQLOutput stream) raises (SQLException);
121 }; }; }; };
123 /*===========================================================================
124 ===========================================================================*/
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */