Files
libreoffice/framework/inc/dispatch/dispatchprovider.hxx

131 lines
7.5 KiB
C++
Raw Normal View History

2010-10-27 13:11:31 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by: Armin Le Grand. #118558# Correcting OLE attributes of LO3.4 at load time by loading as OOo3.3, details see task. http://svn.apache.org/viewvc?view=revision&revision=1195906 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles http://svn.apache.org/viewvc?view=revision&revision=1293316 #119337# Solves the wrong get/setPropertyValue calls in SvxShapeText (and thus in SvxOle2Shape) http://svn.apache.org/viewvc?view=revision&revision=1344156 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117717#: remove wrong assertion http://svn.apache.org/viewvc?view=revision&revision=1172349 Patch contributed by Herbert Duerr goodbye Registration and License dialogs, don't let the door hit you http://svn.apache.org/viewvc?view=revision&revision=1172613 help gcc 4.6.0 on 32bit ubuntu 11.10" http://svn.apache.org/viewvc?view=revision&revision=1245357 Do not add targets for junit tests when junit is disabled. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1241508 Revert "sb140: #i117082# avoid unncessary static class data members commit 21d97438e2944861e26e4984195f959a0cce1e41. remove obsolete FreeBSD visibility special case. retain consolidated BSD bridge code, remove OS/2 pieces.
2012-11-12 17:21:24 +00: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 .
*/
2001-07-02 12:52:33 +00:00
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_DISPATCHPROVIDER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_DISPATCHPROVIDER_HXX
2001-07-02 12:52:33 +00:00
#include <classes/protocolhandlercache.hxx>
2001-07-02 12:52:33 +00:00
#include <threadhelp/transactionbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/generic.hxx>
#include <stdtypes.h>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
#include <com/sun/star/frame/XFrame.hpp>
2001-07-02 12:52:33 +00:00
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
2001-07-02 12:52:33 +00:00
#include <cppuhelper/implbase1.hxx>
2001-07-02 12:52:33 +00:00
#include <cppuhelper/weakref.hxx>
namespace framework{
/**
@descr We know some special dispatch objects with different functionality.
The can be created internally by the following DispatchProvider.
Here we define some identifier to force creation of the right one.
*/
2001-07-02 12:52:33 +00:00
enum EDispatchHelper
{
2001-11-28 10:08:13 +00:00
E_DEFAULTDISPATCHER ,
2001-07-02 12:52:33 +00:00
E_MENUDISPATCHER ,
E_CREATEDISPATCHER ,
E_BLANKDISPATCHER ,
E_SELFDISPATCHER ,
CWS-TOOLING: integrate CWS vcl97 2008-12-11 20:47:52 +0100 pl r265361 : #i93173# revert change, event listeners on the toolbar can lead to crashes 2008-12-11 17:55:54 +0100 pl r265344 : #i92715# fix some border cases 2008-12-11 16:36:01 +0100 pl r265334 : remove forgotten debug printf 2008-12-11 15:54:25 +0100 pl r265323 : add missing pointer initializer 2008-12-11 14:08:44 +0100 as r265297 : #i86520# dont show start module twice 2008-12-11 12:56:34 +0100 as r265289 : #i86520# dont show start module twice 2008-12-11 12:22:18 +0100 pl r265280 : fix a snafu 2008-12-11 12:15:27 +0100 hdu r265279 : #i96549# change some dbg_assert to dbg_warn 2008-12-11 11:57:22 +0100 pl r265276 : #i86520# startcenter on dock item click for mac 2008-12-11 11:31:47 +0100 pl r265271 : #i96964# fix a wrong condition 2008-12-11 11:21:49 +0100 as r265268 : #i86520# new framework slot for ShowStartModule 2008-12-11 10:17:32 +0100 hdu r265251 : #i97127# use fontconfig fallbacks for psprinting too (thanks CMC!) 2008-12-09 10:18:41 +0100 hdu r265060 : #i96549# workaround MAC_OS_X_VERSION_* macros not defined in older SDKs 2008-12-09 09:39:47 +0100 hdu r265057 : #i89650# workaround bogus device resolutions 2008-12-09 09:14:23 +0100 hdu r265054 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-08 19:17:42 +0100 pl r265016 : CWS-TOOLING: rebase CWS vcl97 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 16:06:58 +0100 hdu r265004 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 only for the Aqua port 2008-12-08 12:16:26 +0100 hdu r264988 : #i96549# prepare for MAC_OS_X_VERSION_MIN_REQUIRED>=1050 2008-12-08 11:59:25 +0100 hdu r264982 : #i96549# set MAC_OS_X_VERSION_MIN_REQUIRED=1040 2008-12-04 18:19:43 +0100 pl r264866 : #i86520# install a handler to be called on dock icon clicked 2008-12-03 13:04:32 +0100 pl r264769 : #i96551# on quartz build neither gtk nor cups in psprint is needed 2008-11-26 15:07:07 +0100 hdu r264400 : #i96317# adjust to extented SAL_DISABLE_FC_SUBST semantic 2008-11-21 16:15:31 +0100 pl r264147 : #i94443# generalize focus behavior when a child window becomes invisible 2008-11-21 15:45:03 +0100 pl r264144 : #i96433# improve torn off toolbar behavior 2008-11-21 11:50:01 +0100 pl r264119 : #i90083# improve key event dispatching 2008-11-20 17:28:03 +0100 pl r264076 : #i92715# do not execute app events during document recovery 2008-11-20 15:04:32 +0100 pl r264057 : #i92224# #i93249# more aqua key codes 2008-11-20 14:03:00 +0100 pl r264052 : #i92224# #i93249# remove debug printf 2008-11-20 14:00:29 +0100 pl r264049 : #i92224# #i93249# more aqua key codes 2008-11-20 13:59:34 +0100 pl r264048 : #i92224# #i93249# more aqua key codes 2008-11-20 13:52:38 +0100 pl r264047 : #i92224# #i93249# more aqua key codes 2008-11-19 18:42:17 +0100 pl r264017 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:40:26 +0100 pl r264016 : #i93249# support some mac specifc key codes: select to line end/begin 2008-11-19 18:32:31 +0100 pl r264014 : #i92224# support some mac specifc key codes: select to line end/begin 2008-11-19 17:34:50 +0100 pl r264009 : #i92224# some more needed keycodes 2008-11-19 16:11:33 +0100 pl r264003 : #i93249# support some mac specifc key codes 2008-11-19 16:10:31 +0100 pl r264002 : #i93249# support some mac specifc key codes 2008-11-19 15:50:03 +0100 pl r264000 : #i93249# support some mac specifc key codes 2008-11-19 14:17:41 +0100 pl r263993 : #i90015# strip appended parenthese entries from menubar 2008-11-17 18:30:37 +0100 pl r263737 : #i94601# emulate menu functionality for non vcl dialogs 2008-11-17 17:31:12 +0100 pl r263731 : #i95263# set inactive tab color on mac more distinct from the active tab color 2008-11-17 17:13:38 +0100 pl r263729 : #i93173# delete toolbar window in a more stack aware manner
2009-01-02 15:26:18 +00:00
E_CLOSEDISPATCHER ,
E_STARTMODULEDISPATCHER
2001-07-02 12:52:33 +00:00
};
/**
2001-07-02 12:52:33 +00:00
@short implement a helper for XDispatchProvider interface
@descr The result of a queryDispatch() call depends from the owner, which use an instance of this class.
(frame, desktop) All of them must provides different functionality.
E.g: - task can be created by the desktop only
- a task can have a beamer as direct child
- a normal frame never can create a new one by himself
@attention Use this class as member only! Never use it as baseclass.
XInterface will be ambigous and we hold a weakreference to our OWNER - not to our SUPERCLASS!
2001-07-02 12:52:33 +00:00
@base OWeakObject
provides ref count and weak mechanism
2001-07-02 12:52:33 +00:00
@devstatus ready to use
@threadsafe yes
*/
class DispatchProvider : private TransactionBase ,
// interfaces
public ::cppu::WeakImplHelper1< css::frame::XDispatchProvider >
2001-07-02 12:52:33 +00:00
{
/* member */
private:
/// reference to global service manager to create new services
css::uno::Reference< css::uno::XComponentContext > m_xContext;
/// weakreference to owner frame (Don't use a hard reference. Owner can't delete us then!)
css::uno::WeakReference< css::frame::XFrame > m_xFrame;
/// different dispatcher to handle special dispatch calls, protocols or URLs (they will be created on demand.)
css::uno::Reference< css::frame::XDispatch > m_xMenuDispatcher;
/// cache of some other dispatch provider which are registered inside configuration to handle special URL protocols
HandlerCache m_aProtocolHandlerCache;
/* interface */
2001-07-02 12:52:33 +00:00
public:
DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >& xContext ,
const css::uno::Reference< css::frame::XFrame >& xFrame );
2001-07-02 12:52:33 +00:00
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
const OUString& sTargetFrameName ,
sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) throw( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
2001-07-02 12:52:33 +00:00
/* helper */
2001-07-02 12:52:33 +00:00
protected:
// Let him protected! So nobody can use us as base ...
2001-07-02 12:52:33 +00:00
virtual ~DispatchProvider();
private:
css::uno::Reference< css::frame::XDispatch > implts_getOrCreateDispatchHelper ( EDispatchHelper eHelper ,
const css::uno::Reference< css::frame::XFrame >& xOwner ,
const OUString& sTarget = OUString() ,
sal_Int32 nSearchFlags = 0 );
bool implts_isLoadableContent ( const css::util::URL& aURL );
css::uno::Reference< css::frame::XDispatch > implts_queryDesktopDispatch ( const css::uno::Reference< css::frame::XFrame > xDesktop ,
const css::util::URL& aURL ,
const OUString& sTargetFrameName ,
sal_Int32 nSearchFlags );
css::uno::Reference< css::frame::XDispatch > implts_queryFrameDispatch ( const css::uno::Reference< css::frame::XFrame > xFrame ,
const css::util::URL& aURL ,
const OUString& sTargetFrameName ,
sal_Int32 nSearchFlags );
css::uno::Reference< css::frame::XDispatch > implts_searchProtocolHandler ( const css::util::URL& aURL );
}; // class DispatchProvider
} // namespace framework
#endif // INCLUDED_FRAMEWORK_INC_DISPATCH_DISPATCHPROVIDER_HXX
2010-10-27 13:11:31 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */