1*983d4c8aSAndrew Rist /************************************************************** 2*983d4c8aSAndrew Rist * 3*983d4c8aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*983d4c8aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*983d4c8aSAndrew Rist * distributed with this work for additional information 6*983d4c8aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*983d4c8aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*983d4c8aSAndrew Rist * "License"); you may not use this file except in compliance 9*983d4c8aSAndrew Rist * with the License. You may obtain a copy of the License at 10*983d4c8aSAndrew Rist * 11*983d4c8aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*983d4c8aSAndrew Rist * 13*983d4c8aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*983d4c8aSAndrew Rist * software distributed under the License is distributed on an 15*983d4c8aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*983d4c8aSAndrew Rist * KIND, either express or implied. See the License for the 17*983d4c8aSAndrew Rist * specific language governing permissions and limitations 18*983d4c8aSAndrew Rist * under the License. 19*983d4c8aSAndrew Rist * 20*983d4c8aSAndrew Rist *************************************************************/ 21*983d4c8aSAndrew Rist 22cdf0e10cSrcweir #ifndef VOSAPP_HXX 23cdf0e10cSrcweir #define VOSAPP_HXX 24cdf0e10cSrcweir 25cdf0e10cSrcweir #include <sal/main.h> 26cdf0e10cSrcweir #include <tools/solar.h> 27cdf0e10cSrcweir #include <tools/string.hxx> 28cdf0e10cSrcweir #include <vos/process.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir // Mininmal vcl/svapp compatibility without vcl dependence 31cdf0e10cSrcweir class Application 32cdf0e10cSrcweir { 33cdf0e10cSrcweir public: 34cdf0e10cSrcweir sal_uInt16 GetCommandLineParamCount(); 35cdf0e10cSrcweir XubString GetCommandLineParam( sal_uInt16 nParam ); 36cdf0e10cSrcweir virtual void Main() = 0; 37cdf0e10cSrcweir }; 38cdf0e10cSrcweir 39cdf0e10cSrcweir // Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl GetCommandLineParamCount()40cdf0e10cSrcweirsal_uInt16 Application::GetCommandLineParamCount() 41cdf0e10cSrcweir { 42cdf0e10cSrcweir vos::OStartupInfo aStartInfo; 43cdf0e10cSrcweir return (sal_uInt16)aStartInfo.getCommandArgCount(); 44cdf0e10cSrcweir } 45cdf0e10cSrcweir GetCommandLineParam(sal_uInt16 nParam)46cdf0e10cSrcweirXubString Application::GetCommandLineParam( sal_uInt16 nParam ) 47cdf0e10cSrcweir { 48cdf0e10cSrcweir vos::OStartupInfo aStartInfo; 49cdf0e10cSrcweir rtl::OUString aParam; 50cdf0e10cSrcweir aStartInfo.getCommandArg( nParam, aParam ); 51cdf0e10cSrcweir return XubString( aParam ); 52cdf0e10cSrcweir } 53cdf0e10cSrcweir 54cdf0e10cSrcweir #endif /* VOSAPP_HXX */ 55