1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svl/itemset.hxx>
23 #include <layeroptionsdlg.hxx>
25 SdInsertLayerDlg::SdInsertLayerDlg(weld::Window
* pWindow
, const SfxItemSet
& rInAttrs
,
26 bool bDeletable
, const OUString
& rStr
)
27 : GenericDialogController(pWindow
, "modules/sdraw/ui/insertlayer.ui", "InsertLayerDialog")
28 , m_xEdtName(m_xBuilder
->weld_entry("name"))
29 , m_xEdtTitle(m_xBuilder
->weld_entry("title"))
30 , m_xEdtDesc(m_xBuilder
->weld_text_view("textview"))
31 , m_xCbxVisible(m_xBuilder
->weld_check_button("visible"))
32 , m_xCbxPrintable(m_xBuilder
->weld_check_button("printable"))
33 , m_xCbxLocked(m_xBuilder
->weld_check_button("locked"))
34 , m_xNameFrame(m_xBuilder
->weld_widget("nameframe"))
36 m_xDialog
->set_title(rStr
);
38 m_xEdtName
->set_text( static_cast<const SfxStringItem
&>( rInAttrs
.Get( ATTR_LAYER_NAME
) ).GetValue() );
39 m_xEdtTitle
->set_text( static_cast<const SfxStringItem
&>( rInAttrs
.Get( ATTR_LAYER_TITLE
) ).GetValue() );
40 m_xEdtDesc
->set_text( static_cast<const SfxStringItem
&>( rInAttrs
.Get( ATTR_LAYER_DESC
) ).GetValue() );
41 m_xEdtDesc
->set_size_request(-1, m_xEdtDesc
->get_height_rows(4));
42 m_xCbxVisible
->set_active( static_cast<const SfxBoolItem
&>( rInAttrs
.Get( ATTR_LAYER_VISIBLE
) ).GetValue() );
43 m_xCbxPrintable
->set_active( static_cast<const SfxBoolItem
&>( rInAttrs
.Get( ATTR_LAYER_PRINTABLE
) ).GetValue() );
44 m_xCbxLocked
->set_active( static_cast<const SfxBoolItem
&>( rInAttrs
.Get( ATTR_LAYER_LOCKED
) ).GetValue() );
45 m_xNameFrame
->set_sensitive(bDeletable
);
48 SdInsertLayerDlg::~SdInsertLayerDlg()
52 void SdInsertLayerDlg::GetAttr( SfxItemSet
& rAttrs
)
54 rAttrs
.Put( makeSdAttrLayerName( m_xEdtName
->get_text() ) );
55 rAttrs
.Put( makeSdAttrLayerTitle( m_xEdtTitle
->get_text() ) );
56 rAttrs
.Put( makeSdAttrLayerDesc( m_xEdtDesc
->get_text() ) );
57 rAttrs
.Put( makeSdAttrLayerVisible( m_xCbxVisible
->get_active() ) );
58 rAttrs
.Put( makeSdAttrLayerPrintable( m_xCbxPrintable
->get_active() ) );
59 rAttrs
.Put( makeSdAttrLayerLocked( m_xCbxLocked
->get_active() ) );
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */