merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / inc / IController.hxx
blobc76ef596dcc0c5099b2f08858406d3a7d73dea37
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: IController.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBAUI_ICONTROLLER_HXX
32 #define DBAUI_ICONTROLLER_HXX
34 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
35 #include <com/sun/star/beans/PropertyValue.hpp>
36 #endif
37 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
38 #include <com/sun/star/uno/Sequence.hxx>
39 #endif
40 #ifndef DBAUI_IREFERENCE_HXX
41 #include "IReference.hxx"
42 #endif
43 #include "dbaccessdllapi.h"
45 namespace com { namespace sun { namespace star {
46 namespace util {
47 struct URL;
49 namespace frame {
50 class XController;
52 } } }
54 class NotifyEvent;
56 namespace dbaui
58 // interface for controller depended calls like commands
59 class DBACCESS_DLLPUBLIC IController : public IReference
61 public:
62 /** executes the given command without checking if it is allowed
63 @param _rCommand the URL of the command
65 virtual void executeUnChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
67 /** executes the given command only when it is allowed
68 @param _rCommand
69 the URL of the command
71 virtual void executeChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
73 /** executes the given command without checking if it is allowed
74 @param _nCommandId
75 the id of the command URL
77 virtual void executeUnChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
79 /** executes the given command only when it is allowed
80 @param _nCommandId
81 the id of the command URL
83 virtual void executeChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
86 /** checks if the given Command is enabled
87 @param _nCommandId
88 the id of the command URL
90 @return
91 <TRUE/> if the command is allowed, otherwise <FALSE/>.
93 virtual sal_Bool isCommandEnabled(sal_uInt16 _nCommandId) const = 0;
95 /** checks if the given Command is enabled
96 @param _rCompleteCommandURL
97 the URL of the command
99 @return
100 <TRUE/> if the command is allowed, otherwise <FALSE/>.
102 virtual sal_Bool isCommandEnabled( const ::rtl::OUString& _rCompleteCommandURL ) const = 0;
104 /** registers a command URL, giving it a unique name
106 If you call this with a command URL which is supported by the controller, then
107 you will simply get the controller's internal numeric shortcut to this command.
109 If you call this with a command URL which is not supported by the controller, then
110 you will get a new ID, which is unique during the lifetime of the controller.
112 If the command URL is invalid, or the controller cannot register new commands anymore,
113 then 0 is returned.
115 virtual sal_uInt16
116 registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL ) = 0;
118 /** notifyHiContrastChanged will be called when the hicontrast mode changed.
119 @param _bHiContrast
120 <TRUE/> when in hicontrast mode.
122 virtual void notifyHiContrastChanged() = 0;
124 /** checks if the selected data source is read only
125 @return
126 <TRUE/> if read only, otherwise <FALSE/>
128 virtual sal_Bool isDataSourceReadOnly() const = 0;
130 /** provides access to the model of the controller
132 This must be the same model as returned by XController::getModel, and might be <NULL/> when
133 the controller does not have an own model.
135 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
136 getXController(void) throw( ::com::sun::star::uno::RuntimeException ) = 0;
138 /** allows interception of user input, aka mouse clicks and key events
140 virtual bool interceptUserInput( const NotifyEvent& _rEvent ) = 0;
143 #endif // DBAUI_ICONTROLLER_HXX