xref: /aoo4110/main/sw/source/ui/vba/vbasystem.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SW_VBA_SYSTEM_HXX
24 #define SW_VBA_SYSTEM_HXX
25 
26 #include <ooo/vba/word/XSystem.hpp>
27 #include <vbahelper/vbahelperinterface.hxx>
28 #include <cppuhelper/implbase1.hxx>
29 #include <vbahelper/vbapropvalue.hxx>
30 
31 typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XSystem > SwVbaSystem_BASE;
32 
33 class PrivateProfileStringListener : public PropListener
34 {
35 private:
36     rtl::OUString maFileName;
37     ByteString maGroupName;
38     ByteString  maKey;
39 public:
PrivateProfileStringListener()40     PrivateProfileStringListener(){};
41     virtual ~PrivateProfileStringListener();
42     void Initialize( const rtl::OUString& rFileName, const ByteString& rGroupName, const ByteString& rKey );
43 
44     //PropListener
45     virtual void setValueEvent( const css::uno::Any& value );
46     virtual css::uno::Any getValueEvent();
47 };
48 
49 class SwVbaSystem : public SwVbaSystem_BASE
50 {
51 private:
52     PrivateProfileStringListener maPrivateProfileStringListener;
53 
54 public:
55 	SwVbaSystem( css::uno::Reference< css::uno::XComponentContext >& m_xContext );
56 	virtual ~SwVbaSystem();
57 
58 	// XSystem
59 	virtual sal_Int32 SAL_CALL getCursor() throw ( css::uno::RuntimeException );
60 	virtual void SAL_CALL setCursor( sal_Int32 _cursor ) throw ( css::uno::RuntimeException );
61     virtual css::uno::Any SAL_CALL PrivateProfileString( const rtl::OUString& rFilename, const rtl::OUString& rSection, const rtl::OUString& rKey ) throw ( css::uno::RuntimeException );
62 
63 	// XHelperInterface
64 	virtual rtl::OUString& getServiceImplName();
65 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
66 };
67 #endif /* SW_VBA_SYSTEM_HXX */
68