2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-07-06 06:48:07 +00:00
|
|
|
|
2013-10-23 19:18:54 +02:00
|
|
|
#ifndef INCLUDED_DBACCESS_ICONTROLLER_HXX
|
|
|
|
#define INCLUDED_DBACCESS_ICONTROLLER_HXX
|
2007-07-06 06:48:07 +00:00
|
|
|
|
2016-06-15 21:00:59 -07:00
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/uno/RuntimeException.hpp>
|
2007-07-06 06:48:07 +00:00
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
2013-11-09 15:53:08 -06:00
|
|
|
#include <dbaccess/dbaccessdllapi.h>
|
2016-06-15 21:00:59 -07:00
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <sal/types.h>
|
2007-07-06 06:48:07 +00:00
|
|
|
|
2008-03-06 16:53:44 +00:00
|
|
|
namespace com { namespace sun { namespace star {
|
2016-06-15 21:00:59 -07:00
|
|
|
namespace beans {
|
|
|
|
struct PropertyValue;
|
|
|
|
}
|
2008-03-06 16:53:44 +00:00
|
|
|
namespace util {
|
|
|
|
struct URL;
|
|
|
|
}
|
|
|
|
namespace frame {
|
|
|
|
class XController;
|
|
|
|
}
|
|
|
|
} } }
|
2007-07-06 06:48:07 +00:00
|
|
|
|
2008-06-25 11:27:56 +00:00
|
|
|
class NotifyEvent;
|
|
|
|
|
2007-07-06 06:48:07 +00:00
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
// interface for controller depended calls like commands
|
2014-07-09 10:40:50 +02:00
|
|
|
class DBACCESS_DLLPUBLIC IController
|
2007-07-06 06:48:07 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** executes the given command without checking if it is allowed
|
|
|
|
@param _rCommand the URL of the command
|
|
|
|
*/
|
2015-10-20 11:11:25 +02:00
|
|
|
virtual void executeUnChecked(const css::util::URL& _rCommand, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** executes the given command only when it is allowed
|
|
|
|
@param _rCommand
|
|
|
|
the URL of the command
|
|
|
|
*/
|
2015-10-20 11:11:25 +02:00
|
|
|
virtual void executeChecked(const css::util::URL& _rCommand, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** executes the given command without checking if it is allowed
|
|
|
|
@param _nCommandId
|
|
|
|
the id of the command URL
|
|
|
|
*/
|
2015-10-20 11:11:25 +02:00
|
|
|
virtual void executeUnChecked(sal_uInt16 _nCommandId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** executes the given command only when it is allowed
|
|
|
|
@param _nCommandId
|
|
|
|
the id of the command URL
|
|
|
|
*/
|
2015-10-20 11:11:25 +02:00
|
|
|
virtual void executeChecked(sal_uInt16 _nCommandId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
/** checks if the given Command is enabled
|
|
|
|
@param _nCommandId
|
|
|
|
the id of the command URL
|
|
|
|
|
|
|
|
@return
|
|
|
|
<TRUE/> if the command is allowed, otherwise <FALSE/>.
|
|
|
|
*/
|
2014-04-01 09:53:24 +02:00
|
|
|
virtual bool isCommandEnabled(sal_uInt16 _nCommandId) const = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** checks if the given Command is enabled
|
|
|
|
@param _rCompleteCommandURL
|
|
|
|
the URL of the command
|
|
|
|
|
|
|
|
@return
|
|
|
|
<TRUE/> if the command is allowed, otherwise <FALSE/>.
|
|
|
|
*/
|
2014-04-01 09:53:24 +02:00
|
|
|
virtual bool isCommandEnabled( const OUString& _rCompleteCommandURL ) const = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** notifyHiContrastChanged will be called when the hicontrast mode changed.
|
|
|
|
@param _bHiContrast
|
|
|
|
<TRUE/> when in hicontrast mode.
|
|
|
|
*/
|
2008-06-25 11:27:56 +00:00
|
|
|
virtual void notifyHiContrastChanged() = 0;
|
2007-07-06 06:48:07 +00:00
|
|
|
|
|
|
|
/** checks if the selected data source is read only
|
|
|
|
@return
|
|
|
|
<TRUE/> if read only, otherwise <FALSE/>
|
|
|
|
*/
|
2014-04-01 09:53:24 +02:00
|
|
|
virtual bool isDataSourceReadOnly() const = 0;
|
2008-03-06 16:53:44 +00:00
|
|
|
|
|
|
|
/** provides access to the model of the controller
|
|
|
|
|
|
|
|
This must be the same model as returned by XController::getModel, and might be <NULL/> when
|
|
|
|
the controller does not have an own model.
|
2017-01-19 17:58:58 +01:00
|
|
|
|
|
|
|
@throws css::uno::RuntimeException
|
2008-03-06 16:53:44 +00:00
|
|
|
*/
|
2015-10-20 11:11:25 +02:00
|
|
|
virtual css::uno::Reference< css::frame::XController >
|
2017-01-26 12:28:58 +01:00
|
|
|
getXController() = 0;
|
2008-06-25 11:27:56 +00:00
|
|
|
|
|
|
|
/** allows interception of user input, aka mouse clicks and key events
|
|
|
|
*/
|
|
|
|
virtual bool interceptUserInput( const NotifyEvent& _rEvent ) = 0;
|
2012-03-14 13:27:56 +01:00
|
|
|
|
2014-07-09 10:40:50 +02:00
|
|
|
virtual void SAL_CALL acquire( ) throw () = 0;
|
|
|
|
virtual void SAL_CALL release( ) throw () = 0;
|
|
|
|
|
2012-03-14 13:27:56 +01:00
|
|
|
protected:
|
|
|
|
~IController() {}
|
2007-07-06 06:48:07 +00:00
|
|
|
};
|
|
|
|
}
|
2013-10-23 19:18:54 +02:00
|
|
|
#endif // INCLUDED_DBACCESS_ICONTROLLER_HXX
|
2010-10-27 12:33:13 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|