Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <svl/itemset.hxx>
22 :
23 : #include "strings.hrc"
24 : #include "sdattr.hxx"
25 : #include "sdresid.hxx"
26 : #include "layeroptionsdlg.hxx"
27 : #include "layeroptionsdlg.hrc"
28 :
29 0 : SdInsertLayerDlg::SdInsertLayerDlg( Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, String aStr )
30 : : ModalDialog( pWindow, SdResId( DLG_INSERT_LAYER ) )
31 : , maFtName( this, SdResId( FT_NAME ) )
32 : , maEdtName( this, SdResId( EDT_NAME ) )
33 : , maFtTitle( this, SdResId( FT_TITLE ) )
34 : , maEdtTitle( this, SdResId( EDT_TITLE ) )
35 : , maFtDesc( this, SdResId( FT_DESCRIPTION ) )
36 : , maEdtDesc( this, SdResId( EDT_DESCRIPTION ) )
37 : , maCbxVisible( this, SdResId( CBX_VISIBLE ) )
38 : , maCbxPrintable( this, SdResId( CBX_PRINTABLE ) )
39 : , maCbxLocked( this, SdResId( CBX_LOCKED ) )
40 : , maFixedLine( this, SdResId( FL_SEPARATOR_B ) )
41 : , maBtnHelp( this, SdResId( BTN_HELP ) )
42 : , maBtnOK( this, SdResId( BTN_OK ) )
43 : , maBtnCancel( this, SdResId( BTN_CANCEL ) )
44 0 : , mrOutAttrs( rInAttrs )
45 : {
46 0 : FreeResource();
47 :
48 0 : SetText( aStr );
49 :
50 0 : maEdtName.SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() );
51 0 : maEdtTitle.SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() );
52 0 : maEdtDesc.SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() );
53 0 : maCbxVisible.Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() );
54 0 : maCbxPrintable.Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() );
55 0 : maCbxLocked.Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() );
56 :
57 0 : if( !bDeletable )
58 : {
59 0 : maFtName.Disable();
60 0 : maEdtName.Disable();
61 : }
62 0 : }
63 :
64 0 : void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs )
65 : {
66 0 : rAttrs.Put( SdAttrLayerName( maEdtName.GetText() ) );
67 0 : rAttrs.Put( SdAttrLayerTitle( maEdtTitle.GetText() ) );
68 0 : rAttrs.Put( SdAttrLayerDesc( maEdtDesc.GetText() ) );
69 0 : rAttrs.Put( SdAttrLayerVisible( maCbxVisible.IsChecked() ) );
70 0 : rAttrs.Put( SdAttrLayerPrintable( maCbxPrintable.IsChecked() ) );
71 0 : rAttrs.Put( SdAttrLayerLocked( maCbxLocked.IsChecked() ) );
72 0 : }
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|