Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / inc / IController.hxx
blob78cce794e77efbc213f878056b79a7dbfbaeaabd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef DBAUI_ICONTROLLER_HXX
30 #define DBAUI_ICONTROLLER_HXX
32 #include <com/sun/star/beans/PropertyValue.hpp>
33 #include <com/sun/star/uno/Sequence.hxx>
34 #include "IReference.hxx"
35 #include "dbaccessdllapi.h"
37 namespace com { namespace sun { namespace star {
38 namespace util {
39 struct URL;
41 namespace frame {
42 class XController;
44 } } }
46 class NotifyEvent;
48 namespace dbaui
50 // interface for controller depended calls like commands
51 class DBACCESS_DLLPUBLIC IController : public IReference
53 public:
54 /** executes the given command without checking if it is allowed
55 @param _rCommand the URL of the command
57 virtual void executeUnChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
59 /** executes the given command only when it is allowed
60 @param _rCommand
61 the URL of the command
63 virtual void executeChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
65 /** executes the given command without checking if it is allowed
66 @param _nCommandId
67 the id of the command URL
69 virtual void executeUnChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
71 /** executes the given command only when it is allowed
72 @param _nCommandId
73 the id of the command URL
75 virtual void executeChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) = 0;
78 /** checks if the given Command is enabled
79 @param _nCommandId
80 the id of the command URL
82 @return
83 <TRUE/> if the command is allowed, otherwise <FALSE/>.
85 virtual sal_Bool isCommandEnabled(sal_uInt16 _nCommandId) const = 0;
87 /** checks if the given Command is enabled
88 @param _rCompleteCommandURL
89 the URL of the command
91 @return
92 <TRUE/> if the command is allowed, otherwise <FALSE/>.
94 virtual sal_Bool isCommandEnabled( const ::rtl::OUString& _rCompleteCommandURL ) const = 0;
96 /** registers a command URL, giving it a unique name
98 If you call this with a command URL which is supported by the controller, then
99 you will simply get the controller's internal numeric shortcut to this command.
101 If you call this with a command URL which is not supported by the controller, then
102 you will get a new ID, which is unique during the lifetime of the controller.
104 If the command URL is invalid, or the controller cannot register new commands anymore,
105 then 0 is returned.
107 virtual sal_uInt16
108 registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL ) = 0;
110 /** notifyHiContrastChanged will be called when the hicontrast mode changed.
111 @param _bHiContrast
112 <TRUE/> when in hicontrast mode.
114 virtual void notifyHiContrastChanged() = 0;
116 /** checks if the selected data source is read only
117 @return
118 <TRUE/> if read only, otherwise <FALSE/>
120 virtual sal_Bool isDataSourceReadOnly() const = 0;
122 /** provides access to the model of the controller
124 This must be the same model as returned by XController::getModel, and might be <NULL/> when
125 the controller does not have an own model.
127 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
128 getXController(void) throw( ::com::sun::star::uno::RuntimeException ) = 0;
130 /** allows interception of user input, aka mouse clicks and key events
132 virtual bool interceptUserInput( const NotifyEvent& _rEvent ) = 0;
134 protected:
135 ~IController() {}
138 #endif // DBAUI_ICONTROLLER_HXX
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */