Add a comment to clarify what kind of inputs the class handles
[LibreOffice.git] / sw / source / uibase / inc / label.hxx
blob825767726bd1bf3ef3ffbdc667b26895d01f6bda
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_LABEL_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_LABEL_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <com/sun/star/frame/XModel.hpp>
24 #include "labelcfg.hxx"
25 #include <vector>
27 class SwLabItem;
28 class SwLabPrtPage;
29 class SwDBManager;
30 class Printer;
32 class SwLabDlg final : public SfxTabDialogController
34 SwLabelConfig m_aLabelsCfg;
35 SwDBManager* m_pDBManager;
36 SwLabPrtPage* m_pPrtPage;
38 std::vector<sal_uInt16> m_aTypeIds;
39 std::vector<OUString> m_aMakes;
41 std::unique_ptr<SwLabRecs> m_pRecs;
42 OUString m_aLstGroup;
43 OUString m_sBusinessCardDlg;
44 bool m_bLabel;
45 void ReplaceGroup_( const OUString &rMake );
47 virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override;
48 public:
50 SwLabDlg(weld::Window* pParent, const SfxItemSet& rSet,
51 SwDBManager* pDBManager, bool bLabel);
52 virtual ~SwLabDlg() override;
54 SwLabRec* GetRecord(std::u16string_view rRecName, bool bCont);
55 void GetLabItem(SwLabItem &rItem);
57 SwLabRecs &Recs() { return *m_pRecs; }
58 const SwLabRecs &Recs() const { return *m_pRecs; }
60 std::vector<sal_uInt16> &TypeIds() { return m_aTypeIds; }
61 const std::vector<sal_uInt16> &TypeIds() const { return m_aTypeIds; }
63 std::vector<OUString> &Makes() { return m_aMakes; }
64 const std::vector<OUString> &Makes() const { return m_aMakes; }
66 Printer *GetPrt();
67 void ReplaceGroup( const OUString &rMake )
69 if ( rMake != m_aLstGroup )
70 ReplaceGroup_( rMake );
73 void UpdateGroup( const OUString &rMake ) {ReplaceGroup_( rMake );}
74 static void UpdateFieldInformation(css::uno::Reference< css::frame::XModel> const & xModel,
75 const SwLabItem& rItem);
76 const OUString& GetBusinessCardStr() const {return m_sBusinessCardDlg;}
78 SwLabelConfig& GetLabelsConfig() {return m_aLabelsCfg;}
82 #endif
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */