1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _DBACCESS_UI_CALLBACKS_HXX_ 29 #define _DBACCESS_UI_CALLBACKS_HXX_ 30 31 #ifndef _SOT_EXCHANGE_HXX 32 #include <sot/exchange.hxx> 33 #endif 34 #ifndef _SOT_FORMATS_HXX 35 #include <sot/formats.hxx> 36 #endif 37 #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_ 38 #include <com/sun/star/container/XContainer.hpp> 39 #endif 40 41 class CommandEvent; 42 class SvLBoxEntry; 43 class String; 44 class Point; 45 class PopupMenu; 46 class Control; 47 struct AcceptDropEvent; 48 struct ExecuteDropEvent; 49 50 namespace cppu { class OInterfaceContainerHelper; } 51 52 //........................................................................ 53 namespace dbaui 54 { 55 //........................................................................ 56 57 class IController; 58 //==================================================================== 59 //= IControlActionListener 60 //==================================================================== 61 class SAL_NO_VTABLE IControlActionListener 62 { 63 public: 64 /** requests a quick help text to display 65 @return <FALSE/> if the default quick help text should be used 66 */ 67 virtual sal_Bool requestQuickHelp( const SvLBoxEntry* _pEntry, String& _rText ) const = 0; 68 69 /** handler for StartDrag requests 70 @return <TRUE/> if a drag operation was started 71 */ 72 virtual sal_Bool requestDrag( sal_Int8 _nAction, const Point& _rPosPixel ) = 0; 73 74 /** check whether or not a drop request should be accepted 75 */ 76 virtual sal_Int8 queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors ) = 0; 77 78 /** execute a drop request 79 */ 80 virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) = 0; 81 }; 82 83 //==================================================================== 84 //= IContextMenuProvider 85 //==================================================================== 86 class SAL_NO_VTABLE IContextMenuProvider 87 { 88 public: 89 /** returns the context menu for the control 90 91 Note that the menu does not need to care for the controls selection, or its 92 state in general. 93 The control itself will, using the controller provided by getCommandController, 94 disable menu entries as needed. 95 */ 96 virtual PopupMenu* getContextMenu( Control& _rControl ) const = 0; 97 98 /** returns the controller which is responsible for providing states of certain features, 99 and executing them. 100 */ 101 virtual IController& getCommandController() = 0; 102 103 /** returns the container of registered context menu interceptors, or NULL if the implementation 104 does not support context menu interception 105 */ 106 virtual ::cppu::OInterfaceContainerHelper* 107 getContextMenuInterceptors() = 0; 108 109 /** returns the current selection in the given control 110 111 This selection is used for filling a ContextMenuExecuteEvent event for the given 112 control. 113 */ 114 virtual ::com::sun::star::uno::Any 115 getCurrentSelection( Control& _rControl ) const = 0; 116 }; 117 118 //==================================================================== 119 //= IDragTransferableListener 120 //==================================================================== 121 class SAL_NO_VTABLE IDragTransferableListener 122 { 123 public: 124 /// called when a drag operation done with a Transferable has been finished 125 virtual void dragFinished( ) = 0; 126 }; 127 128 //........................................................................ 129 } // namespace dbaui 130 //........................................................................ 131 132 #endif // _DBACCESS_UI_CALLBACKS_HXX_ 133 134