xref: /trunk/main/padmin/source/desktopcontext.cxx (revision 466d5a0b)
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 
24 #include "desktopcontext.hxx"
25 
26 #include <vcl/svapp.hxx>
27 
28 using namespace rtl;
29 using namespace com::sun::star::uno;
30 
31 namespace padmin
32 {
33 
DesktopContext(const Reference<XCurrentContext> & ctx)34 DesktopContext::DesktopContext( const Reference< XCurrentContext > & ctx )
35     : m_xNextContext( ctx )
36 {
37 }
38 
getValueByName(const OUString & Name)39 Any SAL_CALL DesktopContext::getValueByName( const OUString& Name) throw (RuntimeException)
40 {
41     Any retVal;
42 
43     if ( 0 == Name.compareToAscii( DESKTOP_ENVIRONMENT_NAME ) )
44     {
45         retVal = makeAny( Application::GetDesktopEnvironment() );
46     }
47     else if( m_xNextContext.is() )
48     {
49         // Call next context in chain if found
50         retVal = m_xNextContext->getValueByName( Name );
51     }
52     return retVal;
53 }
54 
55 }
56