1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef CHART2_SHAPETOOLBARCONTROLLER_HXX
29 #define CHART2_SHAPETOOLBARCONTROLLER_HXX
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <com/sun/star/frame/XSubToolbarController.hpp>
35 #include <cppuhelper/implbase2.hxx>
36 #include <comphelper/implementationreference.hxx>
37 #include <comphelper/stl_types.hxx>
38 #include <svtools/toolboxcontroller.hxx>
40 class SfxToolBoxControl
;
42 //.............................................................................
45 //.............................................................................
47 typedef ::cppu::ImplHelper2
< ::com::sun::star::lang::XServiceInfo
,
48 ::com::sun::star::frame::XSubToolbarController
> ShapeToolbarController_Base
;
50 typedef ::comphelper::ImplementationReference
< SfxToolBoxControl
, ::com::sun::star::frame::XToolbarController
> TToolbarHelper
;
52 class ShapeToolbarController
: public ::svt::ToolboxController
53 ,public ShapeToolbarController_Base
55 DECLARE_STL_USTRINGACCESS_MAP( sal_Bool
, TCommandState
);
56 TCommandState m_aStates
;
57 TToolbarHelper m_pToolbarController
;
58 sal_uInt16 m_nToolBoxId
;
60 ShapeToolbarController( const ShapeToolbarController
& );
61 void operator =( const ShapeToolbarController
& );
64 ShapeToolbarController( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& rxFact
);
65 virtual ~ShapeToolbarController();
67 // ::com::sun::star::uno::XInterface
68 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
) throw (::com::sun::star::uno::RuntimeException
);
69 virtual void SAL_CALL
acquire() throw ();
70 virtual void SAL_CALL
release() throw ();
72 // ::com::sun::star::lang::XServiceInfo
73 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
74 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
76 // needed by registration
77 static ::rtl::OUString
getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException
);
78 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static(void) throw(::com::sun::star::uno::RuntimeException
);
79 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
80 create( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& xContext
);
81 virtual ::sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
83 // ::com::sun::star::lang::XInitialization
84 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& rArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
86 // ::com::sun::star::frame::XStatusListener
87 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
);
89 // ::com::sun::star::frame::XToolbarController
90 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
createPopupWindow() throw (::com::sun::star::uno::RuntimeException
);
92 // ::com::sun::star::frame::XSubToolbarController
93 virtual ::sal_Bool SAL_CALL
opensSubToolbar() throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::rtl::OUString SAL_CALL
getSubToolbarName() throw (::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
functionSelected( const ::rtl::OUString
& aCommand
) throw (::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
updateImage() throw (::com::sun::star::uno::RuntimeException
);
99 //.............................................................................
101 //.............................................................................
103 #endif //CHART2_SHAPETOOLBARCONTROLLER_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */