LibreOffice Module sfx2 (master) 1
new.hxx
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#ifndef INCLUDED_SFX2_NEW_HXX
20#define INCLUDED_SFX2_NEW_HXX
21
22#include <memory>
23#include <sal/config.h>
24#include <sfx2/dllapi.h>
25#include <sfx2/basedlgs.hxx>
26#include <sfx2/objsh.hxx>
27
28#include <vcl/idle.hxx>
29#include <sfx2/doctempl.hxx>
31
32namespace weld { class Button; }
33namespace weld { class CheckButton; }
34namespace weld { class CustomWeld; }
35namespace weld { class Expander; }
36namespace weld { class Label; }
37namespace weld { class TreeView; }
38namespace weld { class Window; }
39
41
44};
45
47{
48 NONE = 0x00,
49 LOAD_TEXT_STYLES = 0x01,
50 LOAD_FRAME_STYLES = 0x02,
51 LOAD_PAGE_STYLES = 0x04,
52 LOAD_NUM_STYLES = 0x08,
53 MERGE_STYLES = 0x10,
54};
55namespace o3tl
56{
57 template<> struct typed_flags<SfxTemplateFlags> : is_typed_flags<SfxTemplateFlags, 0x1f> {};
58}
59
60#define RET_TEMPLATE_LOAD 100
61
63{
64private:
69
70 std::unique_ptr<SfxPreviewWin_Impl> m_xPreviewController;
71
72 std::unique_ptr<weld::TreeView> m_xRegionLb;
73 std::unique_ptr<weld::TreeView> m_xTemplateLb;
74 std::unique_ptr<weld::CheckButton> m_xTextStyleCB;
75 std::unique_ptr<weld::CheckButton> m_xFrameStyleCB;
76 std::unique_ptr<weld::CheckButton> m_xPageStyleCB;
77 std::unique_ptr<weld::CheckButton> m_xNumStyleCB;
78 std::unique_ptr<weld::CheckButton> m_xMergeStyleCB;
79 std::unique_ptr<weld::Button> m_xLoadFilePB;
80 std::unique_ptr<weld::Expander> m_xMoreBt;
81 std::unique_ptr<weld::CustomWeld> m_xPreviewWin;
82 std::unique_ptr<weld::Label> m_xAltTitleFt;
83
84 DECL_DLLPRIVATE_LINK( Update, Timer *, void );
85
86 DECL_DLLPRIVATE_LINK(RegionSelect, weld::TreeView&, void);
87 DECL_DLLPRIVATE_LINK(TemplateSelect, weld::TreeView&, void);
90 sal_uInt16 GetSelectedTemplatePos() const;
91
92public:
94 virtual ~SfxNewFileDialog() override;
95
96 // Returns false, when '- No -' is set as Template
97 // Template names can only be obtained when IsTemplate() returns true.
98 bool IsTemplate() const;
99 OUString GetTemplateFileName() const;
100
101 // load template methods
102 SfxTemplateFlags GetTemplateFlags() const;
103 void SetTemplateFlags(SfxTemplateFlags nSet);
104};
105
106#endif
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxNewFileDialogMode m_nFlags
Definition: new.hxx:66
DECL_DLLPRIVATE_LINK(Expand, weld::Expander &, void)
std::unique_ptr< weld::Expander > m_xMoreBt
Definition: new.hxx:80
std::unique_ptr< weld::Button > m_xLoadFilePB
Definition: new.hxx:79
std::unique_ptr< weld::CustomWeld > m_xPreviewWin
Definition: new.hxx:81
std::unique_ptr< weld::CheckButton > m_xTextStyleCB
Definition: new.hxx:74
DECL_DLLPRIVATE_LINK(DoubleClick, weld::TreeView &, bool)
DECL_DLLPRIVATE_LINK(Update, Timer *, void)
std::unique_ptr< weld::CheckButton > m_xPageStyleCB
Definition: new.hxx:76
DECL_DLLPRIVATE_LINK(TemplateSelect, weld::TreeView &, void)
std::unique_ptr< weld::CheckButton > m_xFrameStyleCB
Definition: new.hxx:75
SfxObjectShellLock m_xDocShell
Definition: new.hxx:68
DECL_DLLPRIVATE_LINK(RegionSelect, weld::TreeView &, void)
std::unique_ptr< SfxPreviewWin_Impl > m_xPreviewController
Definition: new.hxx:70
std::unique_ptr< weld::TreeView > m_xRegionLb
Definition: new.hxx:72
std::unique_ptr< weld::CheckButton > m_xNumStyleCB
Definition: new.hxx:77
std::unique_ptr< weld::CheckButton > m_xMergeStyleCB
Definition: new.hxx:78
std::unique_ptr< weld::TreeView > m_xTemplateLb
Definition: new.hxx:73
SfxDocumentTemplates m_aTemplates
Definition: new.hxx:67
Idle m_aPrevIdle
Definition: new.hxx:65
std::unique_ptr< weld::Label > m_xAltTitleFt
Definition: new.hxx:82
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
NONE
SfxTemplateFlags
Definition: new.hxx:47
SfxNewFileDialogMode
Definition: new.hxx:42