fontworkgallery.cxx (f6e50924) fontworkgallery.cxx (199633b5)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 326 unchanged lines hidden (view full) ---

335// -----------------------------------------------------------------------
336
337void FontWorkShapeTypeControl::Select( sal_Bool )
338{
339
340}
341
342// ========================================================================
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 326 unchanged lines hidden (view full) ---

335// -----------------------------------------------------------------------
336
337void FontWorkShapeTypeControl::Select( sal_Bool )
338{
339
340}
341
342// ========================================================================
343// FontWorkAlignmentWindow
343// FontworkAlignmentWindow
344// ========================================================================
345
344// ========================================================================
345
346class FontWorkAlignmentWindow : public ToolbarMenu
346class FontworkAlignmentWindow : public ToolbarMenu
347{
348public:
347{
348public:
349 FontWorkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
349 FontworkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
350
351 virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException );
352 virtual void DataChanged( const DataChangedEvent& rDCEvt );
353
354private:
355 svt::ToolboxController& mrController;
356
357 Image maImgAlgin1;

--- 9 unchanged lines hidden (view full) ---

367
368 const rtl::OUString msFontworkAlignment;
369
370 DECL_LINK( SelectHdl, void * );
371
372 void implSetAlignment( int nAlignmentMode, bool bEnabled );
373};
374
350
351 virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException );
352 virtual void DataChanged( const DataChangedEvent& rDCEvt );
353
354private:
355 svt::ToolboxController& mrController;
356
357 Image maImgAlgin1;

--- 9 unchanged lines hidden (view full) ---

