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 _LABEL_HXX
20 : #define _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 SwLabRec;
28 : class SwLabRecs;
29 : class SwLabItem;
30 : class SwLabPrtPage;
31 : class SwNewDBMgr;
32 : class Printer;
33 :
34 : class SwLabDlg : public SfxTabDialog
35 : {
36 : SwLabelConfig aLabelsCfg;
37 : SwNewDBMgr* pNewDBMgr;
38 : SwLabPrtPage* pPrtPage;
39 :
40 : std::vector<sal_uInt16> aTypeIds;
41 : std::vector<rtl::OUString> aMakes;
42 :
43 : SwLabRecs* pRecs;
44 : String aLstGroup;
45 : String sBusinessCardDlg;
46 : String sFormat;
47 : String sMedium;
48 : sal_Bool m_bLabel;
49 : void _ReplaceGroup( const String &rMake );
50 :
51 : virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
52 : public:
53 :
54 : SwLabDlg( Window* pParent, const SfxItemSet& rSet,
55 : SwNewDBMgr* pNewDBMgr, sal_Bool bLabel);
56 : ~SwLabDlg();
57 :
58 : SwLabRec* GetRecord(const String &rRecName, sal_Bool bCont);
59 : void GetLabItem(SwLabItem &rItem);
60 :
61 0 : SwLabRecs &Recs() { return *pRecs; }
62 : const SwLabRecs &Recs() const { return *pRecs; }
63 :
64 0 : std::vector<sal_uInt16> &TypeIds() { return aTypeIds; }
65 : const std::vector<sal_uInt16> &TypeIds() const { return aTypeIds; }
66 :
67 0 : std::vector<rtl::OUString> &Makes() { return aMakes; }
68 : const std::vector<rtl::OUString> &Makes() const { return aMakes; }
69 :
70 : Printer *GetPrt();
71 : inline void ReplaceGroup( const String &rMake );
72 0 : void UpdateGroup( const String &rMake ) {_ReplaceGroup( rMake );}
73 : static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
74 : const SwLabItem& rItem);
75 0 : const String& GetBusinessCardStr() const {return sBusinessCardDlg;}
76 :
77 0 : SwLabelConfig& GetLabelsConfig() {return aLabelsCfg;}
78 :
79 : };
80 :
81 0 : inline void SwLabDlg::ReplaceGroup( const String &rMake )
82 : {
83 0 : if ( rMake != aLstGroup )
84 0 : _ReplaceGroup( rMake );
85 0 : }
86 :
87 : #endif
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|