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 .
21 module com
{ module sun
{ module star
{ module form
{ module validation
{
23 interface XValidityConstraintListener
;
26 /** specifies a component able to validate (the content of) other components
28 <p>Validators support simple validity checks and retrieving justifications for
31 <p>Validators may additionally support dynamic validity constraints. In such a case,
32 the validity of a given value may change, without the value changing itself.<br/>
33 To be notified about this, interested components should register as XValidityConstraintListener.
37 interface XValidator
: com
::sun
::star
::uno
::XInterface
39 /** determines whether the given value is valid
42 the value to check for validity
44 `TRUE` if and only if the value is considered valid.
46 boolean isValid
( [in] any Value
);
48 /** retrieves a justification for the invalidity of the given value
51 the value which has been recognized as being invalid
53 a human-readable string, which explains why the given value is considered invalid.
55 string explainInvalid
( [in] any Value
);
57 /** registers the given validity listener.
59 <p>Usually, an XValidatable instance will also add itself as validity listener,
60 as soon as the validator is introduced to it.</p>
62 <p>Implementations which do not support dynamic validity constraints should simply ignore this
65 @throws com::sun::star::lang::NullPointerException
66 if the given listener is `NULL`
67 @see XValidityConstraintListener
69 void addValidityConstraintListener
( [in] XValidityConstraintListener Listener
)
70 raises
( com
::sun
::star
::lang
::NullPointerException
);
72 /** revokes the given validity listener
74 @throws com::sun::star::lang::NullPointerException
75 if the given listener is `NULL`
76 @see XValidityConstraintListener
78 void removeValidityConstraintListener
( [in] XValidityConstraintListener Listener
)
79 raises
( com
::sun
::star
::lang
::NullPointerException
);
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */