1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: layeroptionsdlg.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #ifdef SD_DLLIMPLEMENTATION
35 #undef SD_DLLIMPLEMENTATION
37 #include <svtools/itemset.hxx>
39 #include "strings.hrc"
41 #include "sdresid.hxx"
42 #include "layeroptionsdlg.hxx"
43 #include "layeroptionsdlg.hrc"
45 SdInsertLayerDlg::SdInsertLayerDlg( Window
* pWindow
, const SfxItemSet
& rInAttrs
, bool bDeletable
, String aStr
)
46 : ModalDialog( pWindow
, SdResId( DLG_INSERT_LAYER
) )
47 , maFtName( this, SdResId( FT_NAME
) )
48 , maEdtName( this, SdResId( EDT_NAME
) )
49 , maFtTitle( this, SdResId( FT_TITLE
) )
50 , maEdtTitle( this, SdResId( EDT_TITLE
) )
51 , maFtDesc( this, SdResId( FT_DESCRIPTION
) )
52 , maEdtDesc( this, SdResId( EDT_DESCRIPTION
) )
53 , maCbxVisible( this, SdResId( CBX_VISIBLE
) )
54 , maCbxPrintable( this, SdResId( CBX_PRINTABLE
) )
55 , maCbxLocked( this, SdResId( CBX_LOCKED
) )
56 , maFixedLine( this, SdResId( FL_SEPARATOR_B
) )
57 , maBtnHelp( this, SdResId( BTN_HELP
) )
58 , maBtnOK( this, SdResId( BTN_OK
) )
59 , maBtnCancel( this, SdResId( BTN_CANCEL
) )
60 , mrOutAttrs( rInAttrs
)
66 maEdtName
.SetText( ( ( const SdAttrLayerName
& ) mrOutAttrs
.Get( ATTR_LAYER_NAME
) ).GetValue() );
67 maEdtTitle
.SetText( ( ( const SdAttrLayerTitle
& ) mrOutAttrs
.Get( ATTR_LAYER_TITLE
) ).GetValue() );
68 maEdtDesc
.SetText( ( ( const SdAttrLayerDesc
& ) mrOutAttrs
.Get( ATTR_LAYER_DESC
) ).GetValue() );
69 maCbxVisible
.Check( ( ( const SdAttrLayerVisible
& ) mrOutAttrs
.Get( ATTR_LAYER_VISIBLE
) ).GetValue() );
70 maCbxPrintable
.Check( ( ( const SdAttrLayerPrintable
& ) mrOutAttrs
.Get( ATTR_LAYER_PRINTABLE
) ).GetValue() );
71 maCbxLocked
.Check( ( ( const SdAttrLayerLocked
& ) mrOutAttrs
.Get( ATTR_LAYER_LOCKED
) ).GetValue() );
80 void SdInsertLayerDlg::GetAttr( SfxItemSet
& rAttrs
)
82 rAttrs
.Put( SdAttrLayerName( maEdtName
.GetText() ) );
83 rAttrs
.Put( SdAttrLayerTitle( maEdtTitle
.GetText() ) );
84 rAttrs
.Put( SdAttrLayerDesc( maEdtDesc
.GetText() ) );
85 rAttrs
.Put( SdAttrLayerVisible( maCbxVisible
.IsChecked() ) );
86 rAttrs
.Put( SdAttrLayerPrintable( maCbxPrintable
.IsChecked() ) );
87 rAttrs
.Put( SdAttrLayerLocked( maCbxLocked
.IsChecked() ) );