Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / callbacks.hxx
blob9c2a579a7a51ad9c862395bdddc5751ec88e951a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX
23 #include <sot/exchange.hxx>
24 #include <sot/formats.hxx>
25 #include <com/sun/star/container/XContainer.hpp>
27 class SvTreeListEntry;
28 class Point;
29 class PopupMenu;
30 class Control;
31 struct AcceptDropEvent;
32 struct ExecuteDropEvent;
34 namespace comphelper { class OInterfaceContainerHelper2; }
36 namespace dbaui
39 class IController;
40 // IControlActionListener
41 class SAL_NO_VTABLE IControlActionListener
43 public:
44 /** requests a quick help text to display
45 @return <FALSE/> if the default quick help text should be used
47 virtual bool requestQuickHelp( const SvTreeListEntry* _pEntry, OUString& _rText ) const = 0;
49 /** handler for StartDrag requests
50 @return <TRUE/> if a drag operation was started
52 virtual bool requestDrag( sal_Int8 _nAction, const Point& _rPosPixel ) = 0;
54 /** check whether or not a drop request should be accepted
56 virtual sal_Int8 queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors ) = 0;
58 /** execute a drop request
60 virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) = 0;
62 protected:
63 ~IControlActionListener() {}
66 // IContextMenuProvider
67 class SAL_NO_VTABLE IContextMenuProvider
69 public:
70 /** returns the context menu for the control
72 Note that the menu does not need to care for the controls selection, or its
73 state in general.
74 The control itself will, using the controller provided by getCommandController,
75 disable menu entries as needed.
77 virtual PopupMenu* getContextMenu( Control& _rControl ) const = 0;
79 /** returns the controller which is responsible for providing states of certain features,
80 and executing them.
82 virtual IController& getCommandController() = 0;
84 /** returns the container of registered context menu interceptors, or NULL if the implementation
85 does not support context menu interception
87 virtual ::comphelper::OInterfaceContainerHelper2*
88 getContextMenuInterceptors() = 0;
90 /** returns the current selection in the given control
92 This selection is used for filling a ContextMenuExecuteEvent event for the given
93 control.
95 virtual css::uno::Any getCurrentSelection( Control& _rControl ) const = 0;
97 protected:
98 ~IContextMenuProvider() {}
101 // IDragTransferableListener
102 class SAL_NO_VTABLE IDragTransferableListener
104 public:
105 /// called when a drag operation done with a Transferable has been finished
106 virtual void dragFinished( ) = 0;
108 protected:
109 ~IDragTransferableListener() {}
112 } // namespace dbaui
114 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CALLBACKS_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */