OOO330
[LibreOffice.git] / soldep / source / depapp.cxx
blob0c2b11f030be0e89247a0ccf3647c760e7b8d6ae
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // -----------------------------------------------------------------------
29 #include "depapp.hxx"
30 #include <ucbhelper/contentbroker.hxx>
31 #include <ucbhelper/configurationkeys.hxx>
33 void MyApp::Main()
35 #if defined(WNT)
36 pDebugFile = fopen( "fprintf.out", "w" );
37 #endif
39 pMyApp = GetpApp();
40 MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
41 pAppWindow = &aMainWin;
42 // pToolBarFrame = new FloatingWindow( aMainWin, WB_STDWORK );
43 //pToolBox = new ToolBox(pToolBarFrame,DtSodResId(TID_SOLDEP_MAIN));
45 pSolDep = new SolDep( &aMainWin );
46 pSolDep->Init();
47 aMainWin.SetText( String::CreateFromAscii( SOLDEPL_NAME ));
48 pSolDep->Hide();
49 aMainWin.Show();
50 Help aHelp;
51 SetHelp(&aHelp);
52 aHelp.EnableContextHelp();
53 aHelp.EnableQuickHelp();
54 Execute();
55 delete pResMgr;
56 delete pSolDep;
59 // -----------------------------------------------------------------------
61 MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
62 WorkWindow( pParent, nWinStyle )//,aToolBox( this, DtSodResId(TID_SOLDEP_MAIN)),
63 // depper aTaskBarFrame(this, 0)
65 //depper aTaskBarFrame.EnableAlwaysOnTop();
67 //depper aMenuBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Source" ) ) );
68 //depper aMenuBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Exit" ) ) );
69 //depper SetMenuBar( &aMenuBar );
70 //depper aToolBox.SetPosSizePixel( Point( 0,0 ), Size( 1100,35 ));
71 // aToolBox.Show();
74 // -----------------------------------------------------------------------
76 void MyWin::MouseMove( const MouseEvent& rMEvt )
78 WorkWindow::MouseMove( rMEvt );
81 // -----------------------------------------------------------------------
83 void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
85 WorkWindow::MouseButtonDown( rMEvt );
88 // -----------------------------------------------------------------------
90 void MyWin::MouseButtonUp( const MouseEvent& rMEvt )
92 WorkWindow::MouseButtonUp( rMEvt );
95 // -----------------------------------------------------------------------
97 void MyWin::KeyInput( const KeyEvent& rKEvt )
99 WorkWindow::KeyInput( rKEvt );
102 // -----------------------------------------------------------------------
104 void MyWin::KeyUp( const KeyEvent& rKEvt )
106 WorkWindow::KeyUp( rKEvt );
109 // -----------------------------------------------------------------------
111 void MyWin::Paint( const Rectangle& rRect )
113 WorkWindow::Paint( rRect );
116 // -----------------------------------------------------------------------
118 void MyWin::Resize()
120 ((MyApp*)GetpApp())->GetSolDep()->Resize();
121 WorkWindow::Resize();
124 SAL_IMPLEMENT_MAIN()
126 //Reference< XMultiServiceFactory > xMS;
128 // for this to work make sure an <appname>.ini file is available, you can just copy soffice.ini
129 Reference< XComponentContext > xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
131 //xMS = cppu::createRegistryServiceFactory(
132 // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
134 Reference< XMultiServiceFactory > xMS( xComponentContext->getServiceManager(), UNO_QUERY);
136 InitVCL( xMS );
137 ::comphelper::setProcessServiceFactory(xMS);
138 com::sun::star::uno::Sequence< com::sun::star::uno::Any > aArgs(2);
139 aArgs[0] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
140 aArgs[1] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
142 ::ucbhelper::ContentBroker::initialize( xMS, aArgs );
144 aMyApp.Main();
145 DeInitVCL();
146 return 0;