diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-29 00:21:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-29 11:20:32 +0100 |
commit | 6c759da0442f5123a4a4355e8dc9c926a49d25d7 (patch) | |
tree | cb1e0d1576a44c1fd7b8a466f25813ab177819b7 /svtools | |
parent | 91d95fa91b017f821cc0ed8fa7838a019202edb2 (diff) |
delete workben
Change-Id: Ib07874e03c2a0082ddf9f851e717ac5761b4839d
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/workben/cui/loadlib.cxx | 88 | ||||
-rw-r--r-- | svtools/workben/svdem.cxx | 1110 | ||||
-rw-r--r-- | svtools/workben/toolpanel/toolpaneltest.cxx | 883 | ||||
-rw-r--r-- | svtools/workben/treecontrol/treetest.cxx | 398 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.cxx | 107 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.hrc | 32 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.hxx | 59 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeleton.src | 80 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeletonpages.cxx | 108 | ||||
-rw-r--r-- | svtools/workben/unodialog/roadmapskeletonpages.hxx | 98 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_global.hrc | 45 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_module.cxx | 35 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_module.hxx | 38 | ||||
-rw-r--r-- | svtools/workben/unodialog/udlg_services.cxx | 63 | ||||
-rw-r--r-- | svtools/workben/unodialog/unodialogsample.cxx | 205 |
15 files changed, 0 insertions, 3349 deletions
diff --git a/svtools/workben/cui/loadlib.cxx b/svtools/workben/cui/loadlib.cxx deleted file mode 100644 index 6b4c116d0b62..000000000000 --- a/svtools/workben/cui/loadlib.cxx +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#include <osl/module.h> -#include <rtl/ustring.hxx> - -using ::rtl::OUString; - -extern "C" { -struct VersionInfo -{ - const char* pTime; - const char* pDate; - const char* pUpd; - const char* pMinor; - const char* pBuild; - const char* pInpath; -}; - -typedef VersionInfo*(__LOADONCALLAPI *GetVersionInfo)(void); -} - -int __LOADONCALLAPI main( int argc, char **argv ) -{ - VersionInfo *pInfo = NULL; - - if ( argc != 2 ) - { - fprintf( stderr, "USAGE: %s DllName \n", argv[0] ); - exit(0); - } - OUString aLib = OUString::createFromAscii(argv[1]); - oslModule aLibrary = osl_loadModule( aLib.pData, SAL_LOADMODULE_DEFAULT ); - if ( aLibrary ) - { - void* pFunc = osl_getSymbol( aLibrary, OUString( RTL_CONSTASCII_USTRINGPARAM( "GetVersionInfo" )).pData ); - if ( pFunc ) - pInfo = (*(GetVersionInfo)pFunc)(); - } - if ( pInfo ) - { - fprintf( stdout, "Date : %s\n", pInfo->pDate ); - fprintf( stdout, "Time : %s\n", pInfo->pTime ); - fprintf( stdout, "UPD : %s\n", pInfo->pUpd ); - fprintf( stdout, "Minor : %s\n", pInfo->pMinor ); - fprintf( stdout, "Build : %s\n", pInfo->pBuild ); - fprintf( stdout, "Inpath : %s\n", pInfo->pInpath ); - } - else - fprintf( stderr, "VersionInfo not Found !\n" ); - - if ( aLibrary ) - osl_unloadModule( aLibrary ); - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx deleted file mode 100644 index c18e749b21f1..000000000000 --- a/svtools/workben/svdem.cxx +++ /dev/null @@ -1,1110 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <stdio.h> -#include <cppuhelper/servicefactory.hxx> -#include <comphelper/processfactory.hxx> - -#include <unotools/calendarwrapper.hxx> -#include <unotools/localedatawrapper.hxx> - -#include <vcl/wrkwin.hxx> -#include <vcl/dialog.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/print.hxx> -#include <vcl/svapp.hxx> -#include <vcl/help.hxx> -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> -#include <vcl/scrbar.hxx> -#include <vcl/slider.hxx> -#include <vcl/group.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/status.hxx> -#include <stdmenu.hxx> -#include <ctrltool.hxx> -#include <ctrlbox.hxx> -#include <tabbar.hxx> -#include <svtools/valueset.hxx> -#include <svtools/headbar.hxx> -#include <prgsbar.hxx> -#include <calendar.hxx> -#include <svtools/prnsetup.hxx> -#include <svtools/printdlg.hxx> - -using namespace ::com::sun::star; - -// ----------------------------------------------------------------------- - -class MyApp : public Application -{ -public: - void Main(); -}; - -// ----------------------------------------------------------------------- - -class ShowBitmap : public WorkWindow -{ - Bitmap aBmp; - -public: - ShowBitmap( Window* pParent, const Bitmap& rBmp ); - - virtual void Paint( const Rectangle& ); - virtual sal_Bool Close(); -}; - -// ----------------------------------------------------------------------- - -class ShowFont : public Control -{ -public: - ShowFont( Window* pParent ); - - virtual void Paint( const Rectangle& ); - void SetFont( const Font& rFont ) - { Invalidate(); Control::SetFont( rFont ); } -}; - -// --- class OrientSlider ------------------------------------------------ - -class OrientSlider : public Slider -{ -public: - OrientSlider( Window* pParent ); - - short GetOrientation() const { return (short)GetThumbPos(); } -}; - -// ----------------------------------------------------------------------- - -OrientSlider::OrientSlider( Window* pParent ) : - Slider( pParent, WB_HORZ | WB_DRAG ) -{ - SetThumbPos( 0 ); - SetLineSize( 10 ); - SetPageSize( 100 ); - SetRange( Range( 0, 3600 ) ); -} - -// ----------------------------------------------------------------------- - -class MyFontDialog : public ModalDialog -{ -private: - FontList* pList; - Font aCurFont; - Printer aPrinter; - FontNameBox aFontBox; - FontStyleBox aStyleBox; - FontSizeBox aSizeBox; - ListBox aUnderlineBox; - ListBox aStrikeoutBox; - CheckBox aWordLineBox; - CheckBox aShadowBox; - CheckBox aOutlineBox; - ColorListBox aColorBox; - GroupBox aEffectBox; - OrientSlider aLineOrientSlider; - ShowFont aShowFont; - GroupBox aSampleBox; - FixedText aMapText; - OKButton aOKBtn; - CancelButton aCancelBtn; - -public: - MyFontDialog( Window* pParent ); - - DECL_LINK( SelectFont, ComboBox* ); - DECL_LINK( SelectStyle, ComboBox* ); - DECL_LINK( AttrHdl, Window * ); - void SetAttr(); - short Execute(); -}; - -// ----------------------------------------------------------------------- - -class MyTabBar : public TabBar -{ -public: - MyTabBar( Window* pParent, - WinBits nWinStyle = WB_STDTABBAR ) : - TabBar( pParent, nWinStyle ) {} - - virtual long DeactivatePage(); - virtual long AllowRenaming(); - virtual void Split(); -}; - -// ----------------------------------------------------------------------- - -class MyCalendar : public WorkWindow -{ - MenuBar aMenuBar; - PopupMenu aWeekStartMenu; - PopupMenu aWeekCountMenu; - Calendar aCalendar; - Color aInfoColor; - Color aHolidayColor; - Color aFrameColor; - -public: - MyCalendar( Window* pParent ); - ~MyCalendar(); - - DECL_LINK( RequestDateInfoHdl, Calendar* ); - DECL_LINK( DoubleClickHdl, Calendar* ); - DECL_LINK( MenuSelectHdl, Menu* ); - - void Resize(); -}; - -// ----------------------------------------------------------------------- - -class MyWin : public WorkWindow -{ -private: - Printer aPrn; - ToolBox aBox; - StatusBar aBar; - HeaderBar aHeadBar; - ColorListBox aColorList; - LineListBox aLineList; - ValueSet aValueSet; - CalendarField aCalendarField; - CalendarField aCalendarField2; - MyTabBar aTabBar; - ProgressBar aPrgsBar; - PushButton aFontBtn; - PushButton aCalendarBtn; - PushButton aPrnSetupBtn; - PushButton aPrnDlgBtn; - Size aBoxSize; - MyCalendar* pCalendar; - PopupMenu* pMenu; - FontNameMenu* pNameMenu; - FontStyleMenu* pStyleMenu; - FontSizeMenu* pSizeMenu; - -public: - MyWin( Window* pParent, WinBits aWinStyle ); - ~MyWin(); - - DECL_LINK( Test, PushButton* ); - DECL_LINK( SelectHdl, Window* ); - void ContextMenu( const Point& rPos ); - - void Command( const CommandEvent& rCEvt ); - void MouseButtonDown( const MouseEvent& rMEvt ); - void KeyInput( const KeyEvent& rKEvt ); - void Paint( const Rectangle& rRect ); - void Resize(); -}; - -// ----------------------------------------------------------------------- - -void MyApp::Main() -{ - try - { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - xMSF = cppu::createRegistryServiceFactory( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True ); - - ::comphelper::setProcessServiceFactory( xMSF ); - - Help aHelp; - SetHelp( &aHelp ); - Help::EnableContextHelp(); - Help::EnableExtHelp(); - Help::EnableBalloonHelp(); - Help::EnableQuickHelp(); - - MyWin aMainWin( NULL, WinBits( WB_APP | WB_STDWORK | WB_CLIPCHILDREN ) ); - aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "SVTOOLS - Workbench" ) ) ); - aMainWin.GrabFocus(); - aMainWin.Show(); - - Execute(); - } - catch ( const com::sun::star::uno::Exception & e ) - { - fprintf( stderr, "Error during bootstrapping servicemanager: %s\n" , - rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); - } -} - -// ----------------------------------------------------------------------- - -ShowBitmap::ShowBitmap( Window* pParent, const Bitmap& rBmp ) : - WorkWindow( pParent, WB_STDWORK ), - aBmp( rBmp ) -{ - SetOutputSizePixel( rBmp.GetSizePixel() ); - SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Bitmap-Viewer" ) ) ); - Show(); -} - -// ----------------------------------------------------------------------- - -void ShowBitmap::Paint( const Rectangle& ) -{ - DrawBitmap( Point(), GetOutputSizePixel(), aBmp ); -} - -// ----------------------------------------------------------------------- - -sal_Bool ShowBitmap::Close() -{ - Hide(); - delete this; - return sal_True; -} - -// ----------------------------------------------------------------------- - -ShowFont::ShowFont( Window* pParent ) : - Control( pParent, WB_BORDER ) -{ - SetMapMode( MapMode( MAP_POINT, Point(), - Fraction( 1, 10 ), Fraction( 1, 10 ) ) ); - SetBackground( Wallpaper( Color( COL_WHITE ) ) ); -} - -// ----------------------------------------------------------------------- - -void ShowFont::Paint( const Rectangle& ) -{ - const Font& rFont = GetFont(); - String aText; - Size aWindowSize( GetOutputSize() ); - long x,y; - - if ( rFont.GetOrientation() ) - { - aText.Append( rtl::OUString::valueOf(static_cast<sal_Int32>(rFont.GetOrientation()/10)) ); - aText.AppendAscii( " degree." ); - - x = aWindowSize.Width()/2; - y = aWindowSize.Height()/2; - } - else - { - aText = rFont.GetName(); - if ( !aText.Len() ) - aText.AssignAscii( "Sample" ); - - x = aWindowSize.Width()/2 - GetTextWidth( aText )/2; - y = aWindowSize.Height()/2 - GetTextHeight()/2; - } - - DrawText( Point( x, y ), aText ); -} - -// ----------------------------------------------------------------------- - -MyFontDialog::MyFontDialog( Window* pParent ) : - ModalDialog( pParent, WB_3DLOOK | WB_STDMODAL ), - aFontBox( this ), - aStyleBox( this ), - aSizeBox( this ), - aUnderlineBox( this, WB_DROPDOWN ), - aStrikeoutBox( this, WB_DROPDOWN ), - aWordLineBox( this ), - aShadowBox( this ), - aOutlineBox( this ), - aColorBox( this, WB_DROPDOWN ), - aEffectBox( this ), - aLineOrientSlider( this ), - aShowFont( this ), - aSampleBox( this ), - aMapText( this, WB_LEFT | WB_WORDBREAK ), - aOKBtn( this, WB_DEFBUTTON ), - aCancelBtn( this ) -{ - pList = NULL; - - aFontBox.EnableWYSIWYG( sal_True ); - aFontBox.EnableSymbols( sal_True ); - aFontBox.SetPosSizePixel( Point( 10, 10 ), Size( 140, 140 ) ); - aFontBox.SetSelectHdl( LINK( this, MyFontDialog, SelectFont ) ); - aFontBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectFont ) ); - aFontBox.Show(); - - aStyleBox.SetPosSizePixel( Point( 160, 10 ), Size( 100, 140 ) ); - aStyleBox.SetSelectHdl( LINK( this, MyFontDialog, SelectStyle ) ); - aStyleBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectStyle ) ); - aStyleBox.Show(); - - aSizeBox.SetPosSizePixel( Point( 270, 10 ), Size( 60, 140 ) ); - aSizeBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aSizeBox.SetLoseFocusHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aSizeBox.Show(); - - aUnderlineBox.SetPosSizePixel( Point( 15, 180 ), Size( 130, 100 ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_NONE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_SINGLE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOUBLE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOTTED" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DONTKNOW" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASH" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_LONGDASH" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASHDOT" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASHDOTDOT" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_SMALLWAVE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_WAVE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOUBLEWAVE" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLD" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDOTTED" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASH" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDLONGDASH" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASHDOT" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASHDOTDOT" ) ) ); - aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDWAVE" ) ) ); - aUnderlineBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aUnderlineBox.Show(); - - aStrikeoutBox.SetPosSizePixel( Point( 15, 210 ), Size( 130, 100 ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_NONE" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_SINGLE" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_DOUBLE" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_DONTKNOW" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_BOLD" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_SLASH" ) ) ); - aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_X" ) ) ); - aStrikeoutBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aStrikeoutBox.Show(); - - aWordLineBox.SetPosSizePixel( Point( 15, 240 ), Size( 130, 19 ) ); - aWordLineBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Only ~Words" ) ) ); - aWordLineBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aWordLineBox.Show(); - - aShadowBox.SetPosSizePixel( Point( 15, 260 ), Size( 130, 19 ) ); - aShadowBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Shadow" ) ) ); - aShadowBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aShadowBox.Show(); - - aOutlineBox.SetPosSizePixel( Point( 15, 280 ), Size( 130, 19 ) ); - aOutlineBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Outline" ) ) ); - aOutlineBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aOutlineBox.Show(); - - { - aColorBox.SetPosSizePixel( Point( 15, 305 ), Size( 130, 100 ) ); - aColorBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aColorBox.SetUpdateMode( sal_False ); - aColorBox.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); - aColorBox.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); - aColorBox.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); - aColorBox.InsertEntry( Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) ); - aColorBox.InsertEntry( Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) ); - aColorBox.InsertEntry( Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) ); - aColorBox.InsertEntry( Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) ); - aColorBox.InsertEntry( Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) ); - aColorBox.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) ); - aColorBox.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); - aColorBox.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - aColorBox.SetUpdateMode( sal_True ); - aColorBox.Show(); - } - - aEffectBox.SetPosSizePixel( Point( 10, 160 ), Size( 140, 175 ) ); - aEffectBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Effects" ) ) ); - aEffectBox.Show(); - - Size aSliderSize = aLineOrientSlider.GetSizePixel(); - aLineOrientSlider.SetPosSizePixel( Point( 160, 335-aSliderSize.Height() ), - Size( 250, aSliderSize.Height() ) ); - aLineOrientSlider.SetSlideHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aLineOrientSlider.Show(); - - aShowFont.SetPosSizePixel( Point( 165, 180 ), Size( 240, 70 ) ); - aShowFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Sample" ) ) ); - aShowFont.Show(); - - aSampleBox.SetPosSizePixel( Point( 160, 160 ), Size( 250, 100 ) ); - aSampleBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Sample" ) ) ); - aSampleBox.Show(); - - aMapText.SetPosSizePixel( Point( 160, 270 ), Size( 250, 35 ) ); - aMapText.Show(); - - aOKBtn.SetPosSizePixel( Point( 340, 10 ), Size( 70, 25 ) ); - aOKBtn.Show(); - - aCancelBtn.SetPosSizePixel( Point( 340, 40 ), Size( 70, 25 ) ); - aCancelBtn.Show(); - - SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "FontDialog" ) ) ); - SetOutputSizePixel( Size( 420, 345 ) ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(MyFontDialog, SelectFont) -{ - aStyleBox.Fill( aFontBox.GetText(), pList ); - FontInfo aInfo = pList->Get( aFontBox.GetText(), aStyleBox.GetText() ); - aSizeBox.Fill( &aInfo, pList ); - SetAttr(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(MyFontDialog, SelectStyle) -{ - FontInfo aInfo = pList->Get( aFontBox.GetText(), aStyleBox.GetText() ); - aSizeBox.Fill( &aInfo, pList ); - SetAttr(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(MyFontDialog, AttrHdl) -{ - SetAttr(); - return 0; -} - -// ----------------------------------------------------------------------- - -void MyFontDialog::SetAttr() -{ - FontInfo aFont( pList->Get( aFontBox.GetText(), aStyleBox.GetText() ) ); - aFont.SetSize( Size( 0, aSizeBox.GetValue() ) ); - aFont.SetUnderline( (FontUnderline)aUnderlineBox.GetSelectEntryPos() ); - aFont.SetStrikeout( (FontStrikeout)aStrikeoutBox.GetSelectEntryPos() ); - aFont.SetColor( Color( (ColorData)aColorBox.GetSelectEntryPos() ) ); - aFont.SetWordLineMode( aWordLineBox.IsChecked() ); - aFont.SetShadow( aShadowBox.IsChecked() ); - aFont.SetOutline( aOutlineBox.IsChecked() ); - aFont.SetOrientation( aLineOrientSlider.GetOrientation() ); - aFont.SetTransparent( sal_True ); - aMapText.SetText( pList->GetFontMapText( aFont ) ); - aShowFont.SetFont( aFont ); -} - -// ----------------------------------------------------------------------- - -short MyFontDialog::Execute() -{ - pList = new FontList( &aPrinter, this ); - aFontBox.Fill( pList ); - aSizeBox.SetValue( 120 ); - aUnderlineBox.SelectEntryPos( 0 ); - aStrikeoutBox.SelectEntryPos( 0 ); - aColorBox.SelectEntryPos( 0 ); - SelectFont( &aFontBox ); - short nRet = ModalDialog::Execute(); - delete pList; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MyTabBar::DeactivatePage() -{ - if ( GetCurPageId() == 6 ) - { - QueryBox aQueryBox( this, WB_YES_NO | WB_DEF_YES, - XubString( RTL_CONSTASCII_USTRINGPARAM( "Deactivate" ) ) ); - if ( aQueryBox.Execute() == RET_YES ) - return sal_True; - else - return sal_False; - } - else - return sal_True; -} - -// ----------------------------------------------------------------------- - -long MyTabBar::AllowRenaming() -{ - XubString aStr( RTL_CONSTASCII_USTRINGPARAM( "Allow renaming: " ) ); - aStr += GetEditText(); - QueryBox aQueryBox( this, WB_YES_NO_CANCEL | WB_DEF_YES, aStr ); - long nRet = aQueryBox.Execute(); - if ( nRet == RET_YES ) - return TAB_RENAMING_YES; - else if ( nRet == RET_NO ) - return TAB_RENAMING_NO; - else // ( nRet == RET_CANCEL ) - return TAB_RENAMING_CANCEL; -} - -// ----------------------------------------------------------------------- - -void MyTabBar::Split() -{ - Size aSize = GetSizePixel(); - long nWidth = GetSplitSize(); - long nMaxWidth = GetParent()->GetOutputSizePixel().Width()-50; - if ( nWidth < GetMinSize() ) - nWidth = GetMinSize(); - else if ( nWidth > nMaxWidth ) - nWidth = nMaxWidth; - SetSizePixel( Size( nWidth, aSize.Height() ) ); -} - -// ----------------------------------------------------------------------- - -MyCalendar::MyCalendar( Window* pParent ) : - WorkWindow( pParent, WB_STDWORK ), - aCalendar( this, WB_TABSTOP | WB_WEEKNUMBER | WB_BOLDTEXT | WB_FRAMEINFO | WB_MULTISELECT ), - aInfoColor( COL_LIGHTBLUE ), - aHolidayColor( COL_LIGHTRED ), - aFrameColor( COL_LIGHTRED ) -{ - const CalendarWrapper& rCal = aCalendar.GetCalendarWrapper(); - aMenuBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Wochen~anfang" ) ) ); - aMenuBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Erste Woche" ) ) ); - aMenuBar.SetPopupMenu( 1, &aWeekStartMenu ); - aMenuBar.SetPopupMenu( 2, &aWeekCountMenu ); - sal_Int16 nDays = rCal.getNumberOfDaysInWeek(); - uno::Sequence< i18n::CalendarItem2> xItems = rCal.getDays(); - const i18n::CalendarItem2* pArr = xItems.getArray(); - for ( sal_Int16 i = 0; i < nDays; i++ ) - aWeekStartMenu.InsertItem( 10+(sal_uInt16)i, pArr[i].FullName, MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekStartMenu.CheckItem( 10+(sal_uInt16)rCal.getFirstDayOfWeek() ); - aWeekCountMenu.InsertItem( 20, XubString( RTL_CONSTASCII_USTRINGPARAM( "~1. Januar" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 21, XubString( RTL_CONSTASCII_USTRINGPARAM( "~2 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 22, XubString( RTL_CONSTASCII_USTRINGPARAM( "~3 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 23, XubString( RTL_CONSTASCII_USTRINGPARAM( "Erste 4 ~Tage-Woche" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 24, XubString( RTL_CONSTASCII_USTRINGPARAM( "~5 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 25, XubString( RTL_CONSTASCII_USTRINGPARAM( "~6 days" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - aWeekCountMenu.InsertItem( 26, XubString( RTL_CONSTASCII_USTRINGPARAM( "Erste ~volle Woche" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK ); - //was: one of 0, 1, 2; aWeekCountMenu.CheckItem( 20+(sal_uInt16)rIntn.GetWeekCountStart() ); - aWeekCountMenu.CheckItem( 20+(sal_uInt16)rCal.getMinimumNumberOfDaysForFirstWeek() ); - aMenuBar.SetSelectHdl( LINK( this, MyCalendar, MenuSelectHdl ) ); - SetMenuBar( &aMenuBar ); - - Date aCurDate = aCalendar.GetCurDate(); - aCalendar.SetRequestDateInfoHdl( LINK( this, MyCalendar, RequestDateInfoHdl ) ); - aCalendar.SetDoubleClickHdl( LINK( this, MyCalendar, DoubleClickHdl ) ); - aCalendar.SetSaturdayColor( Color( COL_LIGHTGREEN ) ); - aCalendar.SetSundayColor( aHolidayColor ); - aCalendar.AddDateInfo( Date( 1, 1, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Neujahr" ) ), &aHolidayColor, NULL ); - aCalendar.AddDateInfo( Date( 24, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Heiligabend" ) ), &aInfoColor, NULL ); - aCalendar.AddDateInfo( Date( 25, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "1. Weihnachttag" ) ), &aHolidayColor, NULL ); - aCalendar.AddDateInfo( Date( 26, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "2. Weihnachttag" ) ), &aHolidayColor, NULL ); - aCalendar.AddDateInfo( Date( 31, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Silvester" ) ), &aInfoColor, NULL ); - aCalendar.SetPosPixel( Point() ); - aCalendar.SetFirstDate( Date( 1, 1, aCurDate.GetYear() ) ); - aCalendar.Show(); - - SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Calendar" ) ) ); - SetOutputSizePixel( aCalendar.CalcWindowSizePixel( 3, 4 ) ); -} - -// ----------------------------------------------------------------------- - -MyCalendar::~MyCalendar() -{ - SetMenuBar( NULL ); - aMenuBar.SetPopupMenu( 1, NULL ); - aMenuBar.SetPopupMenu( 2, NULL ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(MyCalendar, RequestDateInfoHdl) -{ - sal_uInt16 nRequestYear = aCalendar.GetRequestYear(); - if ( (nRequestYear >= 1954) && (nRequestYear <= 1989) ) - aCalendar.AddDateInfo( Date( 17, 6, nRequestYear ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Tag der deutschen Einheit" ) ), &aHolidayColor, NULL ); - else if ( nRequestYear >= 1990 ) - aCalendar.AddDateInfo( Date( 3, 10, nRequestYear ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Tag der deutschen Einheit" ) ), &aHolidayColor, NULL ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(MyCalendar, DoubleClickHdl) -{ - Date aDate = aCalendar.GetCurDate(); - String aStr( RTL_CONSTASCII_USTRINGPARAM( "Info: " ) ); - aStr += Application::GetAppLocaleDataWrapper().getDate( aDate ); - aCalendar.AddDateInfo( aDate, aStr, NULL, &aFrameColor, DIB_BOLD ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( MyCalendar, MenuSelectHdl, Menu*, pMenu ) -{ - sal_uInt16 nItemId = pMenu->GetCurItemId(); - - if ( (nItemId >= 10) && (nItemId <= 19) ) - aCalendar.SetWeekStart( nItemId-10 ); - else if ( (nItemId >= 20) && (nItemId <= 29) ) - aCalendar.SetMinimumNumberOfDaysInWeek( nItemId-20 ); - - return 0; -} - -// ----------------------------------------------------------------------- - -void MyCalendar::Resize() -{ - aCalendar.SetSizePixel( GetOutputSizePixel() ); -} - -// ----------------------------------------------------------------------- - -MyWin::MyWin( Window* pParent, WinBits aWinStyle ) : - WorkWindow(pParent, aWinStyle | WB_3DLOOK ), - aBox( this, WB_BORDER | WB_3DLOOK ), - aBar( this, WB_BORDER | WB_3DLOOK | WB_RIGHT ), - aHeadBar( this, WB_BORDER | WB_3DLOOK | WB_DRAG | WB_BUTTONSTYLE ), - aColorList( this ), - aLineList( this ), - aValueSet( this, WB_TABSTOP | WB_NAMEFIELD | WB_NONEFIELD | WB_BORDER | WB_ITEMBORDER | WB_VSCROLL /* | WB_FLATVALUESET */ ), - aCalendarField( this, WB_TABSTOP | WB_SPIN | WB_REPEAT | WB_DROPDOWN | WB_BORDER ), - aCalendarField2( this, WB_TABSTOP | WB_SPIN | WB_REPEAT | WB_DROPDOWN | WB_BORDER ), - aTabBar( this, WB_BORDER | WB_MULTISELECT | WB_SCROLL | WB_SIZEABLE | WB_DRAG ), - aPrgsBar( this ), - aFontBtn( this ), - aCalendarBtn( this ), - aPrnSetupBtn( this ), - aPrnDlgBtn( this ) -{ - SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFaceColor() ) ); - - pCalendar = NULL; - pMenu = NULL; - - Bitmap aBmp; - aBox.InsertItem( 1, aBmp ); - aBox.InsertItem( 2, aBmp ); - aBox.InsertItem( 3, aBmp ); - aBox.InsertItem( 4, aBmp ); - aBox.InsertSeparator(); - aBox.InsertItem( 5, aBmp ); - aBox.InsertItem( 6, aBmp ); - aBox.InsertItem( 7, aBmp ); - aBox.InsertItem( 8, aBmp ); - aBox.InsertSpace(); - aBox.InsertItem( 9, aBmp ); - aBox.SetPosPixel( Point( 0, 0 ) ); - aBoxSize = aBox.GetSizePixel(); - aBox.Show(); - - aBar.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Ready" ) ) ); - aBar.InsertItem( 1, 35 ); - aBar.InsertItem( 2, 55 ); - aBar.InsertItem( 3, 55 ); - aBar.SetItemText( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) ); - aBar.SetItemText( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "21.01.93" ) ) ); - aBar.SetItemText( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "12:00:00" ) ) ); - aBar.Show(); - - long nY = aBox.GetSizePixel().Height()+10; - { - aHeadBar.SetPosPixel( Point( 0, nY ) ); - aHeadBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Sender" ) ), 150 ); - aHeadBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Subject" ) ), 150, HIB_CENTER | HIB_VCENTER | HIB_CLICKABLE ); - aHeadBar.InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ), 75 ); - aHeadBar.InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), 60, HIB_RIGHT | HIB_VCENTER | HIB_CLICKABLE ); - aHeadBar.InsertItem( 9999, String(), HEADERBAR_FULLSIZE, HIB_RIGHT | HIB_VCENTER | HIB_FIXEDPOS ); - aHeadBar.SetSelectHdl( LINK( this, MyWin, SelectHdl ) ); - aHeadBar.Show(); - nY += aHeadBar.GetSizePixel().Height() += 10; - } - - { - aColorList.SetPosSizePixel( Point( 10, nY ), Size( 130, 180 ) ); - aColorList.SetUpdateMode( sal_False ); - aColorList.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); - aColorList.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); - aColorList.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); - aColorList.InsertEntry( Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) ); - aColorList.InsertEntry( Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) ); - aColorList.InsertEntry( Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) ); - aColorList.InsertEntry( Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) ); - aColorList.InsertEntry( Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) ); - aColorList.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) ); - aColorList.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); - aColorList.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - aColorList.SetUpdateMode( sal_True ); - aColorList.SetSelectHdl( LINK( this, MyWin, SelectHdl ) ); - aColorList.Show(); - } - - { - aLineList.SetPosSizePixel( Point( 150, nY ), Size( 130, 180 ) ); - aLineList.SetUnit( FUNIT_POINT ); - aLineList.SetSourceUnit( FUNIT_TWIP ); - aLineList.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Hairline" ) ) ); - aLineList.InsertEntry( 1500 ); - aLineList.InsertEntry( 3000 ); - aLineList.InsertEntry( 4500 ); - aLineList.InsertEntry( 6000 ); - aLineList.InsertEntry( 7500 ); - aLineList.InsertEntry( 9000 ); - aLineList.InsertEntry( 1500, 1500, 1500 ); - aLineList.InsertEntry( 3000, 1500, 1500 ); - aLineList.InsertEntry( 4500, 1500, 1500 ); - aLineList.InsertEntry( 3000, 3000, 1500 ); - aLineList.InsertEntry( 4500, 3000, 1500 ); - aLineList.InsertEntry( 4500, 4500, 1500 ); - aLineList.Show(); - } - - { - aValueSet.SetPosSizePixel( Point( 290, nY ), Size( 130, 180 ) ); - aValueSet.InsertItem( 9, Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); - aValueSet.InsertItem( 10, Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); - aValueSet.InsertItem( 11, Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); - aValueSet.InsertItem( 12, Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) ); - aValueSet.InsertItem( 13, Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) ); - aValueSet.InsertItem( 14, Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) ); - aValueSet.InsertItem( 15, Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) ); - aValueSet.InsertItem( 16, Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) ); - aValueSet.InsertItem( 17, Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) ); - aValueSet.InsertItem( 18, Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) ); - aValueSet.InsertItem( 19, Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) ); - aValueSet.InsertItem( 20, Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) ); - aValueSet.InsertItem( 21, Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) ); - aValueSet.InsertItem( 22, Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) ); - aValueSet.InsertItem( 23, Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); - aValueSet.InsertItem( 24, Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - aValueSet.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) ); - aValueSet.SetColCount( 4 ); - aValueSet.SetLineCount( 4 ); - aValueSet.SetSelectHdl( LINK( this, MyWin, SelectHdl ) ); - aValueSet.Show(); - } - - { - aCalendarField.EnableEmptyFieldValue( sal_True ); - aCalendarField.SetCalendarStyle( aCalendarField.GetCalendarStyle() | WB_RANGESELECT ); - aCalendarField.SetEmptyDate(); - aCalendarField.EnableToday(); - aCalendarField.EnableNone(); - aCalendarField.SetPosSizePixel( Point( 430, nY ), Size( 130, 20 ) ); - aCalendarField.Show(); - } - - { - aCalendarField2.SetDate( Date() ); - aCalendarField2.SetPosSizePixel( Point( 570, nY ), Size( 130, 20 ) ); - aCalendarField2.Show(); - } - - nY += 200; - { - aTabBar.SetPosSizePixel( Point( 10, nY ), - Size( 300, aTabBar.GetSizePixel().Height() ) ); - aTabBar.InsertPage( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 1" ) ) ); - aTabBar.InsertPage( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 2" ) ) ); - aTabBar.InsertPage( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 3" ) ) ); - aTabBar.InsertPage( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 4" ) ) ); - aTabBar.InsertPage( 5, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 5" ) ) ); - aTabBar.InsertPage( 6, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 6" ) ) ); - aTabBar.InsertPage( 7, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 7" ) ) ); - aTabBar.InsertPage( 8, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 8" ) ) ); - aTabBar.InsertPage( 9, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 9" ) ) ); - aTabBar.InsertPage( 10, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 10" ) ) ); - aTabBar.InsertPage( 11, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 11" ) ) ); - aTabBar.InsertPage( 12, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 12" ) ) ); - aTabBar.InsertPage( 13, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 13" ) ) ); - aTabBar.InsertPage( 14, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 14" ) ) ); - aTabBar.InsertPage( 15, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 15" ) ) ); - aTabBar.InsertPage( 16, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 16" ) ) ); - aTabBar.InsertPage( 17, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 17" ) ) ); - aTabBar.InsertPage( 18, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 18" ) ) ); - aTabBar.InsertPage( 19, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 19" ) ) ); - aTabBar.InsertPage( 20, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 20" ) ) ); - aTabBar.InsertPage( 21, XubString( RTL_CONSTASCII_USTRINGPARAM( "This is a long Page Text" ) ) ); - aTabBar.InsertPage( 22, XubString( RTL_CONSTASCII_USTRINGPARAM( "Short Text" ) ) ); - aTabBar.InsertPage( 23, XubString( RTL_CONSTASCII_USTRINGPARAM( "And now a very very long Page Text" ) ) ); - aTabBar.InsertPage( 24, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 24" ) ) ); - aTabBar.InsertPage( 25, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 25" ) ) ); - aTabBar.InsertPage( 26, XubString( RTL_CONSTASCII_USTRINGPARAM( "And now a very long Page Text" ) ) ); - aTabBar.InsertPage( 27, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 27" ) ) ); - aTabBar.InsertPage( 28, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 28" ) ) ); - aTabBar.InsertPage( 29, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 29" ) ) ); - aTabBar.InsertPage( 30, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 30" ) ) ); - aTabBar.EnableEditMode(); - aTabBar.Show(); - } - - nY += 35; - { - aPrgsBar.SetPosPixel( Point( 10, nY ) ); - aPrgsBar.Show(); - } - - nY += 40; - { - aFontBtn.SetPosSizePixel( Point( 10, nY ), Size( 100, 30 ) ); - aFontBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Font..." ) ) ); - aFontBtn.SetClickHdl( LINK( this, MyWin, Test ) ); - aFontBtn.Show(); - - aCalendarBtn.SetPosSizePixel( Point( 120, nY ), Size( 100, 30 ) ); - aCalendarBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Calendar" ) ) ); - aCalendarBtn.SetClickHdl( LINK( this, MyWin, Test ) ); - aCalendarBtn.Show(); - - aPrnSetupBtn.SetPosSizePixel( Point( 230, nY ), Size( 100, 30 ) ); - aPrnSetupBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "PrnSetup..." ) ) ); - aPrnSetupBtn.SetClickHdl( LINK( this, MyWin, Test ) ); - aPrnSetupBtn.Show(); - - aPrnDlgBtn.SetPosSizePixel( Point( 340, nY ), Size( 100, 30 ) ); - aPrnDlgBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Print...." ) ) ); - aPrnDlgBtn.SetClickHdl( LINK( this, MyWin, Test ) ); - aPrnDlgBtn.Show(); - } -} - -// ----------------------------------------------------------------------- - -MyWin::~MyWin() -{ - if ( pCalendar ) - delete pCalendar; - - if ( pMenu ) - { - delete pMenu; - delete pNameMenu; - delete pStyleMenu; - delete pSizeMenu; - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( MyWin, Test, PushButton*, pBtn ) -{ - if ( pBtn == &aFontBtn ) - { - MyFontDialog* pDlg = new MyFontDialog( this ); - pDlg->Execute(); - delete pDlg; - } - else if ( pBtn == &aCalendarBtn ) - { - if ( !pCalendar ) - pCalendar = new MyCalendar( this ); - pCalendar->ToTop(); - pCalendar->Show(); - } - else if ( pBtn == &aPrnSetupBtn ) - { - PrinterSetupDialog* pDlg = new PrinterSetupDialog( this ); - pDlg->SetPrinter( &aPrn ); - pDlg->Execute(); - delete pDlg; - } - else if ( pBtn == &aPrnDlgBtn ) - { - PrintDialog* pDlg = new PrintDialog( this, false ); - pDlg->SetPrinter( &aPrn ); - pDlg->EnableRange( PRINTDIALOG_ALL ); - pDlg->EnableRange( PRINTDIALOG_RANGE ); - pDlg->Execute(); - delete pDlg; - } - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( MyWin, SelectHdl, Window*, pCtrl ) -{ - if ( pCtrl == &aColorList ) - { - Color aColor = aColorList.GetSelectEntryColor(); - aValueSet.SetColor( aColor ); - aLineList.SetColor( aColor ); - } - else if ( pCtrl == &aValueSet ) - { - sal_uInt16 nId = aValueSet.GetSelectItemId(); - if ( nId > 8 ) - { - Color aColor = aValueSet.GetItemColor( nId ); - aValueSet.SetFillColor( aColor ); - } - } - else if ( pCtrl == &aHeadBar ) - { - sal_uInt16 nCurItemId = aHeadBar.GetCurItemId(); - for ( sal_uInt16 i = 0; i < aHeadBar.GetItemCount(); i++ ) - { - sal_uInt16 nItemId = aHeadBar.GetItemId( i ); - HeaderBarItemBits nBits = aHeadBar.GetItemBits( nItemId ); - if ( nItemId == nCurItemId ) - { - HeaderBarItemBits nOldBits = nBits; - nBits &= ~(HIB_DOWNARROW | HIB_UPARROW); - if ( nOldBits & HIB_DOWNARROW ) - nBits |= HIB_UPARROW; - else - nBits |= HIB_DOWNARROW; - } - else - nBits &= ~(HIB_DOWNARROW | HIB_UPARROW); - aHeadBar.SetItemBits( nItemId, nBits ); - } - } - - return 0; -} - -// ----------------------------------------------------------------------- - -void MyWin::ContextMenu( const Point& rPos ) -{ - FontList aList( this ); - - if ( !pMenu ) - { - pMenu = new PopupMenu; - pNameMenu = new FontNameMenu; - pStyleMenu = new FontStyleMenu; - pSizeMenu = new FontSizeMenu; - - pMenu->InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Font" ) ) ); - pMenu->InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Attribute" ) ) ); - pMenu->InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ); - pMenu->SetPopupMenu( 1, pNameMenu ); - pMenu->SetPopupMenu( 2, pStyleMenu ); - pMenu->SetPopupMenu( 3, pSizeMenu ); - - pNameMenu->Fill( &aList ); - pNameMenu->SetCurName( aList.GetFontName( 0 ).GetName() ); - - pStyleMenu->InsertSeparator(); - pStyleMenu->InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Underline" ) ), MIB_CHECKABLE | MIB_AUTOCHECK ); - pStyleMenu->InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Stri~keout" ) ), MIB_CHECKABLE | MIB_AUTOCHECK ); - pStyleMenu->InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Shadow" ) ), MIB_CHECKABLE | MIB_AUTOCHECK ); - pStyleMenu->InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Outline" ) ), MIB_CHECKABLE | MIB_AUTOCHECK ); - } - - pStyleMenu->Fill( pNameMenu->GetCurName(), &aList ); - pSizeMenu->Fill( aList.Get( pNameMenu->GetCurName(), - pStyleMenu->GetCurStyle() ), &aList ); - - pMenu->Execute( this, rPos ); -} - -// ----------------------------------------------------------------------- - -void MyWin::Command( const CommandEvent& rCEvt ) -{ - if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) - ContextMenu( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ); -} - -// ----------------------------------------------------------------------- - -void MyWin::MouseButtonDown( const MouseEvent& rMEvt ) -{ - aValueSet.StartSelection(); - WorkWindow::MouseButtonDown( rMEvt ); -} - -// ----------------------------------------------------------------------- - -void MyWin::KeyInput( const KeyEvent& rKEvt ) -{ - if ( rKEvt.GetKeyCode().GetCode() == KEY_P ) - { - for ( sal_uInt16 i = 0; i <= 130; i += 2 ) - { - for ( sal_uInt16 j = 0; j < 6000; j++ ) - { - aPrgsBar.SetValue( i ); - Application::Reschedule(); - } - } - } - else if ( rKEvt.GetCharCode() == '+' ) - aHeadBar.SetOffset( aHeadBar.GetOffset()+1 ); - else if ( rKEvt.GetCharCode() == '-' ) - aHeadBar.SetOffset( aHeadBar.GetOffset()-1 ); - - WorkWindow::KeyInput( rKEvt ); -} - -// ----------------------------------------------------------------------- - -void MyWin::Paint( const Rectangle& rRect ) -{ - WorkWindow::Paint( rRect ); -} - -// ----------------------------------------------------------------------- - -void MyWin::Resize() -{ - Size aWinSize = GetOutputSizePixel(); - - aBox.SetSizePixel( Size( aWinSize.Width(), aBoxSize.Height() ) ); - - Size aSize = aBar.GetSizePixel(); - aBar.SetPosSizePixel( Point( 0, aWinSize.Height()-aSize.Height() ), - Size( aWinSize.Width(), aSize.Height() ) ); - - Size aBarSize = aSize; - Point aPos = aHeadBar.GetPosPixel(); - aSize = aHeadBar.GetSizePixel(); - aHeadBar.SetSizePixel( Size( aWinSize.Width(), aSize.Height() ) ); - aHeadBar.SetDragSize( aWinSize.Height() - aSize.Height() - aPos.Y() - aBarSize.Height() ); - - aPos = aPrgsBar.GetPosPixel(); - aSize = aPrgsBar.GetSizePixel(); - if ( aPos.X() < aWinSize.Width()-10 ) - aPrgsBar.SetSizePixel( Size( aWinSize.Width()-aPos.X()-10, aSize.Height() ) ); -} - -// ----------------------------------------------------------------------- - -MyApp aMyApp; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx deleted file mode 100644 index 5bd56c4c2d59..000000000000 --- a/svtools/workben/toolpanel/toolpaneltest.cxx +++ /dev/null @@ -1,883 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2009 by Sun Microsystems, Inc. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -************************************************************************/ - - -#include "ctrlbox.hxx" -#include "svtools/toolpanel/toolpaneldeck.hxx" -#include "svtools/toolpanel/tablayouter.hxx" - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> - -#include <comphelper/processfactory.hxx> -#include <cppuhelper/bootstrap.hxx> -#include <cppuhelper/servicefactory.hxx> -#include <tools/diagnose_ex.h> -#include <ucbhelper/contentbroker.hxx> -#include <vcl/button.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> -#include <vcl/help.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/svapp.hxx> -#include <vcl/tabctrl.hxx> -#include <vcl/taskpanelist.hxx> -#include <vcl/wrkwin.hxx> -#include <sal/macros.h> - -namespace svt { namespace toolpanel -{ - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Any; -using ::com::sun::star::lang::XMultiServiceFactory; -using ::com::sun::star::uno::XComponentContext; -using ::com::sun::star::accessibility::XAccessible; - -//============================================================================= -//= PanelDemo -//============================================================================= -class PanelDemo : public Application -{ -public: - virtual int Main(); - -private: - static Reference< XMultiServiceFactory > createApplicationServiceManager(); -}; - -//============================================================================= -//= ColoredPanelWindow -//============================================================================= -class ColoredPanelWindow : public Window -{ -public: - ColoredPanelWindow( Window& i_rParent, const Color& i_rColor, const String& i_rTitle ) - :Window( &i_rParent ) - ,m_aEdit( this, WB_BORDER ) - ,m_aTabControl( this ) - ,m_sTitle( i_rTitle ) - { - SetLineColor(); - SetFillColor( i_rColor ); - - m_aEdit.Show(); - m_aTabControl.Show(); - - const sal_Char* pTabTitles[] = - { - "This", "is a", "Tab", "Control", "intended", "for", "comparison" - }; - for ( size_t i=0; i < SAL_N_ELEMENTS( pTabTitles ); ++i ) - { - String sText( String::CreateFromAscii( pTabTitles[i] ) ); - m_aTabControl.InsertPage( i + 1, sText ); - } - } - - virtual void Paint( const Rectangle& /*i_rRect*/ ) - { - const Size aOutputSize( GetOutputSizePixel() ); - const Rectangle aTitleRect( Point( 10, 10 ), Size( aOutputSize.Width() - 20, 20 ) ); - DrawRect( aTitleRect ); - SetTextColor( GetFillColor().IsDark() ? COL_WHITE : COL_BLACK ); - DrawText( aTitleRect, m_sTitle, TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER ); - } - - virtual void GetFocus() - { - m_aEdit.GrabFocus(); - } - - virtual void Resize() - { - const Size aOutputSize( GetOutputSizePixel() ); - m_aEdit.SetPosSizePixel( - Point( 20, 40 ), - Size( aOutputSize.Width() - 40, 20 ) - ); - m_aTabControl.SetPosSizePixel( - Point( 20, 70 ), - Size( aOutputSize.Width() - 40, 150 ) - ); - } - -private: - Edit m_aEdit; - TabControl m_aTabControl; - String m_sTitle; -}; - -//============================================================================= -//= ColoredPanel -//============================================================================= -class ColoredPanel : public IToolPanel -{ -public: - ColoredPanel( Window& i_rParent, const Color& i_rColor, const sal_Char* i_pAsciiPanelName ); - ColoredPanel( Window& i_rParent, const Color& i_rColor, const String& i_rPanelName ); - ~ColoredPanel(); - - // IToolPanel - virtual ::rtl::OUString GetDisplayName() const; - virtual Image GetImage() const; - virtual rtl::OString GetHelpID() const; - virtual void Activate( Window& i_rParentWindow ); - virtual void Deactivate(); - virtual void SetSizePixel( const Size& i_rPanelWindowSize ); - virtual void GrabFocus(); - virtual void Dispose(); - virtual Reference< XAccessible > CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible ); - - // IReference - virtual oslInterlockedCount SAL_CALL acquire(); - virtual oslInterlockedCount SAL_CALL release(); - -private: - oslInterlockedCount m_refCount; - ::std::auto_ptr< ColoredPanelWindow > - m_pWindow; - ::rtl::OUString m_aPanelName; - BitmapEx m_aPanelIcon; -}; - -//============================================================================= -//= ColoredPanel -//============================================================================= -//----------------------------------------------------------------------------- -ColoredPanel::ColoredPanel( Window& i_rParent, const Color& i_rColor, const sal_Char* i_pAsciiPanelName ) - :m_refCount(0) - ,m_pWindow( new ColoredPanelWindow( i_rParent, i_rColor, ::rtl::OUString::createFromAscii( i_pAsciiPanelName ) ) ) - ,m_aPanelName( ::rtl::OUString::createFromAscii( i_pAsciiPanelName ) ) - ,m_aPanelIcon() -{ - Bitmap aBitmap( Size( 16, 16 ), 8 ); - m_aPanelIcon = BitmapEx( aBitmap ); - m_aPanelIcon.Erase( i_rColor ); -} - -//----------------------------------------------------------------------------- -ColoredPanel::ColoredPanel( Window& i_rParent, const Color& i_rColor, const String& i_rPanelName ) - :m_refCount(0) - ,m_pWindow( new ColoredPanelWindow( i_rParent, i_rColor, i_rPanelName ) ) - ,m_aPanelName( i_rPanelName ) - ,m_aPanelIcon() -{ - Bitmap aBitmap( Size( 16, 16 ), 8 ); - m_aPanelIcon = BitmapEx( aBitmap ); - m_aPanelIcon.Erase( i_rColor ); -} - -//----------------------------------------------------------------------------- -ColoredPanel::~ColoredPanel() -{ -} - -//----------------------------------------------------------------------------- -oslInterlockedCount SAL_CALL ColoredPanel::acquire() -{ - return osl_incrementInterlockedCount( &m_refCount ); -} - -//----------------------------------------------------------------------------- -oslInterlockedCount SAL_CALL ColoredPanel::release() -{ - oslInterlockedCount newCount = osl_decrementInterlockedCount( &m_refCount ); - if ( 0 == newCount ) - delete this; - return newCount; -} - -//----------------------------------------------------------------------------- -void ColoredPanel::Activate( Window& i_rParentWindow ) -{ - ENSURE_OR_RETURN_VOID( m_pWindow.get(), "disposed!" ); - OSL_ENSURE( &i_rParentWindow == m_pWindow->GetParent(), "ColoredPanel::Activate: unexpected new parent window!" ); - // the documentation of IToolPanel::Activate says it is guaranteed that the parent window is - // always the same ... - m_pWindow->SetPosSizePixel( Point(), i_rParentWindow.GetSizePixel() ); - m_pWindow->Show(); -} - -//----------------------------------------------------------------------------- -void ColoredPanel::Deactivate() -{ - ENSURE_OR_RETURN_VOID( m_pWindow.get(), "disposed!" ); - m_pWindow->Hide(); -} - -//----------------------------------------------------------------------------- -void ColoredPanel::SetSizePixel( const Size& i_rPanelWindowSize ) -{ - ENSURE_OR_RETURN_VOID( m_pWindow.get(), "disposed!" ); - m_pWindow->SetSizePixel( i_rPanelWindowSize ); -} - -//----------------------------------------------------------------------------- -void ColoredPanel::GrabFocus() -{ - ENSURE_OR_RETURN_VOID( m_pWindow.get(), "disposed!" ); - m_pWindow->GrabFocus(); -} - -//----------------------------------------------------------------------------- -void ColoredPanel::Dispose() -{ - ENSURE_OR_RETURN_VOID( m_pWindow.get(), "disposed!" ); - m_pWindow.reset(); -} - -//----------------------------------------------------------------------------- -Reference< XAccessible > ColoredPanel::CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible ) -{ - ENSURE_OR_RETURN( m_pWindow.get(), "disposed!", NULL ); - (void)i_rParentAccessible; - return m_pWindow->GetAccessible(); -} - -//----------------------------------------------------------------------------- -::rtl::OUString ColoredPanel::GetDisplayName() const -{ - return m_aPanelName; -} - -//----------------------------------------------------------------------------- -Image ColoredPanel::GetImage() const -{ - return Image( m_aPanelIcon ); -} - -//----------------------------------------------------------------------------- -rtl::OString ColoredPanel::GetHelpID() const -{ - return rtl::OString(); -} - -//============================================================================= -//= OptionsWindow -//============================================================================= -class PanelDemoMainWindow; -class OptionsWindow :public Window - ,public ::svt::IToolPanelDeckListener -{ -public: - OptionsWindow( PanelDemoMainWindow& i_rParent ); - ~OptionsWindow(); - - // Window overridables - virtual void Resize(); - virtual void GetFocus(); - virtual void StateChanged( StateChangedType i_nStateChange ); - - // IToolPanelDeckListener - virtual void PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition ); - virtual void PanelRemoved( const size_t i_nPosition ); - virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); - virtual void LayouterChanged( const PDeckLayouter& i_rNewLayouter ); - virtual void Dying(); - -private: - DECL_LINK( OnRadioToggled, RadioButton* ); - DECL_LINK( OnListEntrySelected, ListBox* ); - DECL_LINK( OnListEntryDoubleClicked, ListBox* ); - DECL_LINK( OnButtonClicked, PushButton* ); - DECL_LINK( OnEditModified, Edit* ); - - void impl_initPanelList(); - void impl_updateRemoveButton(); - void impl_updateInsertButton(); - -private: - FixedLine m_aAlignmentHeader; - RadioButton m_aAlignLeft; - RadioButton m_aAlignRight; - RadioButton m_aAlignTop; - RadioButton m_aAlignBottom; - FixedLine m_aTabItemContent; - RadioButton m_aImagesAndText; - RadioButton m_aImagesOnly; - RadioButton m_aTextOnly; - RadioButton m_aAutomaticContent; - - FixedLine m_aPanelsHeader; - ListBox m_aPanelList; - PushButton m_aRemovePanel; - ColorListBox m_aColors; - Edit m_aNewPanelName; - PushButton m_aInsertPanel; -}; - -//============================================================================= -//= PanelDemoMainWindow -//============================================================================= -class PanelDemoMainWindow : public WorkWindow -{ -public: - PanelDemoMainWindow(); - ~PanelDemoMainWindow(); - - // window overridables - virtual void Resize(); - -public: - // operations - void AlignTabs( const ::svt::TabAlignment i_eAlignment ); - void SetTabItemContent( const TabItemContent i_eItemContent ); - - // member access - IToolPanelDeck& GetToolPanelDeck(); - PToolPanel CreateToolPanel( const Color& i_rColor, const String& i_rPanelName ); - -protected: - virtual void GetFocus(); - -private: - ToolPanelDeck m_aToolPanelDeck; - OptionsWindow m_aDemoOptions; -}; - -//============================================================================= -//= PanelDemoMainWindow - implementation -//============================================================================= -//----------------------------------------------------------------------------- -OptionsWindow::OptionsWindow( PanelDemoMainWindow& i_rParent ) - :Window( &i_rParent, WB_BORDER | WB_DIALOGCONTROL ) - ,m_aAlignmentHeader( this ) - ,m_aAlignLeft( this, WB_GROUP ) - ,m_aAlignRight( this, 0 ) - ,m_aAlignTop( this, 0 ) - ,m_aAlignBottom( this, 0 ) - ,m_aTabItemContent( this ) - ,m_aImagesAndText( this ) - ,m_aImagesOnly( this ) - ,m_aTextOnly( this ) - ,m_aAutomaticContent( this ) - ,m_aPanelsHeader( this ) - ,m_aPanelList( this ) - ,m_aRemovePanel( this ) - ,m_aColors( this, WB_DROPDOWN ) - ,m_aNewPanelName( this, WB_BORDER ) - ,m_aInsertPanel( this ) -{ - SetBorderStyle( WINDOW_BORDER_MONO ); - - m_aColors.InsertEntry( Color( COL_BLACK ), String( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); - m_aColors.InsertEntry( Color( COL_BLUE ), String( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); - m_aColors.InsertEntry( Color( COL_GREEN ), String( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); - m_aColors.InsertEntry( Color( COL_CYAN ), String( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) ); - m_aColors.InsertEntry( Color( COL_RED ), String( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) ); - m_aColors.InsertEntry( Color( COL_MAGENTA ), String( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) ); - m_aColors.InsertEntry( Color( COL_BROWN ), String( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) ); - m_aColors.InsertEntry( Color( COL_GRAY ), String( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTGRAY ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Gray" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTBLUE ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Blue" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTGREEN ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Green" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTCYAN ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Cyan" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTRED ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Red" ) ) ); - m_aColors.InsertEntry( Color( COL_LIGHTMAGENTA ), String( RTL_CONSTASCII_USTRINGPARAM( "Light Magenta" ) ) ); - m_aColors.InsertEntry( Color( COL_YELLOW ), String( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); - m_aColors.InsertEntry( Color( COL_WHITE ), String( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - m_aColors.SetDropDownLineCount( 16 ); - - Window* pControls[] = - { - &m_aAlignmentHeader, &m_aAlignLeft, &m_aAlignRight, &m_aAlignTop, &m_aAlignBottom, &m_aTabItemContent, - &m_aImagesAndText, &m_aImagesOnly, &m_aTextOnly, &m_aAutomaticContent, &m_aPanelsHeader, &m_aPanelList, - &m_aRemovePanel, &m_aColors, &m_aNewPanelName, &m_aInsertPanel - }; - const sal_Char* pTexts[] = - { - "Tab Bar Alignment", "Left", "Right", "Top", "Bottom", "Tab Items", "Images and Text", "Images only", - "Text only", "Automatic", "Panels", "", "Remove Panel", "", "", "Insert Panel" - }; - for ( size_t i=0; i < SAL_N_ELEMENTS( pControls ); ++i ) - { - const WindowType eWindowType = pControls[i]->GetType(); - - pControls[i]->SetText( String::CreateFromAscii( pTexts[i] ) ); - pControls[i]->Show(); - - if ( eWindowType == WINDOW_RADIOBUTTON ) - static_cast< RadioButton* >( pControls[i] )->SetToggleHdl( LINK( this, OptionsWindow, OnRadioToggled ) ); - - if ( eWindowType == WINDOW_LISTBOX ) - { - static_cast< ListBox* >( pControls[i] )->SetSelectHdl( LINK( this, OptionsWindow, OnListEntrySelected ) ); - static_cast< ListBox* >( pControls[i] )->SetDoubleClickHdl( LINK( this, OptionsWindow, OnListEntryDoubleClicked ) ); - } - - if ( eWindowType == WINDOW_PUSHBUTTON ) - { - static_cast< PushButton* >( pControls[i] )->SetClickHdl( LINK( this, OptionsWindow, OnButtonClicked ) ); - } - - if ( eWindowType == WINDOW_EDIT ) - { - static_cast< Edit* >( pControls[i] )->SetModifyHdl( LINK( this, OptionsWindow, OnEditModified ) ); - } - } - - m_aAlignRight.Check(); - m_aImagesAndText.Check(); - - Show(); -} - -//----------------------------------------------------------------------------- -OptionsWindow::~OptionsWindow() -{ -} - -//----------------------------------------------------------------------------- -void OptionsWindow::impl_updateInsertButton() -{ - m_aInsertPanel.Enable( ( m_aColors.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) && ( m_aNewPanelName.GetText().Len() > 0 ) ); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::impl_updateRemoveButton() -{ - m_aRemovePanel.Enable( m_aPanelList.GetSelectEntryCount() > 0 ); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::impl_initPanelList() -{ - m_aPanelList.Clear(); - - PanelDemoMainWindow& rController( dynamic_cast< PanelDemoMainWindow& >( *GetParent() ) ); - IToolPanelDeck& rPanelDeck( rController.GetToolPanelDeck() ); - - for ( size_t i=0; i<rPanelDeck.GetPanelCount(); ++i ) - { - PToolPanel pPanel = rPanelDeck.GetPanel( i ); - m_aPanelList.InsertEntry( pPanel->GetDisplayName(), pPanel->GetImage() ); - } - ActivePanelChanged( ::boost::optional< size_t >(), rPanelDeck.GetActivePanel() ); - - impl_updateRemoveButton(); - impl_updateInsertButton(); - - rPanelDeck.AddListener( *this ); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::StateChanged( StateChangedType i_nStateChange ) -{ - Window::StateChanged( i_nStateChange ); - - if ( i_nStateChange == STATE_CHANGE_INITSHOW ) - { - impl_initPanelList(); - } -} - -//----------------------------------------------------------------------------- -void OptionsWindow::GetFocus() -{ - Window::GetFocus(); - RadioButton* pRadios[] = - { - &m_aAlignLeft, &m_aAlignRight, &m_aAlignTop, &m_aAlignBottom - }; - for ( size_t i=0; i < SAL_N_ELEMENTS( pRadios ); ++i ) - { - if ( pRadios[i]->IsChecked() ) - { - pRadios[i]->GrabFocus(); - break; - } - } -} - -//----------------------------------------------------------------------------- -void OptionsWindow::Resize() -{ - Window::Resize(); - - const Size aOutputSize( GetOutputSizePixel() ); - - const Size aSpacing( LogicToPixel( Size( 3, 3 ), MAP_APPFONT ) ); - const long nIndent( LogicToPixel( Size( 6, 9 ), MAP_APPFONT ).Width() ); - const long nFixedLineHeight( LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height() ); - const long nEditLineHeight( LogicToPixel( Size( 0, 12 ), MAP_APPFONT ).Height() ); - const long nButtonLineHeight( LogicToPixel( Size( 0, 14 ), MAP_APPFONT ).Height() ); - - const long nSuperordinateWidth = aOutputSize.Width() - 2 * aSpacing.Width(); - const long nSuperordinateX = aSpacing.Width(); - - const long nSubordinateWidth = aOutputSize.Width() - 2 * aSpacing.Width() - nIndent; - const long nSubordinateX = aSpacing.Width() + nIndent; - - Point aItemPos( nSuperordinateX, aSpacing.Height() ); - - struct ControlRow - { - Window* pWindow; - bool bSubordinate; - size_t nRows; - - ControlRow( Window& i_rWindow, const bool i_bSubordinate, const size_t i_nRows = 1 ) - :pWindow( &i_rWindow ) - ,bSubordinate( i_bSubordinate ) - ,nRows( i_nRows ) - { - } - }; - ControlRow aControlRows[] = - { - ControlRow( m_aAlignmentHeader, false ), - ControlRow( m_aAlignLeft, true ), - ControlRow( m_aAlignRight, true ), - ControlRow( m_aAlignTop, true ), - ControlRow( m_aAlignBottom, true ), - ControlRow( m_aTabItemContent, false ), - ControlRow( m_aImagesAndText, true ), - ControlRow( m_aImagesOnly, true ), - ControlRow( m_aTextOnly, true ), - ControlRow( m_aAutomaticContent, true ), - ControlRow( m_aPanelsHeader, false ), - ControlRow( m_aPanelList, true, 6 ), - ControlRow( m_aRemovePanel, true ), - ControlRow( m_aColors, true ), - ControlRow( m_aNewPanelName, true ), - ControlRow( m_aInsertPanel, true ) - }; - bool bPreviousWasSubordinate = false; - for ( size_t i=0; i < SAL_N_ELEMENTS( aControlRows ); ++i ) - { - aItemPos.X() = ( aControlRows[i].bSubordinate ) ? nSubordinateX : nSuperordinateX; - - if ( bPreviousWasSubordinate && !aControlRows[i].bSubordinate ) - aItemPos.Y() += aSpacing.Height(); - bPreviousWasSubordinate = aControlRows[i].bSubordinate; - - // height depends on the window type - const WindowType eWindowType = aControlRows[i].pWindow->GetType(); - long nControlHeight( nFixedLineHeight ); - if ( ( eWindowType == WINDOW_EDIT ) - || ( eWindowType == WINDOW_LISTBOX ) - ) - { - nControlHeight = nEditLineHeight; - } - else - if ( ( eWindowType == WINDOW_PUSHBUTTON ) - ) - { - nControlHeight = nButtonLineHeight; - } - - Size aControlSize( - aControlRows[i].bSubordinate ? nSubordinateWidth : nSuperordinateWidth, - nControlHeight * aControlRows[i].nRows - ); - aControlRows[i].pWindow->SetPosSizePixel( aItemPos, aControlSize ); - - aItemPos.Move( 0, aControlSize.Height() + aSpacing.Height() ); - } -} - -//----------------------------------------------------------------------------- -void OptionsWindow::PanelInserted( const PToolPanel& i_pPanel, const size_t i_nPosition ) -{ - m_aPanelList.InsertEntry( i_pPanel->GetDisplayName(), i_pPanel->GetImage(), sal_uInt16( i_nPosition ) ); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::PanelRemoved( const size_t i_nPosition ) -{ - m_aPanelList.RemoveEntry( sal_uInt16( i_nPosition ) ); - impl_updateRemoveButton(); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) -{ - (void)i_rOldActive; - - if ( !i_rNewActive ) - m_aPanelList.SetNoSelection(); - else - m_aPanelList.SelectEntryPos( sal_uInt16( *i_rNewActive ) ); -} - -//----------------------------------------------------------------------------- -void OptionsWindow::LayouterChanged( const PDeckLayouter& i_rNewLayouter ) -{ - (void)i_rNewLayouter; - // not interested in -} - -//----------------------------------------------------------------------------- -void OptionsWindow::Dying() -{ - // not interested in -} - -//----------------------------------------------------------------------------- -IMPL_LINK( OptionsWindow, OnListEntrySelected, ListBox*, i_pListBox ) -{ - if ( i_pListBox == &m_aColors ) - { - m_aNewPanelName.SetText( m_aColors.GetEntry( m_aColors.GetSelectEntryPos() ) ); - impl_updateInsertButton(); - } - else if ( i_pListBox == &m_aPanelList ) - { - impl_updateRemoveButton(); - } - return 0L; -} - -//----------------------------------------------------------------------------- -IMPL_LINK( OptionsWindow, OnListEntryDoubleClicked, ListBox*, i_pListBox ) -{ - PanelDemoMainWindow& rController( dynamic_cast< PanelDemoMainWindow& >( *GetParent() ) ); - - if ( i_pListBox == &m_aPanelList ) - { - size_t nActivatePanel = size_t( m_aPanelList.GetSelectEntryPos() ); - rController.GetToolPanelDeck().ActivatePanel( nActivatePanel ); - } - - return 0L; -} - -//----------------------------------------------------------------------------- -IMPL_LINK( OptionsWindow, OnEditModified, Edit*, i_pEdit ) -{ - if ( i_pEdit && &m_aNewPanelName ) - { - impl_updateInsertButton(); - } - - return 0L; -} - -//----------------------------------------------------------------------------- -IMPL_LINK( OptionsWindow, OnButtonClicked, PushButton*, i_pPushButton ) -{ - PanelDemoMainWindow& rController( dynamic_cast< PanelDemoMainWindow& >( *GetParent() ) ); - - if ( i_pPushButton == &m_aRemovePanel ) - { - rController.GetToolPanelDeck().RemovePanel( size_t( m_aPanelList.GetSelectEntryPos() ) ); - } - else if ( i_pPushButton == &m_aInsertPanel ) - { - PToolPanel pNewPanel( rController.CreateToolPanel( m_aColors.GetEntryColor( m_aColors.GetSelectEntryPos() ), m_aNewPanelName.GetText() ) ); - - ::boost::optional< size_t > aActivePanel( rController.GetToolPanelDeck().GetActivePanel() ); - size_t nNewPanelPos = !aActivePanel ? rController.GetToolPanelDeck().GetPanelCount() : *aActivePanel + 1; - - rController.GetToolPanelDeck().InsertPanel( pNewPanel, nNewPanelPos ); - } - return 0L; -} - -//----------------------------------------------------------------------------- -IMPL_LINK( OptionsWindow, OnRadioToggled, RadioButton*, i_pRadioButton ) -{ - PanelDemoMainWindow& rController( dynamic_cast< PanelDemoMainWindow& >( *GetParent() ) ); - - if ( i_pRadioButton->IsChecked() ) - { - if ( i_pRadioButton == &m_aAlignLeft ) - { - rController.AlignTabs( TABS_LEFT ); - } - else if ( i_pRadioButton == &m_aAlignRight ) - { - rController.AlignTabs( TABS_RIGHT ); - } - else if ( i_pRadioButton == &m_aAlignTop ) - { - rController.AlignTabs( TABS_TOP ); - } - else if ( i_pRadioButton == &m_aAlignBottom ) - { - rController.AlignTabs( TABS_BOTTOM ); - } - else if ( i_pRadioButton == &m_aImagesAndText ) - { - rController.SetTabItemContent( TABITEM_IMAGE_AND_TEXT ); - } - else if ( i_pRadioButton == &m_aImagesOnly ) - { - rController.SetTabItemContent( TABITEM_IMAGE_ONLY ); - } - else if ( i_pRadioButton == &m_aTextOnly ) - { - rController.SetTabItemContent( TABITEM_TEXT_ONLY ); - } - else if ( i_pRadioButton == &m_aAutomaticContent ) - { - rController.SetTabItemContent( TABITEM_AUTO ); - } - } - return 0L; -} -//============================================================================= -//= PanelDemoMainWindow - implementation -//============================================================================= -//----------------------------------------------------------------------------- -PanelDemoMainWindow::PanelDemoMainWindow() - :WorkWindow( NULL, WB_APP | WB_STDWORK | WB_CLIPCHILDREN ) - ,m_aToolPanelDeck( *this, WB_BORDER ) - ,m_aDemoOptions( *this ) -{ - m_aToolPanelDeck.SetPosSizePixel( Point( 20, 20 ), Size( 500, 300 ) ); - m_aToolPanelDeck.SetBorderStyle( WINDOW_BORDER_MONO ); - - m_aToolPanelDeck.InsertPanel( PToolPanel( new ColoredPanel( m_aToolPanelDeck.GetPanelWindowAnchor(), Color( COL_RED ), "Red" ) ), m_aToolPanelDeck.GetPanelCount() ); - m_aToolPanelDeck.InsertPanel( PToolPanel( new ColoredPanel( m_aToolPanelDeck.GetPanelWindowAnchor(), Color( COL_GREEN ), "Some flavor of Green" ) ), m_aToolPanelDeck.GetPanelCount() ); - m_aToolPanelDeck.InsertPanel( PToolPanel( new ColoredPanel( m_aToolPanelDeck.GetPanelWindowAnchor(), RGB_COLORDATA( 255, 255, 0 ), "Yellow is ugly" ) ), m_aToolPanelDeck.GetPanelCount() ); - m_aToolPanelDeck.InsertPanel( PToolPanel( new ColoredPanel( m_aToolPanelDeck.GetPanelWindowAnchor(), RGB_COLORDATA( 0, 0, 128 ), "Blue is the Color" ) ), m_aToolPanelDeck.GetPanelCount() ); - - m_aToolPanelDeck.ActivatePanel( size_t( 0 ) ); - m_aToolPanelDeck.Show(); - - SetText( String::CreateFromAscii( "ToolPanelDeck Demo Application" ) ); - Show(); - - Help::EnableQuickHelp(); - - GetSystemWindow()->GetTaskPaneList()->AddWindow( &m_aToolPanelDeck ); - GetSystemWindow()->GetTaskPaneList()->AddWindow( &m_aDemoOptions ); -} - -//----------------------------------------------------------------------------- -PanelDemoMainWindow::~PanelDemoMainWindow() -{ - GetSystemWindow()->GetTaskPaneList()->RemoveWindow( &m_aDemoOptions ); - GetSystemWindow()->GetTaskPaneList()->RemoveWindow( &m_aToolPanelDeck ); -} - -//----------------------------------------------------------------------------- -void PanelDemoMainWindow::GetFocus() -{ - WorkWindow::GetFocus(); - m_aToolPanelDeck.GrabFocus(); -} - -//----------------------------------------------------------------------------- -void PanelDemoMainWindow::Resize() -{ - WorkWindow::Resize(); - Size aSize( GetOutputSizePixel() ); - aSize.Width() -= 240; - aSize.Height() -= 40; - m_aToolPanelDeck.SetPosSizePixel( Point( 20, 20 ), aSize ); - - m_aDemoOptions.SetPosSizePixel( - Point( 20 + aSize.Width(), 20 ), - Size( 200, aSize.Height() ) - ); -} - -//----------------------------------------------------------------------------- -void PanelDemoMainWindow::AlignTabs( const ::svt::TabAlignment i_eAlignment ) -{ - TabItemContent eCurrentItemContent( TABITEM_IMAGE_AND_TEXT ); - TabDeckLayouter* pLayouter = dynamic_cast< TabDeckLayouter* >( m_aToolPanelDeck.GetLayouter().get() ); - OSL_ENSURE( pLayouter, "PanelDemoMainWindow::AlignTabs: wrong layouter!" ); - if ( pLayouter ) - eCurrentItemContent = pLayouter->GetTabItemContent(); - - m_aToolPanelDeck.SetLayouter( PDeckLayouter( new TabDeckLayouter( m_aToolPanelDeck, m_aToolPanelDeck, i_eAlignment, eCurrentItemContent ) ) ); -} - -//----------------------------------------------------------------------------- -void PanelDemoMainWindow::SetTabItemContent( const TabItemContent i_eItemContent ) -{ - TabDeckLayouter* pLayouter = dynamic_cast< TabDeckLayouter* >( m_aToolPanelDeck.GetLayouter().get() ); - OSL_ENSURE( pLayouter, "PanelDemoMainWindow::SetTabItemContent: wrong layouter!" ); - // we currently use tab layouters only ... - if ( !pLayouter ) - return; - - pLayouter->SetTabItemContent( i_eItemContent ); -} - -//----------------------------------------------------------------------------- -IToolPanelDeck& PanelDemoMainWindow::GetToolPanelDeck() -{ - return m_aToolPanelDeck; -} - -//----------------------------------------------------------------------------- -PToolPanel PanelDemoMainWindow::CreateToolPanel( const Color& i_rColor, const String& i_rPanelName ) -{ - return PToolPanel( new ColoredPanel( m_aToolPanelDeck.GetPanelWindowAnchor(), i_rColor, i_rPanelName ) ); -} - -//============================================================================= -//= PanelDemo -//============================================================================= -//----------------------------------------------------------------------------- -Reference< XMultiServiceFactory > PanelDemo::createApplicationServiceManager() -{ - Reference< XMultiServiceFactory > xMS; - try - { - Reference< XComponentContext > xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext(); - if ( xComponentContext.is() ) - xMS = xMS.query( xComponentContext->getServiceManager() ); - } - catch( const ::com::sun::star::uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - return xMS; -} - -//----------------------------------------------------------------------------- -int PanelDemo::Main() -{ - // create service factory - Reference< XMultiServiceFactory > xSMgr = createApplicationServiceManager(); - ::comphelper::setProcessServiceFactory( xSMgr ); - - // initialize the UCB - Sequence< Any > aArgs(2); - aArgs[0] <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Local" )); - aArgs[1] <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office" )); - ::ucbhelper::ContentBroker::initialize( xSMgr, aArgs ); - - // run the application - PanelDemoMainWindow aWindow; - Execute(); - return EXIT_SUCCESS; -} - -PanelDemo aTheApplication; - -} } // namespace ::svt::toolpanel - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/treecontrol/treetest.cxx b/svtools/workben/treecontrol/treetest.cxx deleted file mode 100644 index 53027052dd40..000000000000 --- a/svtools/workben/treecontrol/treetest.cxx +++ /dev/null @@ -1,398 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <stdio.h> -#include <wchar.h> - -#include <cppuhelper/bootstrap.hxx> - -#include <osl/file.hxx> -#include <osl/process.h> - -#include <com/sun/star/bridge/XUnoUrlResolver.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/awt/tree/XMutableTreeDataModel.hpp> -#include <com/sun/star/awt/tree/XTreeControl.hpp> -#include <com/sun/star/awt/tree/XTreeExpansionListener.hpp> -#include <com/sun/star/awt/tree/XTreeEditListener.hpp> -#include <com/sun/star/awt/XDialog.hpp> -#include <com/sun/star/awt/XControlModel.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/awt/XControl.hpp> -#include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/view/SelectionType.hpp> - -#include <vcl/image.hxx> -#include <vcl/graph.hxx> - -#include <cppuhelper/implbase2.hxx> - -#include <string.h> -#include <rtl/ref.hxx> - -#include "imagemgr.hxx" - -using rtl::OUString; -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::beans; -using namespace com::sun::star::bridge; -using namespace com::sun::star::frame; -using namespace com::sun::star::registry; -using namespace com::sun::star::awt; -using namespace com::sun::star::awt::tree; -using namespace com::sun::star::container; -using namespace com::sun::star::view; -using namespace com::sun::star::util; - -class DirectoryTree : public ::cppu::WeakImplHelper2< XTreeExpansionListener, XTreeEditListener > -{ -public: - DirectoryTree( const Reference< XComponentContext >& xComponentContext ); - virtual ~DirectoryTree(); - - void fillNode( const Reference< XMutableTreeNode >& xNode ); - void display( const OUString& rURL ); - - // XTreeExpansionListener - virtual void SAL_CALL requestChildNodes( const TreeExpansionEvent& Event ) throw (RuntimeException); - virtual void SAL_CALL treeExpanding( const TreeExpansionEvent& Event ) throw (ExpandVetoException, RuntimeException); - virtual void SAL_CALL treeCollapsing( const TreeExpansionEvent& Event ) throw (ExpandVetoException, RuntimeException); - virtual void SAL_CALL treeExpanded( const TreeExpansionEvent& Event ) throw (RuntimeException); - virtual void SAL_CALL treeCollapsed( const TreeExpansionEvent& Event ) throw (RuntimeException); - - // XTreeEditListener - virtual void SAL_CALL nodeEditing( const Reference< XTreeNode >& Node ) throw (VetoException, RuntimeException); - virtual void SAL_CALL nodeEdited( const Reference< XTreeNode >& Node, const OUString& NewText ) throw (RuntimeException); - - // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (RuntimeException); - - Reference< XMultiComponentFactory > mxMultiComponentFactoryServer; - Reference< XComponentContext > mxComponentContext; - Reference< XTreeControl > mxTreeControl; - Reference< XMutableTreeDataModel > mxTreeDataModel; -}; - -DirectoryTree::DirectoryTree( const Reference< XComponentContext >& xComponentContext ) -: mxComponentContext( xComponentContext ) -, mxMultiComponentFactoryServer( xComponentContext->getServiceManager() ) -{ -} - -DirectoryTree::~DirectoryTree() -{ -} - -void DirectoryTree::display( const OUString& rURL ) -{ - // some property names for later use - const OUString sPositionX( RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ); - const OUString sPositionY( RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ); - const OUString sWidth( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ); - const OUString sHeight( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ); - const OUString sDataModel( RTL_CONSTASCII_USTRINGPARAM( "DataModel" ) ); - const OUString sSelectionType( RTL_CONSTASCII_USTRINGPARAM( "SelectionType" ) ); - const OUString sShowsRootHandles( RTL_CONSTASCII_USTRINGPARAM( "ShowsRootHandles" ) ); - const OUString sShowsHandles( RTL_CONSTASCII_USTRINGPARAM( "ShowsHandles" ) ); - const OUString sRootDisplayed( RTL_CONSTASCII_USTRINGPARAM( "RootDisplayed" ) ); - const OUString sEditable( RTL_CONSTASCII_USTRINGPARAM( "Editable" ) ); - const OUString sTitle( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); - const OUString sRowHeight( RTL_CONSTASCII_USTRINGPARAM( "RowHeight" ) ); - - // first create a data model for our tree control - mxTreeDataModel = Reference< XMutableTreeDataModel >( - mxMultiComponentFactoryServer->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.MutableTreeDataModel" ) ), - mxComponentContext ), UNO_QUERY_THROW ); - - // now fill it with some sample data - Reference< XMutableTreeNode > xNode( mxTreeDataModel->createNode( Any( rURL ), false ), UNO_QUERY_THROW ); - xNode->setDataValue( Any( rURL ) ); - xNode->setExpandedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_down.png" ) ) ); - xNode->setCollapsedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_right.png" ) ) ); - - fillNode( xNode ); - mxTreeDataModel->setRoot( xNode ); - - // now create the dialog - Reference< XControlModel > xDialogModel( - mxMultiComponentFactoryServer->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialogModel" ) ), - mxComponentContext ), UNO_QUERY_THROW ); - - Reference< XPropertySet > xDialogPropertySet( xDialogModel, UNO_QUERY_THROW ); - xDialogPropertySet->setPropertyValue( sPositionX, Any( sal_Int32(50) ) ); - xDialogPropertySet->setPropertyValue( sPositionY, Any( sal_Int32(50) ) ); - xDialogPropertySet->setPropertyValue( sWidth, Any( sal_Int32(256) ) ); - xDialogPropertySet->setPropertyValue( sHeight, Any( sal_Int32(256) ) ); - xDialogPropertySet->setPropertyValue( sTitle, Any( OUString( RTL_CONSTASCII_USTRINGPARAM( "Tree Control Test" ) ) ) ); - - Reference< XMultiServiceFactory > xDialogMSF( xDialogModel, UNO_QUERY_THROW ); - - // now create our tree control - Reference< XControlModel > xTreeControlModel( - xDialogMSF->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.TreeControlModel" ) ) ), - UNO_QUERY_THROW ); - - Reference< XPropertySet > XTreeControlModelSet( xTreeControlModel, UNO_QUERY_THROW ); - - XTreeControlModelSet->setPropertyValue( sSelectionType, Any( SelectionType_NONE ) ); - XTreeControlModelSet->setPropertyValue( sPositionX, Any( sal_Int32(3) ) ); - XTreeControlModelSet->setPropertyValue( sPositionY, Any( sal_Int32(3) ) ); - XTreeControlModelSet->setPropertyValue( sWidth, Any( sal_Int32(253) ) ); - XTreeControlModelSet->setPropertyValue( sHeight, Any( sal_Int32(253) ) ); - XTreeControlModelSet->setPropertyValue( sDataModel, Any( mxTreeDataModel ) ); - XTreeControlModelSet->setPropertyValue( sShowsRootHandles,Any( sal_False ) ); - XTreeControlModelSet->setPropertyValue( sShowsHandles, Any( sal_False ) ); - XTreeControlModelSet->setPropertyValue( sRootDisplayed, Any( sal_True ) ); - XTreeControlModelSet->setPropertyValue( sEditable, Any( sal_True ) ); -// XTreeControlModelSet->setPropertyValue( sRowHeight, Any( sal_Int32( 12 ) ) ); - - Reference< XNameContainer > xDialogModelContainer( xDialogModel, UNO_QUERY_THROW ); - - const OUString sTreeControlName( RTL_CONSTASCII_USTRINGPARAM( "tree" ) ); - - xDialogModelContainer->insertByName( sTreeControlName, Any( xTreeControlModel ) ); - - // now create the peers - Reference< XControl > xDialogControl( - mxMultiComponentFactoryServer->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialog" ) ), - mxComponentContext ), UNO_QUERY_THROW ); - - xDialogControl->setModel( xDialogModel ); - - Reference< XToolkit > xToolkit( - mxMultiComponentFactoryServer->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit" ) ), - mxComponentContext ), UNO_QUERY_THROW ); - xDialogControl->createPeer( xToolkit, 0 ); - - // get the peers of the sub controls from the dialog peer container - Reference< XControlContainer > xDialogContainer( xDialogControl, UNO_QUERY_THROW ); - mxTreeControl = Reference< XTreeControl >( xDialogContainer->getControl( sTreeControlName ), UNO_QUERY_THROW ); - - Reference< XTreeExpansionListener > xListener( static_cast<XWeak*>(this), UNO_QUERY_THROW ); - mxTreeControl->addTreeExpansionListener( xListener ); - Reference< XDialog > xDialog( xDialogControl, UNO_QUERY_THROW ); - xDialog->execute(); -} - -void DirectoryTree::fillNode( const Reference< XMutableTreeNode >& xNode ) -{ - if( xNode->getChildCount() == 0 ) - { - OUString sParentPath; - xNode->getDataValue() >>= sParentPath; - - osl::Directory aDirectory( sParentPath ); - if( aDirectory.open() == osl::Directory::E_None ) - { - osl::DirectoryItem aItem; - osl::FileStatus fs( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileURL); - while( aDirectory.getNextItem( aItem, 0xffffffff ) == osl::Directory::E_None ) - { - if (aItem.getFileStatus(fs) == osl::FileBase::E_None) - { - bool bDirectory = fs.getFileType() == osl::FileStatus::Directory; - Reference< XMutableTreeNode > xChildNode( mxTreeDataModel->createNode( Any( fs.getFileName() ), bDirectory ), UNO_QUERY_THROW ); - xChildNode->setDataValue( Any( fs.getFileURL() ) ); - if( bDirectory ) - { - xChildNode->setExpandedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_down.png" ) ) ); - xChildNode->setCollapsedGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM( "private:graphicrepository/sd/res/triangle_right.png" ) ) ); - } - else - { - xChildNode->setNodeGraphicURL( OUString( RTL_CONSTASCII_USTRINGPARAM("private:graphicrepository/sw/imglst/nc20010.png") ) ); - } - xNode->appendChild( xChildNode ); - } - } - } - } -} - -// XTreeExpansionListener -void SAL_CALL DirectoryTree::requestChildNodes( const TreeExpansionEvent& rEvent ) throw (RuntimeException) -{ - if( rEvent.Node.is() && rEvent.Node->hasChildrenOnDemand() ) - { - Reference< XMutableTreeNode > xNode( rEvent.Node, UNO_QUERY ); - if( xNode.is() ) - { - fillNode( xNode ); - xNode->setHasChildrenOnDemand( sal_False ); - } - } -} - -void SAL_CALL DirectoryTree::treeExpanding( const TreeExpansionEvent& /*rEvent*/ ) throw (ExpandVetoException, RuntimeException) -{ -} - -void SAL_CALL DirectoryTree::treeCollapsing( const TreeExpansionEvent& ) throw (ExpandVetoException, RuntimeException) -{ -} - -void SAL_CALL DirectoryTree::treeExpanded( const TreeExpansionEvent& ) throw (RuntimeException) -{ -} - -void SAL_CALL DirectoryTree::treeCollapsed( const TreeExpansionEvent& /*rEvent*/ ) throw (RuntimeException) -{ -/* - if( rEvent.Node != mxTreeDataModel->getRoot() ) - { - Reference< XMutableTreeNode > xNode( rEvent.Node, UNO_QUERY ); - if( xNode.is() ) - { - while( xNode->getChildCount() ) - xNode->removeChildByIndex(0); - xNode->setHasChildrenOnDemand( sal_True ); - } - } -*/ -} - -// XTreeEditListener -void SAL_CALL DirectoryTree::nodeEditing( const Reference< XTreeNode >& ) throw (VetoException, RuntimeException) -{ -} - -void SAL_CALL DirectoryTree::nodeEdited( const Reference< XTreeNode >& , const OUString& ) throw (RuntimeException) -{ -} - -// XEventListener -void SAL_CALL DirectoryTree::disposing( const ::com::sun::star::lang::EventObject& ) throw (RuntimeException) -{ -} - -//============================================================================ -int SAL_CALL main( int argc, char **argv ) -{ - OUString sConnectionString(RTL_CONSTASCII_USTRINGPARAM("uno:socket,host=localhost,port=5678;urp;StarOffice.ServiceManager")); - - if (argc < 2) - { - printf("using: treetest <directory> [<uno_connection_url>]\n\n" -#ifdef WNT - "example: treetest \"c:\" \"uno:socket,host=localhost,port=5678;urp;StarOffice.ServiceManager\"\n"); -#else - "example: treetest \"/etc\" \"uno:socket,host=localhost,port=5678;urp;StarOffice.ServiceManager\"\n"); -#endif - exit(1); - } - if (argc == 3) - { - sConnectionString = OUString::createFromAscii(argv[2]); - } - - // Creates a simple registry service instance. - Reference< XSimpleRegistry > xSimpleRegistry(::cppu::createSimpleRegistry() ); - - // Connects the registry to a persistent data source represented by an URL. - xSimpleRegistry->open( - OUString( RTL_CONSTASCII_USTRINGPARAM("treetest.rdb") ), sal_True, sal_False ); - - /* Bootstraps an initial component context with service manager upon a given - registry. This includes insertion of initial services: - - (registry) service manager, shared lib loader, - - simple registry, nested registry, - - implementation registration - - registry typedescription provider, typedescription manager (also - installs it into cppu core) - */ - Reference< XComponentContext > xComponentContext( - ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) ); - - /* Gets the service manager instance to be used (or null). This method has - been added for convenience, because the service manager is a often used - object. - */ - Reference< XMultiComponentFactory > xMultiComponentFactoryClient( - xComponentContext->getServiceManager() ); - - /* Creates an instance of a component which supports the services specified - by the factory. - */ - Reference< XInterface > xInterface = - xMultiComponentFactoryClient->createInstanceWithContext( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.bridge.UnoUrlResolver" )), - xComponentContext ); - - Reference< XUnoUrlResolver > resolver( xInterface, UNO_QUERY ); - - // Resolves the component context from the office, on the uno URL given by argv[1]. - try - { - xInterface = Reference< XInterface >( - resolver->resolve( sConnectionString ), UNO_QUERY ); - } - catch ( const Exception& e ) - { - printf("Error: cannot establish a connection using '%s':\n %s\n", - OUStringToOString(sConnectionString, RTL_TEXTENCODING_ASCII_US).getStr(), - OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); - exit(1); - } - - // gets the server component context as property of the office component factory - Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY ); - xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" )) ) >>= xComponentContext; - - // gets the service manager from the office - Reference< XMultiComponentFactory > xMultiComponentFactoryServer( - xComponentContext->getServiceManager() ); - - try - { - OUString ustrFileURL; - osl::FileBase::getFileURLFromSystemPath( OUString::createFromAscii(argv[1]), ustrFileURL ); - - rtl::Reference< DirectoryTree >( - new DirectoryTree( xComponentContext ) )->display(ustrFileURL); - } - catch( const Exception& e ) - { - printf("Error: exception caught during test:\n %s\n", - OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); - exit(1); - } - - // dispose the local service manager - Reference< XComponent >::query( xMultiComponentFactoryClient )->dispose(); - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/roadmapskeleton.cxx b/svtools/workben/unodialog/roadmapskeleton.cxx deleted file mode 100644 index fffc560ea4a4..000000000000 --- a/svtools/workben/unodialog/roadmapskeleton.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "udlg_module.hxx" -#include "udlg_global.hrc" -#include "roadmapskeleton.hrc" -#include "roadmapskeleton.hxx" -#include "roadmapskeletonpages.hxx" - -//........................................................................ -namespace udlg -{ -//........................................................................ - -#define STATE_WELCOME 0 -#define STATE_PREPARE 1 -#define STATE_SETUP 2 -#define STATE_FINISH 3 - -#define PATH_DEFAULT 1 - - //==================================================================== - //= RoadmapSkeletonDialog - //==================================================================== - //-------------------------------------------------------------------- - RoadmapSkeletonDialog::RoadmapSkeletonDialog( const ::comphelper::ComponentContext& _rContext, Window* _pParent ) - :RoadmapSkeletonDialog_Base( _pParent, UdlgResId( DLG_ROADMAP_SKELETON ) ) - ,m_aContext( _rContext ) - { - String sTitlePrepare( UdlgResId( STR_STATE_WELCOME ) ); - String sTitleStoreAs( UdlgResId( STR_STATE_PREPARE ) ); - String sTitleMigrate( UdlgResId( STR_STATE_SETUP ) ); - String sTitleSummary( UdlgResId( STR_STATE_FINISH ) ); - FreeResource(); - - describeState( STATE_WELCOME, sTitlePrepare, &WelcomePage::Create ); - describeState( STATE_PREPARE, sTitleStoreAs, &PreparationPage::Create ); - describeState( STATE_SETUP, sTitleMigrate, &SetupPage::Create ); - describeState( STATE_FINISH, sTitleSummary, &FinishPage::Create ); - - declarePath( PATH_DEFAULT, STATE_WELCOME, STATE_PREPARE, STATE_SETUP, STATE_FINISH, WZS_INVALID_STATE ); - - SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MAP_APPFONT ) ); - ShowButtonFixedLine( true ); - SetRoadmapInteractive( true ); - enableAutomaticNextButtonState(); - defaultButton( WZB_NEXT ); - enableButtons( WZB_FINISH, true ); - ActivatePage(); - } - - //-------------------------------------------------------------------- - RoadmapSkeletonDialog::~RoadmapSkeletonDialog() - { - } - - //-------------------------------------------------------------------- - void RoadmapSkeletonDialog::enterState( WizardState _nState ) - { - RoadmapSkeletonDialog_Base::enterState( _nState ); - } - - //-------------------------------------------------------------------- - sal_Bool RoadmapSkeletonDialog::prepareLeaveCurrentState( CommitPageReason _eReason ) - { - return RoadmapSkeletonDialog_Base::prepareLeaveCurrentState( _eReason ); - } - - //-------------------------------------------------------------------- - sal_Bool RoadmapSkeletonDialog::leaveState( WizardState _nState ) - { - return RoadmapSkeletonDialog_Base::leaveState( _nState ); - } - - //-------------------------------------------------------------------- - RoadmapSkeletonDialog::WizardState RoadmapSkeletonDialog::determineNextState( WizardState _nCurrentState ) const - { - return RoadmapSkeletonDialog_Base::determineNextState( _nCurrentState ); - } - - //-------------------------------------------------------------------- - sal_Bool RoadmapSkeletonDialog::onFinish() - { - return RoadmapSkeletonDialog_Base::onFinish(); - } - -//........................................................................ -} // namespace udlg -//........................................................................ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/roadmapskeleton.hrc b/svtools/workben/unodialog/roadmapskeleton.hrc deleted file mode 100644 index 44b66ec0e1c4..000000000000 --- a/svtools/workben/unodialog/roadmapskeleton.hrc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SVTOOLS_ROADMAPSKELETON_HRC -#define SVTOOLS_ROADMAPSKELETON_HRC - -#define TAB_PAGE_WIDTH 280 -#define TAB_PAGE_HEIGHT 185 - -//... strings ............................................................ - -#define STR_STATE_WELCOME 1 -#define STR_STATE_PREPARE 2 -#define STR_STATE_SETUP 3 -#define STR_STATE_FINISH 4 - -#endif // SVTOOLS_ROADMAPSKELETON_HRC diff --git a/svtools/workben/unodialog/roadmapskeleton.hxx b/svtools/workben/unodialog/roadmapskeleton.hxx deleted file mode 100644 index 025baa2dd7e7..000000000000 --- a/svtools/workben/unodialog/roadmapskeleton.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SVTOOLS_ROADMAPSKELETONDIALOG_HXX -#define SVTOOLS_ROADMAPSKELETONDIALOG_HXX - -#include <comphelper/componentcontext.hxx> -#include <svtools/roadmapwizard.hxx> - -//........................................................................ -namespace udlg -{ -//........................................................................ - - //==================================================================== - //= RoadmapSkeletonDialog - //==================================================================== - typedef ::svt::RoadmapWizard RoadmapSkeletonDialog_Base; - class RoadmapSkeletonDialog : public RoadmapSkeletonDialog_Base - { - public: - RoadmapSkeletonDialog( const ::comphelper::ComponentContext& _rContext, Window* _pParent ); - virtual ~RoadmapSkeletonDialog(); - - protected: - // OWizardMachine overridables - virtual void enterState( WizardState _nState ); - virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason ); - virtual sal_Bool leaveState( WizardState _nState ); - virtual WizardState determineNextState( WizardState _nCurrentState ) const; - virtual sal_Bool onFinish(); - - private: - ::comphelper::ComponentContext m_aContext; - }; - -//........................................................................ -} // namespace udlg -//........................................................................ - -#endif // SVTOOLS_ROADMAPSKELETONDIALOG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src deleted file mode 100644 index 6c99b0c2b5a9..000000000000 --- a/svtools/workben/unodialog/roadmapskeleton.src +++ /dev/null @@ -1,80 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "udlg_global.hrc" -#include "roadmapskeleton.hrc" - -// ----------------------------------------------------------------------------- -ModalDialog DLG_ROADMAP_SKELETON -{ - HelpID = "svtools:ModalDialog:DLG_ROADMAP_SKELETON"; - OutputSize = TRUE ; - Moveable = TRUE; - Closeable = TRUE ; - Hide = TRUE; - - Text[ en-US ] = "Roadmap Skeleton Demo" ; - - String STR_STATE_WELCOME - { - Text [ en-US ] = "Welcome"; - }; - - String STR_STATE_PREPARE - { - Text [ en-US ] = "Prepare"; - }; - - String STR_STATE_SETUP - { - Text [ en-US ] = "Setup"; - }; - - String STR_STATE_FINISH - { - Text [ en-US ] = "Finish"; - }; -}; - -TabPage TP_WELCOME -{ - HelpID = "svtools:TabPage:TP_WELCOME"; - Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); - Hide = TRUE; -}; - -TabPage TP_PREPARE -{ - HelpID = "svtools:TabPage:TP_PREPARE"; - Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); - Hide = TRUE; -}; - -TabPage TP_SETUP -{ - HelpID = "svtools:TabPage:TP_SETUP"; - Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); - Hide = TRUE; -}; - -TabPage TP_FINISH -{ - HelpID = "svtools:TabPage:TP_FINISH"; - Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); - Hide = TRUE; -}; diff --git a/svtools/workben/unodialog/roadmapskeletonpages.cxx b/svtools/workben/unodialog/roadmapskeletonpages.cxx deleted file mode 100644 index da161dd2bed0..000000000000 --- a/svtools/workben/unodialog/roadmapskeletonpages.cxx +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "udlg_module.hxx" -#include "udlg_global.hrc" -#include "roadmapskeletonpages.hxx" -#include "roadmapskeleton.hxx" - -//........................................................................ -namespace udlg -{ -//........................................................................ - - //==================================================================== - //= RoadmapSkeletonPage - //==================================================================== - //-------------------------------------------------------------------- - RoadmapSkeletonPage::RoadmapSkeletonPage( RoadmapSkeletonDialog& _rParentDialog, const ResId& _rRes ) - :RoadmapSkeletonPage_Base( &_rParentDialog, _rRes ) - { - } - - //-------------------------------------------------------------------- - RoadmapSkeletonPage::~RoadmapSkeletonPage() - { - } - - //==================================================================== - //= WelcomePage - //==================================================================== - //-------------------------------------------------------------------- - WelcomePage::WelcomePage( RoadmapSkeletonDialog& _rParentDialog ) - :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_WELCOME ) ) - { - } - - //-------------------------------------------------------------------- - TabPage* WelcomePage::Create( ::svt::RoadmapWizard& _rParentDialog ) - { - return new WelcomePage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); - } - - //==================================================================== - //= PreparationPage - //==================================================================== - //-------------------------------------------------------------------- - PreparationPage::PreparationPage( RoadmapSkeletonDialog& _rParentDialog ) - :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_PREPARE ) ) - { - } - - //-------------------------------------------------------------------- - TabPage* PreparationPage::Create( ::svt::RoadmapWizard& _rParentDialog ) - { - return new PreparationPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); - } - - //==================================================================== - //= SetupPage - //==================================================================== - //-------------------------------------------------------------------- - SetupPage::SetupPage( RoadmapSkeletonDialog& _rParentDialog ) - :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_SETUP ) ) - { - } - - //-------------------------------------------------------------------- - TabPage* SetupPage::Create( ::svt::RoadmapWizard& _rParentDialog ) - { - return new SetupPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); - } - - //==================================================================== - //= FinishPage - //==================================================================== - //-------------------------------------------------------------------- - FinishPage::FinishPage( RoadmapSkeletonDialog& _rParentDialog ) - :RoadmapSkeletonPage( _rParentDialog, UdlgResId( TP_FINISH ) ) - { - } - - //-------------------------------------------------------------------- - TabPage* FinishPage::Create( ::svt::RoadmapWizard& _rParentDialog ) - { - return new FinishPage( dynamic_cast< RoadmapSkeletonDialog& >( _rParentDialog ) ); - } - -//........................................................................ -} // namespace udlg -//........................................................................ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/roadmapskeletonpages.hxx b/svtools/workben/unodialog/roadmapskeletonpages.hxx deleted file mode 100644 index 746a779292f9..000000000000 --- a/svtools/workben/unodialog/roadmapskeletonpages.hxx +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SVTOOLS_ROADMAPSKELETONPAGES_HXX -#define SVTOOLS_ROADMAPSKELETONPAGES_HXX - -#include <svtools/wizardmachine.hxx> - -namespace svt -{ - class RoadmapWizard; -} - -//........................................................................ -namespace udlg -{ -//........................................................................ - - class RoadmapSkeletonDialog; - - //==================================================================== - //= RoadmapSkeletonPage - //==================================================================== - typedef ::svt::OWizardPage RoadmapSkeletonPage_Base; - class RoadmapSkeletonPage : public RoadmapSkeletonPage_Base - { - public: - RoadmapSkeletonPage( RoadmapSkeletonDialog& _rParentDialog, const ResId& _rRes ); - ~RoadmapSkeletonPage(); - }; - - //==================================================================== - //= WelcomePage - //==================================================================== - class WelcomePage : public RoadmapSkeletonPage - { - public: - WelcomePage( RoadmapSkeletonDialog& _rParentDialog ); - - static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); - }; - - //==================================================================== - //= PreparationPage - //==================================================================== - class PreparationPage : public RoadmapSkeletonPage - { - public: - PreparationPage( RoadmapSkeletonDialog& _rParentDialog ); - - static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); - }; - - //==================================================================== - //= SetupPage - //==================================================================== - class SetupPage : public RoadmapSkeletonPage - { - public: - SetupPage( RoadmapSkeletonDialog& _rParentDialog ); - - static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); - }; - - //==================================================================== - //= FinishPage - //==================================================================== - class FinishPage : public RoadmapSkeletonPage - { - public: - FinishPage( RoadmapSkeletonDialog& _rParentDialog ); - - static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog ); - }; - -//........................................................................ -} // namespace udlg -//........................................................................ - -#endif // SVTOOLS_ROADMAPSKELETONPAGES_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/udlg_global.hrc b/svtools/workben/unodialog/udlg_global.hrc deleted file mode 100644 index e11aec73443d..000000000000 --- a/svtools/workben/unodialog/udlg_global.hrc +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SVTOOLS_UDLG_GLOBAL_HRC -#define SVTOOLS_UDLG_GLOBAL_HRC - -#include <svl/solar.hrc> - -//===================================================================== -//= bases -//===================================================================== -#define RID_UDLG_DIALOG_START RID_SVTOOLS_START + 0 -#define RID_UDLG_TAPPAGE_START RID_SVTOOLS_START + 0 - -//===================================================================== -//= dialogs -//===================================================================== - -#define DLG_ROADMAP_SKELETON RID_UDLG_DIALOG_START + 0 - -//===================================================================== -//= tab pages -//===================================================================== - -#define TP_WELCOME ( RID_UDLG_TAPPAGE_START + 0 ) -#define TP_PREPARE ( RID_UDLG_TAPPAGE_START + 1 ) -#define TP_SETUP ( RID_UDLG_TAPPAGE_START + 2 ) -#define TP_FINISH ( RID_UDLG_TAPPAGE_START + 3 ) - -#endif // SVTOOLS_UDLG_GLOBAL_HRC diff --git a/svtools/workben/unodialog/udlg_module.cxx b/svtools/workben/unodialog/udlg_module.cxx deleted file mode 100644 index 8cc72ac0db1a..000000000000 --- a/svtools/workben/unodialog/udlg_module.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "udlg_module.hxx" - -#include <rtl/instance.hxx> - -//........................................................................ -namespace udlg -{ -//........................................................................ - - IMPLEMENT_MODULE( UdlgModule, "udlg" ); - -//........................................................................ -} // namespace udlg -//........................................................................ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/udlg_module.hxx b/svtools/workben/unodialog/udlg_module.hxx deleted file mode 100644 index 5d3469440b88..000000000000 --- a/svtools/workben/unodialog/udlg_module.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX -#define SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX - -#include <unotools/componentresmodule.hxx> - -//........................................................................ -namespace udlg -{ -//........................................................................ - - DEFINE_MODULE( UdlgModule, UdlgClient, UdlgResId ) - -//........................................................................ -} // namespace udlg -//........................................................................ - -#endif // SVTOOLS_WORKBEN_UNODIALOG_MODULE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/udlg_services.cxx b/svtools/workben/unodialog/udlg_services.cxx deleted file mode 100644 index 93ed5101d230..000000000000 --- a/svtools/workben/unodialog/udlg_services.cxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "udlg_module.hxx" - -//........................................................................ -namespace udlg -{ -//........................................................................ - - //-------------------------------------------------------------------- - extern void createRegistryInfo_UnoDialogSkeleton(); - - static void initializeModule() - { - static bool bInitialized( false ); - if ( !bInitialized ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !bInitialized ) - { - createRegistryInfo_UnoDialogSkeleton(); - } - } - } - -//........................................................................ -} // namespace udlg -//........................................................................ - -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( - const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) -{ - ::udlg::initializeModule(); - return ::udlg::UdlgModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/unodialog/unodialogsample.cxx b/svtools/workben/unodialog/unodialogsample.cxx deleted file mode 100644 index 205771057c9c..000000000000 --- a/svtools/workben/unodialog/unodialogsample.cxx +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "udlg_module.hxx" -#include "roadmapskeleton.hxx" - -#include <comphelper/componentcontext.hxx> -#include "svtools/genericunodialog.hxx" - -//........................................................................ -namespace udlg -{ -//........................................................................ - - /** === begin UNO using === **/ - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::XInterface; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::uno::UNO_SET_THROW; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::uno::RuntimeException; - using ::com::sun::star::uno::Any; - using ::com::sun::star::uno::makeAny; - using ::com::sun::star::uno::XComponentContext; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::beans::XPropertySetInfo; - using ::com::sun::star::beans::Property; - /** === end UNO using === **/ - - //==================================================================== - //= UnoDialogSkeleton - //==================================================================== - class UnoDialogSkeleton; - typedef ::svt::OGenericUnoDialog UnoDialogSkeleton_Base; - typedef ::comphelper::OPropertyArrayUsageHelper< UnoDialogSkeleton > UnoDialogSkeleton_PBase; - - class UnoDialogSkeleton - :public UnoDialogSkeleton_Base - ,public UnoDialogSkeleton_PBase - ,public UdlgClient - { - public: - UnoDialogSkeleton( const Reference< XComponentContext >& _rxContext ); - - // XTypeProvider - virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw(RuntimeException); - virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException); - - // XPropertySet - virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(RuntimeException); - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); - - // OPropertyArrayUsageHelper - virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; - - // helper for factories - static Reference< XInterface > SAL_CALL Create( const Reference< XComponentContext >& _rxContext ); - static ::rtl::OUString SAL_CALL getImplementationName_static() throw(RuntimeException); - static Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static() throw(RuntimeException); - - protected: - ~UnoDialogSkeleton(); - - protected: - virtual Dialog* createDialog( Window* _pParent ); - virtual void destroyDialog(); - - private: - ::comphelper::ComponentContext m_aContext; - }; - - //==================================================================== - //= UnoDialogSkeleton - //==================================================================== - //-------------------------------------------------------------------- - UnoDialogSkeleton::UnoDialogSkeleton( const Reference< XComponentContext >& _rxContext ) - :UnoDialogSkeleton_Base( _rxContext ) - ,m_aContext( _rxContext ) - { - } - - //-------------------------------------------------------------------- - UnoDialogSkeleton::~UnoDialogSkeleton() - { - // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor, - // so this virtual-method-call the base class does does not work, we're already dead then ... - if ( m_pDialog ) - { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pDialog ) - destroyDialog(); - } - } - - //-------------------------------------------------------------------- - Reference< XInterface > SAL_CALL UnoDialogSkeleton::Create( const Reference< XComponentContext >& _rxContext ) - { - return *(new UnoDialogSkeleton( _rxContext ) ); - } - - //-------------------------------------------------------------------- - Dialog* UnoDialogSkeleton::createDialog( Window* _pParent ) - { - return new RoadmapSkeletonDialog( m_aContext, _pParent ); - } - - //-------------------------------------------------------------------- - void UnoDialogSkeleton::destroyDialog() - { - UnoDialogSkeleton_Base::destroyDialog(); - } - - //-------------------------------------------------------------------- - Sequence< sal_Int8 > SAL_CALL UnoDialogSkeleton::getImplementationId() throw(RuntimeException) - { - static ::cppu::OImplementationId* pId = NULL; - if ( !pId ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !pId ) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); - } - - //-------------------------------------------------------------------- - ::rtl::OUString SAL_CALL UnoDialogSkeleton::getImplementationName_static() throw(RuntimeException) - { - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svtools.workben.UnoDialogSkeleton" ) ); - } - - //-------------------------------------------------------------------- - Sequence< ::rtl::OUString > SAL_CALL UnoDialogSkeleton::getSupportedServiceNames_static() throw(RuntimeException) - { - Sequence< ::rtl::OUString > aServices(1); - aServices[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.example.UnoDialogSample" ) ); - return aServices; - } - - //-------------------------------------------------------------------- - ::rtl::OUString SAL_CALL UnoDialogSkeleton::getImplementationName() throw(RuntimeException) - { - return getImplementationName_static(); - } - - //-------------------------------------------------------------------- - Sequence< ::rtl::OUString > SAL_CALL UnoDialogSkeleton::getSupportedServiceNames() throw(RuntimeException) - { - return getSupportedServiceNames_static(); - } - - //-------------------------------------------------------------------- - Reference< XPropertySetInfo > SAL_CALL UnoDialogSkeleton::getPropertySetInfo() throw(RuntimeException) - { - return createPropertySetInfo( getInfoHelper() ); - } - - //-------------------------------------------------------------------- - ::cppu::IPropertyArrayHelper& SAL_CALL UnoDialogSkeleton::getInfoHelper() - { - return *const_cast< UnoDialogSkeleton* >( this )->getArrayHelper(); - } - - //-------------------------------------------------------------------- - ::cppu::IPropertyArrayHelper* UnoDialogSkeleton::createArrayHelper( ) const - { - Sequence< Property > aProps; - describeProperties( aProps ); - return new ::cppu::OPropertyArrayHelper( aProps ); - } - - //-------------------------------------------------------------------- - void createRegistryInfo_UnoDialogSkeleton() - { - static OAutoRegistration< UnoDialogSkeleton > aAutoRegistration; - } - -//........................................................................ -} // namespace udlg -//........................................................................ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |