xref: /aoo42x/main/l10ntools/inc/l10ntools/vosapp.hxx (revision cdf0e10c)
1 #ifndef VOSAPP_HXX
2 #define VOSAPP_HXX
3 
4 #include <sal/main.h>
5 #include <tools/solar.h>
6 #include <tools/string.hxx>
7 #include <vos/process.hxx>
8 
9 // Mininmal vcl/svapp compatibility without vcl dependence
10 class Application
11 {
12 public:
13     sal_uInt16 GetCommandLineParamCount();
14     XubString GetCommandLineParam( sal_uInt16 nParam );
15     virtual void Main() = 0;
16 };
17 
18 // Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl
19 sal_uInt16 Application::GetCommandLineParamCount()
20 {
21     vos::OStartupInfo aStartInfo;
22     return (sal_uInt16)aStartInfo.getCommandArgCount();
23 }
24 
25 XubString Application::GetCommandLineParam( sal_uInt16 nParam )
26 {
27     vos::OStartupInfo aStartInfo;
28     rtl::OUString aParam;
29     aStartInfo.getCommandArg( nParam, aParam );
30     return XubString( aParam );
31 }
32 
33 #endif /* VOSAPP_HXX */
34