367
368 const rtl::OUString msFontworkAlignment;
369
370 DECL_LINK( SelectHdl, void * );
371
372 void implSetAlignment( int nAlignmentMode, bool bEnabled );
373};
374
375FontWorkAlignmentWindow::FontWorkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
375FontworkAlignmentWindow::FontworkAlignmentWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
376: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT ))
377, mrController( rController )
378, maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) )
379, maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) )
380, maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) )
381, maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) )
382, maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) )
383, maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) )
384, maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) )
385, maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) )
386, maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) )
387, maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) )
388, msFontworkAlignment( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) )
389{
390 bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
391
392 SetHelpId( HID_POPUP_FONTWORK_ALIGN );
376: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_ALIGNMENT ))
377, mrController( rController )
378, maImgAlgin1( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16 ) )
379, maImgAlgin2( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16 ) )
380, maImgAlgin3( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16 ) )
381, maImgAlgin4( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16 ) )
382, maImgAlgin5( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16 ) )
383, maImgAlgin1h( SVX_RES( IMG_FONTWORK_ALIGN_LEFT_16_H ) )
384, maImgAlgin2h( SVX_RES( IMG_FONTWORK_ALIGN_CENTER_16_H ) )
385, maImgAlgin3h( SVX_RES( IMG_FONTWORK_ALIGN_RIGHT_16_H ) )
386, maImgAlgin4h( SVX_RES( IMG_FONTWORK_ALIGN_WORD_16_H ) )
387, maImgAlgin5h( SVX_RES( IMG_FONTWORK_ALIGN_STRETCH_16_H ) )
388, msFontworkAlignment( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) )
389{
390 bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
391
392 SetHelpId( HID_POPUP_FONTWORK_ALIGN );
393 SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) );
393 SetSelectHdl( LINK( this, FontworkAlignmentWindow, SelectHdl ) );
394
395 appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
396 appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
397 appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
398 appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
399 appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
400
401 SetOutputSizePixel( getMenuSize() );
402
403 FreeResource();
404
405 AddStatusListener( msFontworkAlignment );
406}
407
408// -----------------------------------------------------------------------
409
394
395 appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
396 appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
397 appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
398 appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
399 appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
400
401 SetOutputSizePixel( getMenuSize() );
402
403 FreeResource();
404
405 AddStatusListener( msFontworkAlignment );
406}
407
408// -----------------------------------------------------------------------
409
410void FontWorkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
410void FontworkAlignmentWindow::implSetAlignment( int nSurface, bool bEnabled )
411{
412 int i;
413 for( i = 0; i < 5; i++ )
414 {
415 checkEntry( i, (i == nSurface) && bEnabled );
416 enableEntry( i, bEnabled );
417 }
418}
419
420// -----------------------------------------------------------------------
421
411{
412 int i;
413 for( i = 0; i < 5; i++ )
414 {
415 checkEntry( i, (i == nSurface) && bEnabled );
416 enableEntry( i, bEnabled );
417 }
418}
419
420// -----------------------------------------------------------------------
421
422void SAL_CALL FontWorkAlignmentWindow::statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException )
422void SAL_CALL FontworkAlignmentWindow::statusChanged( const frame::FeatureStateEvent& Event ) throw ( RuntimeException )
423{
424 if( Event.FeatureURL.Main.equals( msFontworkAlignment ) )
425 {
426 if( !Event.IsEnabled )
427 {
428 implSetAlignment( 0, false );
429 }
430 else
431 {
432 sal_Int32 nValue = 0;
433 if( Event.State >>= nValue )
434 implSetAlignment( nValue, true );
435 }
436 }
437}
438
439// -----------------------------------------------------------------------
440
423{
424 if( Event.FeatureURL.Main.equals( msFontworkAlignment ) )
425 {
426 if( !Event.IsEnabled )
427 {
428 implSetAlignment( 0, false );
429 }
430 else
431 {
432 sal_Int32 nValue = 0;
433 if( Event.State >>= nValue )
434 implSetAlignment( nValue, true );
435 }
436 }
437}
438
439// -----------------------------------------------------------------------
440
441void FontWorkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt )
441void FontworkAlignmentWindow::DataChanged( const DataChangedEvent& rDCEvt )
442{
443 ToolbarMenu::DataChanged( rDCEvt );
444
445 if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
446 {
447 bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
448
449 appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
450 appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
451 appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
452 appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
453 appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
454 }
455}
456
457// -----------------------------------------------------------------------
458
442{
443 ToolbarMenu::DataChanged( rDCEvt );
444
445 if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
446 {
447 bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
448
449 appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 );
450 appendEntry( 1, String( SVX_RES( STR_ALIGN_CENTER ) ), bHighContrast ? maImgAlgin2h : maImgAlgin2 );
451 appendEntry( 2, String( SVX_RES( STR_ALIGN_RIGHT ) ), bHighContrast ? maImgAlgin3h : maImgAlgin3 );
452 appendEntry( 3, String( SVX_RES( STR_ALIGN_WORD ) ), bHighContrast ? maImgAlgin4h : maImgAlgin4 );
453 appendEntry( 4, String( SVX_RES( STR_ALIGN_STRETCH ) ), bHighContrast ? maImgAlgin5h : maImgAlgin5 );
454 }
455}
456
457// -----------------------------------------------------------------------
458
459IMPL_LINK( FontWorkAlignmentWindow, SelectHdl, void *, EMPTYARG )
459IMPL_LINK( FontworkAlignmentWindow, SelectHdl, void *, EMPTYARG )
460{
461 if ( IsInPopupMode() )
462 EndPopupMode();
463
464 sal_Int32 nAlignment = getSelectedEntryId();
465 if( nAlignment >= 0 )
466 {
467 Sequence< PropertyValue > aArgs( 1 );

--- 4 unchanged lines hidden (view full) ---

472
473 implSetAlignment( nAlignment, true );
474 }
475
476 return 0;
477}
478
479// ========================================================================
460{
461 if ( IsInPopupMode() )
462 EndPopupMode();
463
464 sal_Int32 nAlignment = getSelectedEntryId();
465 if( nAlignment >= 0 )
466 {
467 Sequence< PropertyValue > aArgs( 1 );

--- 4 unchanged lines hidden (view full) ---

472
473 implSetAlignment( nAlignment, true );
474 }
475
476 return 0;
477}
478
479// ========================================================================
480// FontWorkAlignmentControl
480// FontworkAlignmentControl
481// ========================================================================
482
481// ========================================================================
482
483class FontWorkAlignmentControl : public svt::PopupWindowController
483class FontworkAlignmentControl : public svt::PopupWindowController
484{
485public:
484{
485public:
486 FontWorkAlignmentControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
486 FontworkAlignmentControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
487
488 virtual ::Window* createPopupWindow( ::Window* pParent );
489
490 // XServiceInfo
491 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
492 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
493
494 using svt::PopupWindowController::createPopupWindow;
495};
496
497
498// -----------------------------------------------------------------------
499
487
488 virtual ::Window* createPopupWindow( ::Window* pParent );
489
490 // XServiceInfo
491 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
492 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
493
494 using svt::PopupWindowController::createPopupWindow;
495};
496
497
498// -----------------------------------------------------------------------
499
500FontWorkAlignmentControl::FontWorkAlignmentControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
500FontworkAlignmentControl::FontworkAlignmentControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
501: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) ) )
502{
503}
504
505// -----------------------------------------------------------------------
506
501: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkAlignment" ) ) )
502{
503}
504
505// -----------------------------------------------------------------------
506
507::Window* FontWorkAlignmentControl::createPopupWindow( ::Window* pParent )
507::Window* FontworkAlignmentControl::createPopupWindow( ::Window* pParent )
508{
508{
509 return new FontWorkAlignmentWindow( *this, m_xFrame, pParent );
509 return new FontworkAlignmentWindow( *this, m_xFrame, pParent );
510}
511
512// -----------------------------------------------------------------------
513// XServiceInfo
514// -----------------------------------------------------------------------
515
510}
511
512// -----------------------------------------------------------------------
513// XServiceInfo
514// -----------------------------------------------------------------------
515
516OUString SAL_CALL FontWorkAlignmentControl_getImplementationName()
516OUString SAL_CALL FontworkAlignmentControl_getImplementationName()
517{
517{
518 return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontWorkAlignmentController" ));
518 return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontworkAlignmentController" ));
519}
520
521// --------------------------------------------------------------------
522
519}
520
521// --------------------------------------------------------------------
522
523Sequence< OUString > SAL_CALL FontWorkAlignmentControl_getSupportedServiceNames() throw( RuntimeException )
523Sequence< OUString > SAL_CALL FontworkAlignmentControl_getSupportedServiceNames() throw( RuntimeException )
524{
525 Sequence< OUString > aSNS( 1 );
526 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
527 return aSNS;
528}
529
530// --------------------------------------------------------------------
531
524{
525 Sequence< OUString > aSNS( 1 );
526 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
527 return aSNS;
528}
529
530// --------------------------------------------------------------------
531
532Reference< XInterface > SAL_CALL SAL_CALL FontWorkAlignmentControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
532Reference< XInterface > SAL_CALL SAL_CALL FontworkAlignmentControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
533{
533{
534 return *new FontWorkAlignmentControl( rSMgr );
534 return *new FontworkAlignmentControl( rSMgr );
535}
536
537// --------------------------------------------------------------------
538
535}
536
537// --------------------------------------------------------------------
538
539OUString SAL_CALL FontWorkAlignmentControl::getImplementationName( ) throw (RuntimeException)
539OUString SAL_CALL FontworkAlignmentControl::getImplementationName( ) throw (RuntimeException)
540{
540{
541 return FontWorkAlignmentControl_getImplementationName();
541 return FontworkAlignmentControl_getImplementationName();
542}
543
544// --------------------------------------------------------------------
545
542}
543
544// --------------------------------------------------------------------
545
546Sequence< OUString > SAL_CALL FontWorkAlignmentControl::getSupportedServiceNames( ) throw (RuntimeException)
546Sequence< OUString > SAL_CALL FontworkAlignmentControl::getSupportedServiceNames( ) throw (RuntimeException)
547{
547{
548 return FontWorkAlignmentControl_getSupportedServiceNames();
548 return FontworkAlignmentControl_getSupportedServiceNames();
549}
550
551
552// ####################################################################
553
549}
550
551
552// ####################################################################
553
554class FontWorkCharacterSpacingWindow : public ToolbarMenu
554class FontworkCharacterSpacingWindow : public ToolbarMenu
555{
556public:
555{
556public:
557 FontWorkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
557 FontworkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow );
558
559 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
560private:
561 svt::ToolboxController& mrController;
562
563 const rtl::OUString msFontworkCharacterSpacing;
564 const rtl::OUString msFontworkKernCharacterPairs;
565
566 DECL_LINK( SelectHdl, void * );
567
568 void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
569 void implSetKernCharacterPairs( sal_Bool bKernOnOff, bool bEnabled );
570
571};
572
573// -----------------------------------------------------------------------
574
558
559 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
560private:
561 svt::ToolboxController& mrController;
562
563 const rtl::OUString msFontworkCharacterSpacing;
564 const rtl::OUString msFontworkKernCharacterPairs;
565
566 DECL_LINK( SelectHdl, void * );
567
568 void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
569 void implSetKernCharacterPairs( sal_Bool bKernOnOff, bool bEnabled );
570
571};
572
573// -----------------------------------------------------------------------
574
575FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
575FontworkCharacterSpacingWindow::FontworkCharacterSpacingWindow( svt::ToolboxController& rController, const Reference< XFrame >& rFrame, Window* pParentWindow )
576: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING ))
577, mrController( rController )
578, msFontworkCharacterSpacing( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacing" ) )
579, msFontworkKernCharacterPairs( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkKernCharacterPairs" ) )
580{
581 SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
576: ToolbarMenu( rFrame, pParentWindow, SVX_RES( RID_SVXFLOAT_FONTWORK_CHARSPACING ))
577, mrController( rController )
578, msFontworkCharacterSpacing( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacing" ) )
579, msFontworkKernCharacterPairs( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkKernCharacterPairs" ) )
580{
581 SetHelpId( HID_POPUP_FONTWORK_CHARSPACE );
582 SetSelectHdl( LINK( this, FontWorkCharacterSpacingWindow, SelectHdl ) );
582 SetSelectHdl( LINK( this, FontworkCharacterSpacingWindow, SelectHdl ) );
583
584 appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK );
585 appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_RADIOCHECK );
586 appendEntry( 2, String( SVX_RES( STR_CHARS_SPACING_NORMAL ) ), MIB_RADIOCHECK );
587 appendEntry( 3, String( SVX_RES( STR_CHARS_SPACING_LOOSE ) ), MIB_RADIOCHECK );
588 appendEntry( 4, String( SVX_RES( STR_CHARS_SPACING_VERY_LOOSE ) ), MIB_RADIOCHECK );
589 appendEntry( 5, String( SVX_RES( STR_CHARS_SPACING_CUSTOM ) ), MIB_RADIOCHECK );
590 appendSeparator();

--- 4 unchanged lines hidden (view full) ---

595 FreeResource();
596
597 AddStatusListener( msFontworkCharacterSpacing );
598 AddStatusListener( msFontworkKernCharacterPairs );
599}
600
601// -----------------------------------------------------------------------
602
583
584 appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK );
585 appendEntry( 1, String( SVX_RES( STR_CHARS_SPACING_TIGHT ) ), MIB_RADIOCHECK );
586 appendEntry( 2, String( SVX_RES( STR_CHARS_SPACING_NORMAL ) ), MIB_RADIOCHECK );
587 appendEntry( 3, String( SVX_RES( STR_CHARS_SPACING_LOOSE ) ), MIB_RADIOCHECK );
588 appendEntry( 4, String( SVX_RES( STR_CHARS_SPACING_VERY_LOOSE ) ), MIB_RADIOCHECK );
589 appendEntry( 5, String( SVX_RES( STR_CHARS_SPACING_CUSTOM ) ), MIB_RADIOCHECK );
590 appendSeparator();

--- 4 unchanged lines hidden (view full) ---

595 FreeResource();
596
597 AddStatusListener( msFontworkCharacterSpacing );
598 AddStatusListener( msFontworkKernCharacterPairs );
599}
600
601// -----------------------------------------------------------------------
602
603void FontWorkCharacterSpacingWindow::implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled )
603void FontworkCharacterSpacingWindow::implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled )
604{
605 sal_Int32 i;
606 for ( i = 0; i < 6; i++ )
607 {
608 checkEntry( i, sal_False );
609 enableEntry( i, bEnabled );
610 }
611 if ( nCharacterSpacing != -1 )

--- 9 unchanged lines hidden (view full) ---

621 default : nEntry = 5; break;
622 }
623 checkEntry( nEntry, bEnabled );
624 }
625}
626
627// -----------------------------------------------------------------------
628
604{
605 sal_Int32 i;
606 for ( i = 0; i < 6; i++ )
607 {
608 checkEntry( i, sal_False );
609 enableEntry( i, bEnabled );
610 }
611 if ( nCharacterSpacing != -1 )

--- 9 unchanged lines hidden (view full) ---

621 default : nEntry = 5; break;
622 }
623 checkEntry( nEntry, bEnabled );
624 }
625}
626
627// -----------------------------------------------------------------------
628
629void FontWorkCharacterSpacingWindow::implSetKernCharacterPairs( sal_Bool, bool bEnabled )
629void FontworkCharacterSpacingWindow::implSetKernCharacterPairs( sal_Bool, bool bEnabled )
630{
631 enableEntry( 6, bEnabled );
632 checkEntry( 6, bEnabled );
633}
634
635// -----------------------------------------------------------------------
636
630{
631 enableEntry( 6, bEnabled );
632 checkEntry( 6, bEnabled );
633}
634
635// -----------------------------------------------------------------------
636
637void SAL_CALL FontWorkCharacterSpacingWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
637void SAL_CALL FontworkCharacterSpacingWindow::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException )
638{
639 if( Event.FeatureURL.Main.equals( msFontworkCharacterSpacing ) )
640 {
641 if( !Event.IsEnabled )
642 {
643 implSetCharacterSpacing( 0, false );
644 }
645 else

--- 15 unchanged lines hidden (view full) ---

661 if( Event.State >>= bValue )
662 implSetKernCharacterPairs( bValue, true );
663 }
664 }
665}
666
667// -----------------------------------------------------------------------
668
638{
639 if( Event.FeatureURL.Main.equals( msFontworkCharacterSpacing ) )
640 {
641 if( !Event.IsEnabled )
642 {
643 implSetCharacterSpacing( 0, false );
644 }
645 else

--- 15 unchanged lines hidden (view full) ---

661 if( Event.State >>= bValue )
662 implSetKernCharacterPairs( bValue, true );
663 }
664 }
665}
666
667// -----------------------------------------------------------------------
668
669IMPL_LINK( FontWorkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
669IMPL_LINK( FontworkCharacterSpacingWindow, SelectHdl, void *, EMPTYARG )
670{
671 if ( IsInPopupMode() )
672 EndPopupMode();
673
674 sal_Int32 nSelection = getSelectedEntryId();
675 sal_Int32 nCharacterSpacing;
676 switch( nSelection )
677 {

--- 34 unchanged lines hidden (view full) ---

712
713 implSetCharacterSpacing( nCharacterSpacing, true );
714 }
715
716 return 0;
717}
718
719// ========================================================================
670{
671 if ( IsInPopupMode() )
672 EndPopupMode();
673
674 sal_Int32 nSelection = getSelectedEntryId();
675 sal_Int32 nCharacterSpacing;
676 switch( nSelection )
677 {

--- 34 unchanged lines hidden (view full) ---

712
713 implSetCharacterSpacing( nCharacterSpacing, true );
714 }
715
716 return 0;
717}
718
719// ========================================================================
720// FontWorkCharacterSpacingControl
720// FontworkCharacterSpacingControl
721// ========================================================================
722
721// ========================================================================
722
723class FontWorkCharacterSpacingControl : public svt::PopupWindowController
723class FontworkCharacterSpacingControl : public svt::PopupWindowController
724{
725public:
724{
725public:
726 FontWorkCharacterSpacingControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
726 FontworkCharacterSpacingControl( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
727
728 virtual ::Window* createPopupWindow( ::Window* pParent );
729
730 // XServiceInfo
731 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
732 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
733
734 using svt::PopupWindowController::createPopupWindow;
735};
736
737
727
728 virtual ::Window* createPopupWindow( ::Window* pParent );
729
730 // XServiceInfo
731 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
732 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
733
734 using svt::PopupWindowController::createPopupWindow;
735};
736
737
738FontWorkCharacterSpacingControl::FontWorkCharacterSpacingControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
738FontworkCharacterSpacingControl::FontworkCharacterSpacingControl( const Reference< lang::XMultiServiceFactory >& rServiceManager )
739: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacingFloater" ) ) )
740{
741}
742
743// -----------------------------------------------------------------------
744
739: svt::PopupWindowController( rServiceManager, Reference< frame::XFrame >(), OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FontworkCharacterSpacingFloater" ) ) )
740{
741}
742
743// -----------------------------------------------------------------------
744
745::Window* FontWorkCharacterSpacingControl::createPopupWindow( ::Window* pParent )
745::Window* FontworkCharacterSpacingControl::createPopupWindow( ::Window* pParent )
746{
746{
747 return new FontWorkCharacterSpacingWindow( *this, m_xFrame, pParent );
747 return new FontworkCharacterSpacingWindow( *this, m_xFrame, pParent );
748}
749
750// -----------------------------------------------------------------------
751// XServiceInfo
752// -----------------------------------------------------------------------
753
748}
749
750// -----------------------------------------------------------------------
751// XServiceInfo
752// -----------------------------------------------------------------------
753
754OUString SAL_CALL FontWorkCharacterSpacingControl_getImplementationName()
754OUString SAL_CALL FontworkCharacterSpacingControl_getImplementationName()
755{
755{
756 return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontWorkCharacterSpacingController" ));
756 return OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FontworkCharacterSpacingController" ));
757}
758
759// --------------------------------------------------------------------
760
757}
758
759// --------------------------------------------------------------------
760
761Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException )
761Sequence< OUString > SAL_CALL FontworkCharacterSpacingControl_getSupportedServiceNames() throw( RuntimeException )
762{
763 Sequence< OUString > aSNS( 1 );
764 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
765 return aSNS;
766}
767
768// --------------------------------------------------------------------
769
762{
763 Sequence< OUString > aSNS( 1 );
764 aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ));
765 return aSNS;
766}
767
768// --------------------------------------------------------------------
769
770Reference< XInterface > SAL_CALL SAL_CALL FontWorkCharacterSpacingControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
770Reference< XInterface > SAL_CALL SAL_CALL FontworkCharacterSpacingControl_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
771{
771{
772 return *new FontWorkCharacterSpacingControl( rSMgr );
772 return *new FontworkCharacterSpacingControl( rSMgr );
773}
774
775// --------------------------------------------------------------------
776
773}
774
775// --------------------------------------------------------------------
776
777OUString SAL_CALL FontWorkCharacterSpacingControl::getImplementationName( ) throw (RuntimeException)
777OUString SAL_CALL FontworkCharacterSpacingControl::getImplementationName( ) throw (RuntimeException)
778{
778{
779 return FontWorkCharacterSpacingControl_getImplementationName();
779 return FontworkCharacterSpacingControl_getImplementationName();
780}
781
782// --------------------------------------------------------------------
783
780}
781
782// --------------------------------------------------------------------
783
784Sequence< OUString > SAL_CALL FontWorkCharacterSpacingControl::getSupportedServiceNames( ) throw (RuntimeException)
784Sequence< OUString > SAL_CALL FontworkCharacterSpacingControl::getSupportedServiceNames( ) throw (RuntimeException)
785{
785{
786 return FontWorkCharacterSpacingControl_getSupportedServiceNames();
786 return FontworkCharacterSpacingControl_getSupportedServiceNames();
787}
788
789// ========================================================================
790// FontworkCharacterSpacingDialog
791// ========================================================================
792
793FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale )
794: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_CHARSPACING ) ),

--- 20 unchanged lines hidden ---
787}
788
789// ========================================================================
790// FontworkCharacterSpacingDialog
791// ========================================================================
792
793FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale )
794: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_CHARSPACING ) ),

--- 20 unchanged lines hidden ---