12#include <com/sun/star/frame/XDispatchProvider.hpp>
13#include <com/sun/star/frame/XFrame.hpp>
14#include <com/sun/star/beans/PropertyValue.hpp>
15#include <com/sun/star/util/XURLTransformer.hpp>
25#include <core_resource.hxx>
34sal_Int64
const aDefLimitAry[] =
92 m_xWidget->set_entry_text(OUString::number(nLimit));
107 if (!
m_xWidget->get_value_changed_from_saved())
110 OUString sActiveText =
m_xWidget->get_active_text();
111 if (sActiveText ==
DBA_RES(STR_QUERY_LIMIT_ALL))
115 nLimit =
m_xWidget->get_active_text().toInt64();
128 for (
auto nIndex : aDefLimitAry)
138 bool bHandled =
false;
139 const sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
152 return bHandled || ChildKeyInput(rKEvt);
164 if (rComboBox.changed_by_direct_pick())
165 ActivateHdl(rComboBox);
170 GrabFocusToDocument();
176 const uno::Reference< uno::XComponentContext >& rxContext ) :
180 m_xLimitBox( nullptr )
189OUString SAL_CALL LimitBoxController::getImplementationName()
191 return "org.libreoffice.comp.dbu.LimitBoxController";
194sal_Bool SAL_CALL LimitBoxController::supportsService(
const OUString& _rServiceName)
197 for (
const OUString& s : aSupported)
198 if (s == _rServiceName)
204css::uno::Sequence< OUString > SAL_CALL LimitBoxController::getSupportedServiceNames()
206 return {
"com.sun.star.frame.ToolbarController" };
220 const frame::FeatureStateEvent& rEvent )
226 if ( rEvent.FeatureURL.Path ==
"DBLimit" )
228 if ( rEvent.IsEnabled )
231 sal_Int64 nLimit = 0;
232 if (rEvent.State >>= nLimit)
255 return uno::Reference< awt::XWindow >();
259 const uno::Reference< awt::XWindow >& xParent )
261 uno::Reference< awt::XWindow > xItemWindow;
275 const uno::Sequence< beans::PropertyValue >& rArgs )
277 uno::Reference< frame::XDispatchProvider > xDispatchProvider(
m_xFrame, uno::UNO_QUERY );
278 if ( xDispatchProvider.is() )
281 uno::Reference< frame::XDispatch >
xDispatch;
282 uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
284 aURL.Complete =
".uno:DBLimit";
285 xURLTransformer->parseStrict(
aURL );
286 xDispatch = xDispatchProvider->queryDispatch(
aURL, OUString(), 0 );
294extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
296 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& )
298 return cppu::acquire(new ::dbaui::LimitBoxController(context));
css::uno::Reference< css::lang::XComponent > m_xFrame
virtual void dispose() override
std::unique_ptr< weld::Builder > m_xBuilder
std::unique_ptr< weld::Container > m_xContainer
void InitControlBase(weld::Widget *pWidget)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static VclPtr< reference_type > Create(Arg &&... arg)
virtual ~LimitBoxController() override
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
virtual void SAL_CALL dispose() override
XComponent.
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow(const css::uno::Reference< css::awt::XWindow > &Parent) override
virtual void SAL_CALL doubleClick() override
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
XStatusListener.
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
XToolbarController.
LimitBoxController(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
VclPtr< LimitBox > m_xLimitBox
void dispatchCommand(const css::uno::Sequence< css::beans::PropertyValue > &rArgs)
virtual void SAL_CALL click() override
Input box to add limit to an SQL query (maximum number of result's rows) This box is reachable on the...
virtual void dispose() override
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
DECL_LINK(FocusOutHdl, weld::Widget &, void)
virtual ~LimitBox() override
DECL_LINK(ActivateHdl, weld::ComboBox &, bool)
DECL_LINK(ChangeHdl, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > m_xWidget
LimitBoxController * m_pControl
void LoadDefaultLimits()
Initialize entries.
LimitBox(vcl::Window *pParent, LimitBoxController *pCtrl)
void set_value(int nLimit)
void set_sensitive(bool bSensitive)
virtual void SetSizePixel(const Size &rNewSize)
Reference< XDispatch > xDispatch
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_libreoffice_comp_dbu_LimitBoxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
#define LINK(Instance, Class, Member)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
css::uno::Sequence< OUString > getSupportedServiceNames()
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
cppu::ImplInheritanceHelper< ::svt::ToolboxController, css::lang::XServiceInfo > LimitBoxController_Base
A ToolboxController to paste LimitBox onto the Query Design Toolbar It is communicating with querycon...