1*10b918a5SAriel Constenla-Haile /**************************************************************
2*10b918a5SAriel Constenla-Haile  *
3*10b918a5SAriel Constenla-Haile  * Licensed to the Apache Software Foundation (ASF) under one
4*10b918a5SAriel Constenla-Haile  * or more contributor license agreements.  See the NOTICE file
5*10b918a5SAriel Constenla-Haile  * distributed with this work for additional information
6*10b918a5SAriel Constenla-Haile  * regarding copyright ownership.  The ASF licenses this file
7*10b918a5SAriel Constenla-Haile  * to you under the Apache License, Version 2.0 (the
8*10b918a5SAriel Constenla-Haile  * "License"); you may not use this file except in compliance
9*10b918a5SAriel Constenla-Haile  * with the License.  You may obtain a copy of the License at
10*10b918a5SAriel Constenla-Haile  *
11*10b918a5SAriel Constenla-Haile  *   http://www.apache.org/licenses/LICENSE-2.0
12*10b918a5SAriel Constenla-Haile  *
13*10b918a5SAriel Constenla-Haile  * Unless required by applicable law or agreed to in writing,
14*10b918a5SAriel Constenla-Haile  * software distributed under the License is distributed on an
15*10b918a5SAriel Constenla-Haile  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*10b918a5SAriel Constenla-Haile  * KIND, either express or implied.  See the License for the
17*10b918a5SAriel Constenla-Haile  * specific language governing permissions and limitations
18*10b918a5SAriel Constenla-Haile  * under the License.
19*10b918a5SAriel Constenla-Haile  *
20*10b918a5SAriel Constenla-Haile  *************************************************************/
21*10b918a5SAriel Constenla-Haile 
22*10b918a5SAriel Constenla-Haile #ifndef __FRAMEWORK_UIELEMENT_POPUPMENU_TOOLBARCONTROLLER_HXX__
23*10b918a5SAriel Constenla-Haile #define __FRAMEWORK_UIELEMENT_POPUPMENU_TOOLBARCONTROLLER_HXX__
24*10b918a5SAriel Constenla-Haile 
25*10b918a5SAriel Constenla-Haile #include <com/sun/star/awt/XPopupMenu.hpp>
26*10b918a5SAriel Constenla-Haile #include <com/sun/star/frame/XPopupMenuController.hpp>
27*10b918a5SAriel Constenla-Haile #include <com/sun/star/frame/XUIControllerFactory.hpp>
28*10b918a5SAriel Constenla-Haile #include <com/sun/star/lang/XServiceInfo.hpp>
29*10b918a5SAriel Constenla-Haile #include <cppuhelper/implbase1.hxx>
30*10b918a5SAriel Constenla-Haile #include <macros/xserviceinfo.hxx>
31*10b918a5SAriel Constenla-Haile #include <svtools/toolboxcontroller.hxx>
32*10b918a5SAriel Constenla-Haile 
33*10b918a5SAriel Constenla-Haile namespace framework
34*10b918a5SAriel Constenla-Haile {
35*10b918a5SAriel Constenla-Haile     class PopupMenuToolbarController : public svt::ToolboxController
36*10b918a5SAriel Constenla-Haile     {
37*10b918a5SAriel Constenla-Haile     public:
38*10b918a5SAriel Constenla-Haile         virtual ~PopupMenuToolbarController();
39*10b918a5SAriel Constenla-Haile 
40*10b918a5SAriel Constenla-Haile         // XComponent
41*10b918a5SAriel Constenla-Haile         virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
42*10b918a5SAriel Constenla-Haile         // XInitialization
43*10b918a5SAriel Constenla-Haile         virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
44*10b918a5SAriel Constenla-Haile         // XToolbarController
45*10b918a5SAriel Constenla-Haile         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
46*10b918a5SAriel Constenla-Haile         // XStatusListener
47*10b918a5SAriel Constenla-Haile         virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& rEvent ) throw ( ::com::sun::star::uno::RuntimeException );
48*10b918a5SAriel Constenla-Haile 
49*10b918a5SAriel Constenla-Haile     protected:
50*10b918a5SAriel Constenla-Haile         PopupMenuToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
51*10b918a5SAriel Constenla-Haile                                     const ::rtl::OUString &rPopupCommand = rtl::OUString() );
52*10b918a5SAriel Constenla-Haile         virtual void functionExecuted( const rtl::OUString &rCommand );
53*10b918a5SAriel Constenla-Haile         virtual sal_uInt16 getDropDownStyle() const;
54*10b918a5SAriel Constenla-Haile         void createPopupMenuController();
55*10b918a5SAriel Constenla-Haile 
56*10b918a5SAriel Constenla-Haile         com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >      m_xContext;
57*10b918a5SAriel Constenla-Haile         sal_Bool                                                                      m_bHasController;
58*10b918a5SAriel Constenla-Haile         com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >             m_xPopupMenu;
59*10b918a5SAriel Constenla-Haile 
60*10b918a5SAriel Constenla-Haile     private:
61*10b918a5SAriel Constenla-Haile         rtl::OUString                                                                 m_aPopupCommand;
62*10b918a5SAriel Constenla-Haile         com::sun::star::uno::Reference< com::sun::star::frame::XUIControllerFactory > m_xPopupMenuFactory;
63*10b918a5SAriel Constenla-Haile         com::sun::star::uno::Reference< com::sun::star::frame::XPopupMenuController > m_xPopupMenuController;
64*10b918a5SAriel Constenla-Haile     };
65*10b918a5SAriel Constenla-Haile 
66*10b918a5SAriel Constenla-Haile     class OpenToolbarController : public PopupMenuToolbarController
67*10b918a5SAriel Constenla-Haile     {
68*10b918a5SAriel Constenla-Haile     public:
69*10b918a5SAriel Constenla-Haile         OpenToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
70*10b918a5SAriel Constenla-Haile 
71*10b918a5SAriel Constenla-Haile         // XServiceInfo
72*10b918a5SAriel Constenla-Haile         DECLARE_XSERVICEINFO
73*10b918a5SAriel Constenla-Haile     };
74*10b918a5SAriel Constenla-Haile 
75*10b918a5SAriel Constenla-Haile     class NewToolbarController : public PopupMenuToolbarController
76*10b918a5SAriel Constenla-Haile     {
77*10b918a5SAriel Constenla-Haile     public:
78*10b918a5SAriel Constenla-Haile         NewToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
79*10b918a5SAriel Constenla-Haile 
80*10b918a5SAriel Constenla-Haile         // XServiceInfo
81*10b918a5SAriel Constenla-Haile         DECLARE_XSERVICEINFO
82*10b918a5SAriel Constenla-Haile     private:
83*10b918a5SAriel Constenla-Haile         void functionExecuted( const rtl::OUString &rCommand );
84*10b918a5SAriel Constenla-Haile         void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& rEvent ) throw ( ::com::sun::star::uno::RuntimeException );
85*10b918a5SAriel Constenla-Haile         void setItemImage( const rtl::OUString &rCommand );
86*10b918a5SAriel Constenla-Haile     };
87*10b918a5SAriel Constenla-Haile 
88*10b918a5SAriel Constenla-Haile     class WizardsToolbarController : public PopupMenuToolbarController
89*10b918a5SAriel Constenla-Haile     {
90*10b918a5SAriel Constenla-Haile     public:
91*10b918a5SAriel Constenla-Haile         WizardsToolbarController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
92*10b918a5SAriel Constenla-Haile 
93*10b918a5SAriel Constenla-Haile         // XServiceInfo
94*10b918a5SAriel Constenla-Haile         DECLARE_XSERVICEINFO
95*10b918a5SAriel Constenla-Haile     private:
96*10b918a5SAriel Constenla-Haile         sal_uInt16 getDropDownStyle() const;
97*10b918a5SAriel Constenla-Haile     };
98*10b918a5SAriel Constenla-Haile }
99*10b918a5SAriel Constenla-Haile 
100*10b918a5SAriel Constenla-Haile #endif
101