1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_xforms_XFormsUIHelper1_idl__
24#define __com_sun_star_xforms_XFormsUIHelper1_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_xml_dom_XNode_idl__
31#include <com/sun/star/xml/dom/XNode.idl>
32#endif
33
34#ifndef __com_sun_star_beans_XPropertySet_idl__
35#include <com/sun/star/beans/XPropertySet.idl>
36#endif
37
38#ifndef __com_sun_star_container_XIndexAccess_idl__
39#include <com/sun/star/container/XSet.idl>
40#endif
41
42#ifndef __com_sun_star_xforms_XDataTypeRepository_idl__
43#include <com/sun/star/xforms/XDataTypeRepository.idl>
44#endif
45
46#ifndef __com_sun_star_xml_dom_XDocument_idl__
47#include <com/sun/star/xml/dom/XDocument.idl>
48#endif
49
50#ifndef __com_sun_star_xml_dom_XDocument_idl__
51#include <com/sun/star/xml/dom/XNode.idl>
52#endif
53
54#ifndef __com_sun_star_frame_XModel_idl__
55#include <com/sun/star/frame/XModel.idl>
56#endif
57
58#ifndef __com_sun_star_xforms_XModel_idl__
59#include <com/sun/star/xforms/XModel.idl>
60#endif
61
62
63//=============================================================================
64
65module com {  module sun {  module star {  module xforms {
66
67//=============================================================================
68
69/** provide several helper methods for the UI
70
71    <b>This interfaces is for UI use only, and will likely be unsupported in
72    future versions.</p>
73*/
74interface XFormsUIHelper1
75{
76    string getDefaultServiceNameForNode( [in] com::sun::star::xml::dom::XNode xNode );
77
78    string getDefaultBindingExpressionForNode( [in] com::sun::star::xml::dom::XNode xNode );
79
80    string getNodeDisplayName( [in] com::sun::star::xml::dom::XNode xNode,
81                               [in] boolean bDetail );
82
83    string getNodeName( [in] com::sun::star::xml::dom::XNode xNode );
84
85    string getBindingName( [in] com::sun::star::beans::XPropertySet xBinding,
86                           [in] boolean bDetail );
87
88    string getSubmissionName( [in] com::sun::star::beans::XPropertySet xSubm,
89                              [in] boolean bDetail );
90
91	// Creates a new binding based on the one passed as argument.
92	// The new binding does *not* contribute to the MIPs table and acts
93	// as a propertyset in disguise, which is what the UI needs this object for...
94	com::sun::star::beans::XPropertySet cloneBindingAsGhost( [in] com::sun::star::beans::XPropertySet binding );
95
96    void removeBindingIfUseless( [in] com::sun::star::beans::XPropertySet xBinding );
97
98    // handle instances
99
100    com::sun::star::xml::dom::XDocument newInstance( [in] string sName,
101                      [in] string sURL,
102                      [in] boolean bURLOnce );
103
104    void renameInstance( [in] string sFrom, [in] string sTo,
105                      [in] string sURL,
106                      [in] boolean bURLOnce );
107
108    void removeInstance( [in] string sName );
109
110
111    // handle models
112    com::sun::star::xforms::XModel newModel( [in] com::sun::star::frame::XModel xModel,
113                   [in] string sName );
114    void renameModel( [in] com::sun::star::frame::XModel xModel,
115                      [in] string sFrom, [in] string sTo );
116    void removeModel( [in] com::sun::star::frame::XModel xModel,
117                      [in] string sName );
118
119
120    // DOM helpers
121    com::sun::star::xml::dom::XNode
122        createElement( [in] com::sun::star::xml::dom::XNode xParent,
123                       [in] string sName );
124    com::sun::star::xml::dom::XNode
125        createAttribute( [in] com::sun::star::xml::dom::XNode xParent,
126                         [in] string sName );
127
128    com::sun::star::xml::dom::XNode renameNode(
129        [in] com::sun::star::xml::dom::XNode xNode,
130        [in] string sName );
131
132    com::sun::star::beans::XPropertySet getBindingForNode(
133        [in] com::sun::star::xml::dom::XNode xNode,
134        [in] boolean bCreate );
135
136    void removeBindingForNode(
137        [in] com::sun::star::xml::dom::XNode xNode );
138
139    string getResultForExpression(
140        [in] com::sun::star::beans::XPropertySet xBinding,
141        [in] boolean bIsBindingExpression,
142        [in] string sExpression );
143
144    boolean isValidXMLName( [in] string sName );
145
146    boolean isValidPrefixName( [in] string sName );
147
148    void setNodeValue(
149        [in] com::sun::star::xml::dom::XNode xNode,
150        [in] string sValue );
151
152};
153
154//=============================================================================
155
156}; }; }; };
157
158/*=============================================================================
159
160=============================================================================*/
161#endif
162