Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / vcl / workben / svdem.cxx
blob8e9baa73ac46689684fd273cf0d98d295f921c79
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <sal/main.h>
31 #include <tools/extendapplicationenvironment.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <vcl/event.hxx>
35 #include <vcl/svapp.hxx>
36 #include <vcl/wrkwin.hxx>
37 #include <vcl/msgbox.hxx>
39 #include <comphelper/processfactory.hxx>
40 #include <cppuhelper/servicefactory.hxx>
41 #include <cppuhelper/bootstrap.hxx>
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::lang;
45 // -----------------------------------------------------------------------
47 // Forward declaration
48 void Main();
50 // -----------------------------------------------------------------------
52 SAL_IMPLEMENT_MAIN()
54 tools::extendApplicationEnvironment();
56 Reference< XMultiServiceFactory > xMS;
57 xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
59 InitVCL( xMS );
60 ::Main();
61 DeInitVCL();
63 return 0;
66 // -----------------------------------------------------------------------
68 class MyWin : public WorkWindow
70 public:
71 MyWin( Window* pParent, WinBits nWinStyle );
73 void MouseMove( const MouseEvent& rMEvt );
74 void MouseButtonDown( const MouseEvent& rMEvt );
75 void MouseButtonUp( const MouseEvent& rMEvt );
76 void KeyInput( const KeyEvent& rKEvt );
77 void KeyUp( const KeyEvent& rKEvt );
78 void Paint( const Rectangle& rRect );
79 void Resize();
82 // -----------------------------------------------------------------------
84 void Main()
86 MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
87 aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
88 aMainWin.Show();
90 Application::Execute();
93 // -----------------------------------------------------------------------
95 MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
96 WorkWindow( pParent, nWinStyle )
100 // -----------------------------------------------------------------------
102 void MyWin::MouseMove( const MouseEvent& rMEvt )
104 WorkWindow::MouseMove( rMEvt );
107 // -----------------------------------------------------------------------
109 void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
111 WorkWindow::MouseButtonDown( rMEvt );
114 // -----------------------------------------------------------------------
116 void MyWin::MouseButtonUp( const MouseEvent& rMEvt )
118 WorkWindow::MouseButtonUp( rMEvt );
121 // -----------------------------------------------------------------------
123 void MyWin::KeyInput( const KeyEvent& rKEvt )
125 WorkWindow::KeyInput( rKEvt );
128 // -----------------------------------------------------------------------
130 void MyWin::KeyUp( const KeyEvent& rKEvt )
132 WorkWindow::KeyUp( rKEvt );
135 // -----------------------------------------------------------------------
137 void MyWin::Paint( const Rectangle& rRect )
139 WorkWindow::Paint( rRect );
142 // -----------------------------------------------------------------------
144 void MyWin::Resize()
146 WorkWindow::Resize();
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */