1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _MACBACKEND_HXX_
29 #define _MACBACKEND_HXX_
30 
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 #include <rtl/string.hxx>
35 
36 // FIXME: stdio.h only for debugging...
37 #include <stdio.h>
38 
39 namespace css = com::sun::star;
40 namespace uno = css::uno;
41 namespace lang = css::lang;
42 
43 class MacOSXBackend : public ::cppu::WeakImplHelper2 <css::beans::XPropertySet, lang::XServiceInfo >
44 {
45 
46 public:
47 
48     static MacOSXBackend* createInstance();
49 
50     // XServiceInfo
51     virtual rtl::OUString SAL_CALL getImplementationName()
52         throw (uno::RuntimeException);
53 
54     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& aServiceName)
55         throw (uno::RuntimeException);
56 
57     virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames()
58         throw (uno::RuntimeException);
59 
60     /**
61        Provides the implementation name.
62 
63        @return   implementation name
64     */
65     static rtl::OUString SAL_CALL getBackendName(void);
66 
67     /**
68        Provides the supported services names
69 
70        @return   service names
71     */
72     static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void);
73 
74     // XPropertySet
75     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
76     getPropertySetInfo() throw (css::uno::RuntimeException)
77     { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
78 
79     virtual void SAL_CALL setPropertyValue(
80         rtl::OUString const &, css::uno::Any const &)
81         throw (
82             css::beans::UnknownPropertyException,
83             css::beans::PropertyVetoException,
84             css::lang::IllegalArgumentException,
85             css::lang::WrappedTargetException, css::uno::RuntimeException);
86 
87     virtual css::uno::Any SAL_CALL getPropertyValue(
88         rtl::OUString const & PropertyName)
89         throw (
90             css::beans::UnknownPropertyException,
91             css::lang::WrappedTargetException, css::uno::RuntimeException);
92 
93     virtual void SAL_CALL addPropertyChangeListener(
94         rtl::OUString const &,
95         css::uno::Reference< css::beans::XPropertyChangeListener > const &)
96         throw (
97             css::beans::UnknownPropertyException,
98             css::lang::WrappedTargetException, css::uno::RuntimeException)
99     {}
100 
101     virtual void SAL_CALL removePropertyChangeListener(
102         rtl::OUString const &,
103         css::uno::Reference< css::beans::XPropertyChangeListener > const &)
104         throw (
105             css::beans::UnknownPropertyException,
106             css::lang::WrappedTargetException, css::uno::RuntimeException)
107     {}
108 
109     virtual void SAL_CALL addVetoableChangeListener(
110         rtl::OUString const &,
111         css::uno::Reference< css::beans::XVetoableChangeListener > const &)
112         throw (
113             css::beans::UnknownPropertyException,
114             css::lang::WrappedTargetException, css::uno::RuntimeException)
115     {}
116 
117     virtual void SAL_CALL removeVetoableChangeListener(
118         rtl::OUString const &,
119         css::uno::Reference< css::beans::XVetoableChangeListener > const &)
120         throw (
121             css::beans::UnknownPropertyException,
122             css::lang::WrappedTargetException, css::uno::RuntimeException)
123     {}
124 
125 protected:
126 
127     /**
128        Service constructor from a service factory.
129 
130        @param xContext   component context
131     */
132     MacOSXBackend();
133 
134     /** Destructor */
135     ~MacOSXBackend(void);
136 };
137 
138 #endif // _MACBACKEND_HXX_
139