LibreOffice Module sd (master) 1
layeroptionsdlg.cxx
Go to the documentation of this file.
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#include <svl/itemset.hxx>
21
22#include <sdattr.hxx>
23#include <layeroptionsdlg.hxx>
24
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"))
35{
36 m_xDialog->set_title(rStr);
37
38 m_xEdtName->set_text( rInAttrs.Get( ATTR_LAYER_NAME ).GetValue() );
39 m_xEdtTitle->set_text( rInAttrs.Get( ATTR_LAYER_TITLE ).GetValue() );
40 m_xEdtDesc->set_text( 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);
46}
47
49{
50}
51
53{
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() ) );
60}
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Entry > m_xEdtName
std::unique_ptr< weld::CheckButton > m_xCbxPrintable
std::unique_ptr< weld::Entry > m_xEdtTitle
std::unique_ptr< weld::TextView > m_xEdtDesc
std::unique_ptr< weld::CheckButton > m_xCbxLocked
void GetAttr(SfxItemSet &rOutAttrs)
virtual ~SdInsertLayerDlg() override
SdInsertLayerDlg(weld::Window *pWindow, const SfxItemSet &rInAttrs, bool bDeletable, const OUString &rStr)
std::unique_ptr< weld::CheckButton > m_xCbxVisible
std::unique_ptr< weld::Widget > m_xNameFrame
bool GetValue() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::shared_ptr< weld::Dialog > m_xDialog
SfxBoolItem makeSdAttrLayerLocked(bool bValue=false)
Definition: sdattr.hxx:53
SfxStringItem makeSdAttrLayerTitle(const OUString &aStr=OUString())
Definition: sdattr.hxx:33
SfxBoolItem makeSdAttrLayerVisible(bool bValue=true)
Definition: sdattr.hxx:43
SfxBoolItem makeSdAttrLayerPrintable(bool bValue=true)
Definition: sdattr.hxx:48
SfxStringItem makeSdAttrLayerName(const OUString &aStr)
Definition: sdattr.hxx:28
SfxStringItem makeSdAttrLayerDesc(const OUString &aStr=OUString())
Definition: sdattr.hxx:38