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 : #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_LABEL_HXX
20 : #define INCLUDED_SW_SOURCE_UIBASE_INC_LABEL_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 : #include <com/sun/star/frame/XModel.hpp>
24 : #include <labelcfg.hxx>
25 : #include <vector>
26 :
27 : class SwLabItem;
28 : class SwLabPrtPage;
29 : class SwDBManager;
30 : class Printer;
31 :
32 : class SwLabDlg : public SfxTabDialog
33 : {
34 : SwLabelConfig aLabelsCfg;
35 : SwDBManager* pDBManager;
36 : SwLabPrtPage* pPrtPage;
37 :
38 : std::vector<sal_uInt16> aTypeIds;
39 : std::vector<OUString> aMakes;
40 :
41 : SwLabRecs* pRecs;
42 : OUString aLstGroup;
43 : OUString m_sBusinessCardDlg;
44 : bool m_bLabel;
45 : sal_uInt16 m_nFormatId;
46 : sal_uInt16 m_nOptionsId;
47 : sal_uInt16 m_nLabelId;
48 : sal_uInt16 m_nCardsId;
49 : sal_uInt16 m_nBusinessId;
50 : sal_uInt16 m_nPrivateId;
51 : void _ReplaceGroup( const OUString &rMake );
52 :
53 : virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE;
54 : public:
55 :
56 : SwLabDlg( vcl::Window* pParent, const SfxItemSet& rSet,
57 : SwDBManager* pDBManager, bool bLabel);
58 : virtual ~SwLabDlg();
59 :
60 : SwLabRec* GetRecord(const OUString &rRecName, bool bCont);
61 : void GetLabItem(SwLabItem &rItem);
62 :
63 0 : SwLabRecs &Recs() { return *pRecs; }
64 : const SwLabRecs &Recs() const { return *pRecs; }
65 :
66 0 : std::vector<sal_uInt16> &TypeIds() { return aTypeIds; }
67 : const std::vector<sal_uInt16> &TypeIds() const { return aTypeIds; }
68 :
69 0 : std::vector<OUString> &Makes() { return aMakes; }
70 : const std::vector<OUString> &Makes() const { return aMakes; }
71 :
72 : Printer *GetPrt();
73 : inline void ReplaceGroup( const OUString &rMake );
74 0 : void UpdateGroup( const OUString &rMake ) {_ReplaceGroup( rMake );}
75 : static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
76 : const SwLabItem& rItem);
77 0 : const OUString& GetBusinessCardStr() const {return m_sBusinessCardDlg;}
78 :
79 0 : SwLabelConfig& GetLabelsConfig() {return aLabelsCfg;}
80 :
81 : };
82 :
83 0 : inline void SwLabDlg::ReplaceGroup( const OUString &rMake )
84 : {
85 0 : if ( rMake != aLstGroup )
86 0 : _ReplaceGroup( rMake );
87 0 : }
88 :
89 : #endif
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|