1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: depapp.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // -----------------------------------------------------------------------
33 #include <ucbhelper/contentbroker.hxx>
34 #include <ucbhelper/configurationkeys.hxx>
39 pDebugFile
= fopen( "fprintf.out", "w" );
43 MyWin
aMainWin( NULL
, WB_APP
| WB_STDWORK
);
44 pAppWindow
= &aMainWin
;
45 // pToolBarFrame = new FloatingWindow( aMainWin, WB_STDWORK );
46 //pToolBox = new ToolBox(pToolBarFrame,DtSodResId(TID_SOLDEP_MAIN));
48 pSolDep
= new SolDep( &aMainWin
);
50 aMainWin
.SetText( String::CreateFromAscii( SOLDEPL_NAME
));
55 aHelp
.EnableContextHelp();
56 aHelp
.EnableQuickHelp();
62 // -----------------------------------------------------------------------
64 MyWin::MyWin( Window
* pParent
, WinBits nWinStyle
) :
65 WorkWindow( pParent
, nWinStyle
)//,aToolBox( this, DtSodResId(TID_SOLDEP_MAIN)),
66 // depper aTaskBarFrame(this, 0)
68 //depper aTaskBarFrame.EnableAlwaysOnTop();
70 //depper aMenuBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Source" ) ) );
71 //depper aMenuBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Exit" ) ) );
72 //depper SetMenuBar( &aMenuBar );
73 //depper aToolBox.SetPosSizePixel( Point( 0,0 ), Size( 1100,35 ));
77 // -----------------------------------------------------------------------
79 void MyWin::MouseMove( const MouseEvent
& rMEvt
)
81 WorkWindow::MouseMove( rMEvt
);
84 // -----------------------------------------------------------------------
86 void MyWin::MouseButtonDown( const MouseEvent
& rMEvt
)
88 WorkWindow::MouseButtonDown( rMEvt
);
91 // -----------------------------------------------------------------------
93 void MyWin::MouseButtonUp( const MouseEvent
& rMEvt
)
95 WorkWindow::MouseButtonUp( rMEvt
);
98 // -----------------------------------------------------------------------
100 void MyWin::KeyInput( const KeyEvent
& rKEvt
)
102 WorkWindow::KeyInput( rKEvt
);
105 // -----------------------------------------------------------------------
107 void MyWin::KeyUp( const KeyEvent
& rKEvt
)
109 WorkWindow::KeyUp( rKEvt
);
112 // -----------------------------------------------------------------------
114 void MyWin::Paint( const Rectangle
& rRect
)
116 WorkWindow::Paint( rRect
);
119 // -----------------------------------------------------------------------
123 ((MyApp
*)GetpApp())->GetSolDep()->Resize();
124 WorkWindow::Resize();
129 //Reference< XMultiServiceFactory > xMS;
131 // for this to work make sure an <appname>.ini file is available, you can just copy soffice.ini
132 Reference
< XComponentContext
> xComponentContext
= ::cppu::defaultBootstrap_InitialComponentContext();
134 //xMS = cppu::createRegistryServiceFactory(
135 // rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
137 Reference
< XMultiServiceFactory
> xMS( xComponentContext
->getServiceManager(), UNO_QUERY
);
140 ::comphelper::setProcessServiceFactory(xMS
);
141 com::sun::star::uno::Sequence
< com::sun::star::uno::Any
> aArgs(2);
142 aArgs
[0] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL
);
143 aArgs
[1] <<= rtl::OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE
);
145 ::ucbhelper::ContentBroker::initialize( xMS
, aArgs
);