1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_UI_VBA_VBASTYLE_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBASTYLE_HXX
21 
22 #include <ooo/vba/word/XStyle.hpp>
23 #include <vbahelper/vbahelperinterface.hxx>
24 #include <i18nlangtag/lang.h>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/style/XStyle.hpp>
28 #include <ooo/vba/word/XFont.hpp>
29 
30 typedef InheritedHelperInterfaceWeakImpl< ooo::vba::word::XStyle > SwVbaStyle_BASE;
31 
32 class SwVbaStyle : public SwVbaStyle_BASE
33 {
34 private:
35     css::uno::Reference< css::frame::XModel > mxModel;
36     css::uno::Reference< css::beans::XPropertySet > mxStyleProps;
37     css::uno::Reference< css::style::XStyle > mxStyle;
38 public:
39     /// @throws css::script::BasicErrorException
40     /// @throws css::uno::RuntimeException
41     SwVbaStyle( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet );
42 
43     /// @throws css::uno::RuntimeException
44     static void setStyle( const css::uno::Reference< css::beans::XPropertySet >& xParaProps, const css::uno::Any& xStyle );
45     /// @throws css::uno::RuntimeException
46     static LanguageType getLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps );
47     /// @throws css::uno::RuntimeException
48     static void setLanguageID( const css::uno::Reference< css::beans::XPropertySet >& xTCProps, LanguageType _languageid );
49 
50     // Attributes
51     virtual OUString SAL_CALL getName() override;
52     virtual void SAL_CALL setName( const OUString& Name ) override;
53     virtual ::sal_Int32 SAL_CALL getLanguageID( ) override;
54     virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) override;
55     virtual ::sal_Int32 SAL_CALL getType() override;
56     virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override;
57     virtual OUString SAL_CALL getNameLocal() override;
58     virtual void SAL_CALL setNameLocal( const OUString& _namelocal ) override;
59     virtual css::uno::Reference< ::ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override;
60     virtual sal_Bool SAL_CALL getAutomaticallyUpdate() override;
61     virtual void SAL_CALL setAutomaticallyUpdate( sal_Bool _automaticallyupdate ) override;
62     virtual css::uno::Any SAL_CALL getBaseStyle() override;
63     virtual void SAL_CALL setBaseStyle( const css::uno::Any& _basestyle ) override;
64     virtual css::uno::Any SAL_CALL getNextParagraphStyle() override;
65     virtual void SAL_CALL setNextParagraphStyle( const css::uno::Any& _nextparagraphstyle ) override;
66     virtual ::sal_Int32 SAL_CALL getListLevelNumber() override;
67 
68     //XDefaultProperty
getDefaultPropertyName()69     virtual OUString SAL_CALL getDefaultPropertyName(  ) override { return "Name"; }
70 
71     // XHelperInterface
72     virtual OUString getServiceImplName() override;
73     virtual css::uno::Sequence<OUString> getServiceNames() override;
74 };
75 
76 #endif //SW_VBA_AXIS_HXX
77 
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
79