1*466d5a0bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*466d5a0bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*466d5a0bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*466d5a0bSAndrew Rist * distributed with this work for additional information 6*466d5a0bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*466d5a0bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*466d5a0bSAndrew Rist * "License"); you may not use this file except in compliance 9*466d5a0bSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*466d5a0bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*466d5a0bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*466d5a0bSAndrew Rist * software distributed under the License is distributed on an 15*466d5a0bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*466d5a0bSAndrew Rist * KIND, either express or implied. See the License for the 17*466d5a0bSAndrew Rist * specific language governing permissions and limitations 18*466d5a0bSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*466d5a0bSAndrew Rist *************************************************************/ 21*466d5a0bSAndrew Rist 22*466d5a0bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include "desktopcontext.hxx" 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <vcl/svapp.hxx> 27cdf0e10cSrcweir 28cdf0e10cSrcweir using namespace rtl; 29cdf0e10cSrcweir using namespace com::sun::star::uno; 30cdf0e10cSrcweir 31cdf0e10cSrcweir namespace padmin 32cdf0e10cSrcweir { 33cdf0e10cSrcweir DesktopContext(const Reference<XCurrentContext> & ctx)34cdf0e10cSrcweirDesktopContext::DesktopContext( const Reference< XCurrentContext > & ctx ) 35cdf0e10cSrcweir : m_xNextContext( ctx ) 36cdf0e10cSrcweir { 37cdf0e10cSrcweir } 38cdf0e10cSrcweir getValueByName(const OUString & Name)39cdf0e10cSrcweirAny SAL_CALL DesktopContext::getValueByName( const OUString& Name) throw (RuntimeException) 40cdf0e10cSrcweir { 41cdf0e10cSrcweir Any retVal; 42cdf0e10cSrcweir 43cdf0e10cSrcweir if ( 0 == Name.compareToAscii( DESKTOP_ENVIRONMENT_NAME ) ) 44cdf0e10cSrcweir { 45cdf0e10cSrcweir retVal = makeAny( Application::GetDesktopEnvironment() ); 46cdf0e10cSrcweir } 47cdf0e10cSrcweir else if( m_xNextContext.is() ) 48cdf0e10cSrcweir { 49cdf0e10cSrcweir // Call next context in chain if found 50cdf0e10cSrcweir retVal = m_xNextContext->getValueByName( Name ); 51cdf0e10cSrcweir } 52cdf0e10cSrcweir return retVal; 53cdf0e10cSrcweir } 54cdf0e10cSrcweir 55cdf0e10cSrcweir } 56