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 
24 #ifndef _DBACCESS_UI_CALLBACKS_HXX_
25 #define _DBACCESS_UI_CALLBACKS_HXX_
26 
27 #ifndef _SOT_EXCHANGE_HXX
28 #include <sot/exchange.hxx>
29 #endif
30 #ifndef _SOT_FORMATS_HXX
31 #include <sot/formats.hxx>
32 #endif
33 #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_
34 #include <com/sun/star/container/XContainer.hpp>
35 #endif
36 
37 class CommandEvent;
38 class SvLBoxEntry;
39 class String;
40 class Point;
41 class PopupMenu;
42 class Control;
43 struct AcceptDropEvent;
44 struct ExecuteDropEvent;
45 
46 namespace cppu { class OInterfaceContainerHelper; }
47 
48 //........................................................................
49 namespace dbaui
50 {
51 //........................................................................
52 
53     class IController;
54     //====================================================================
55 	//= IControlActionListener
56 	//====================================================================
57 	class SAL_NO_VTABLE IControlActionListener
58 	{
59 	public:
60         /** requests a quick help text to display
61             @return <FALSE/> if the default quick help text should be used
62         */
63 		virtual sal_Bool    requestQuickHelp( const SvLBoxEntry* _pEntry, String& _rText ) const = 0;
64 
65 		/** handler for StartDrag requests
66 			@return <TRUE/> if a drag operation was started
67 		*/
68 		virtual sal_Bool	requestDrag( sal_Int8 _nAction, const Point& _rPosPixel ) = 0;
69 
70 		/** check whether or not a drop request should be accepted
71 		*/
72 		virtual sal_Int8	queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors ) = 0;
73 
74 		/** execute a drop request
75 		*/
76 		virtual sal_Int8	executeDrop( const ExecuteDropEvent& _rEvt ) = 0;
77 	};
78 
79     //====================================================================
80 	//= IContextMenuProvider
81 	//====================================================================
82     class SAL_NO_VTABLE IContextMenuProvider
83     {
84     public:
85         /** returns the context menu for the control
86 
87             Note that the menu does not need to care for the controls selection, or its
88             state in general.
89             The control itself will, using the controller provided by getCommandController,
90             disable menu entries as needed.
91         */
92         virtual PopupMenu*      getContextMenu( Control& _rControl ) const = 0;
93 
94         /** returns the controller which is responsible for providing states of certain features,
95             and executing them.
96         */
97         virtual IController&    getCommandController() = 0;
98 
99         /** returns the container of registered context menu interceptors, or NULL if the implementation
100             does not support context menu interception
101         */
102         virtual ::cppu::OInterfaceContainerHelper*
103                                 getContextMenuInterceptors() = 0;
104 
105         /** returns the current selection in the given control
106 
107             This selection is used for filling a ContextMenuExecuteEvent event for the given
108             control.
109         */
110         virtual ::com::sun::star::uno::Any
111                                 getCurrentSelection( Control& _rControl ) const = 0;
112     };
113 
114 	//====================================================================
115 	//= IDragTransferableListener
116 	//====================================================================
117 	class SAL_NO_VTABLE IDragTransferableListener
118 	{
119 	public:
120 		/// called when a drag operation done with a Transferable has been finished
121 		virtual void		dragFinished( ) = 0;
122 	};
123 
124 //........................................................................
125 }	// namespace dbaui
126 //........................................................................
127 
128 #endif // _DBACCESS_UI_CALLBACKS_HXX_
129 
130