xref: /aoo42x/main/l10ntools/inc/l10ntools/vosapp.hxx (revision 983d4c8a)
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 
22 cdf0e10cSrcweir #ifndef VOSAPP_HXX
23 cdf0e10cSrcweir #define VOSAPP_HXX
24 cdf0e10cSrcweir 
25 cdf0e10cSrcweir #include <sal/main.h>
26 cdf0e10cSrcweir #include <tools/solar.h>
27 cdf0e10cSrcweir #include <tools/string.hxx>
28 cdf0e10cSrcweir #include <vos/process.hxx>
29 cdf0e10cSrcweir 
30 cdf0e10cSrcweir // Mininmal vcl/svapp compatibility without vcl dependence
31 cdf0e10cSrcweir class Application
32 cdf0e10cSrcweir {
33 cdf0e10cSrcweir public:
34 cdf0e10cSrcweir     sal_uInt16 GetCommandLineParamCount();
35 cdf0e10cSrcweir     XubString GetCommandLineParam( sal_uInt16 nParam );
36 cdf0e10cSrcweir     virtual void Main() = 0;
37 cdf0e10cSrcweir };
38 cdf0e10cSrcweir 
39 cdf0e10cSrcweir // Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl
GetCommandLineParamCount()40 cdf0e10cSrcweir sal_uInt16 Application::GetCommandLineParamCount()
41 cdf0e10cSrcweir {
42 cdf0e10cSrcweir     vos::OStartupInfo aStartInfo;
43 cdf0e10cSrcweir     return (sal_uInt16)aStartInfo.getCommandArgCount();
44 cdf0e10cSrcweir }
45 cdf0e10cSrcweir 
GetCommandLineParam(sal_uInt16 nParam)46 cdf0e10cSrcweir XubString Application::GetCommandLineParam( sal_uInt16 nParam )
47 cdf0e10cSrcweir {
48 cdf0e10cSrcweir     vos::OStartupInfo aStartInfo;
49 cdf0e10cSrcweir     rtl::OUString aParam;
50 cdf0e10cSrcweir     aStartInfo.getCommandArg( nParam, aParam );
51 cdf0e10cSrcweir     return XubString( aParam );
52 cdf0e10cSrcweir }
53 cdf0e10cSrcweir 
54 cdf0e10cSrcweir #endif /* VOSAPP_HXX */
55