bump product version to 4.1.6.2
[LibreOffice.git] / framework / inc / uielement / complextoolbarcontroller.hxx
blob9bb3848ef362c35ac895db2cb6ebc9ece831df6c
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 __FRAMEWORK_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX_
21 #define __FRAMEWORK_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX_
23 #include <com/sun/star/util/URL.hpp>
24 #include <com/sun/star/beans/NamedValue.hpp>
25 #include <com/sun/star/frame/XDispatch.hpp>
26 #include <com/sun/star/frame/ControlCommand.hpp>
27 #include <com/sun/star/frame/XControlNotificationListener.hpp>
29 #include <svtools/toolboxcontroller.hxx>
30 #include <tools/link.hxx>
32 class ToolBox;
33 class Window;
35 namespace framework
38 struct ExecuteInfo
40 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
41 ::com::sun::star::util::URL aTargetURL;
42 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
45 struct NotifyInfo
47 OUString aEventName;
48 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XControlNotificationListener > xNotifyListener;
49 ::com::sun::star::util::URL aSourceURL;
50 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aInfoSeq;
53 class ComplexToolbarController : public svt::ToolboxController
56 public:
57 ComplexToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
58 const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
59 ToolBox* pToolBar,
60 sal_uInt16 nID,
61 const OUString& aCommand );
62 virtual ~ComplexToolbarController();
64 // XComponent
65 virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
67 // XToolbarController
68 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
70 // XStatusListener
71 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
73 DECL_STATIC_LINK( ComplexToolbarController, ExecuteHdl_Impl, ExecuteInfo* );
74 DECL_STATIC_LINK( ComplexToolbarController, Notify_Impl, NotifyInfo* );
76 protected:
77 static sal_Int32 getFontSizePixel( const Window* pWindow );
78 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > getDispatchFromCommand( const OUString& aCommand ) const;
79 void addNotifyInfo( const OUString& aEventName,
80 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& xDispatch,
81 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rInfo );
83 virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) = 0;
84 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
85 const ::com::sun::star::util::URL& getInitializedURL();
86 void notifyFocusGet();
87 void notifyFocusLost();
88 void notifyTextChanged( const OUString& aText );
90 ToolBox* m_pToolbar;
91 sal_uInt16 m_nID;
92 sal_Bool m_bMadeInvisible;
93 mutable ::com::sun::star::util::URL m_aURL;
94 ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
99 #endif // __FRAMEWORK_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX_
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */