xref: /trunk/main/sw/source/ui/inc/label.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _LABEL_HXX
28 #define _LABEL_HXX
29 
30 #ifndef _SVSTDARR_HXX
31 #define _SVSTDARR_STRINGSDTOR
32 #define _SVSTDARR_USHORTS
33 #include <svl/svstdarr.hxx>
34 #endif
35 #include <sfx2/tabdlg.hxx>
36 #include <com/sun/star/frame/XModel.hpp>
37 #include <labelcfg.hxx>
38 class SwLabRec;
39 class SwLabRecs;
40 class SwLabItem;
41 class SwLabPrtPage;
42 class SwNewDBMgr;
43 class Printer;
44 
45 class SwLabDlg : public SfxTabDialog
46 {
47 	SwLabelConfig	aLabelsCfg;
48 	SwNewDBMgr*   	pNewDBMgr;
49 	SwLabPrtPage* 	pPrtPage;
50 
51 	SvUShorts	  	aTypeIds;
52 	SvStringsDtor 	aMakes;
53 
54 	SwLabRecs*		pRecs;
55 	String 		  	aLstGroup;
56 	String 			sBusinessCardDlg;
57 	String 			sFormat;
58 	String 			sMedium;
59 	sal_Bool			m_bLabel;
60     void          _ReplaceGroup( const String &rMake );
61 
62 	virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
63 public:
64 
65 	 SwLabDlg( Window* pParent, const SfxItemSet& rSet,
66 	 			SwNewDBMgr* pNewDBMgr, sal_Bool bLabel);
67 	~SwLabDlg();
68 
69 	SwLabRec*	GetRecord(const String &rRecName, sal_Bool bCont);
70 	void		GetLabItem(SwLabItem &rItem);
71 
72 		  SwLabRecs &Recs() 	  	  { return *pRecs;	 }
73 	const SwLabRecs &Recs()		const { return *pRecs;	 }
74 
75 		  SvUShorts  &TypeIds() 	  { return aTypeIds; }
76 	const SvUShorts  &TypeIds() const { return aTypeIds; }
77 
78 		  SvStringsDtor  &Makes()		  { return aMakes;	 }
79 	const SvStringsDtor  &Makes()	const { return aMakes;	 }
80 
81 	Printer *GetPrt();
82     inline void ReplaceGroup( const String &rMake );
83     void UpdateGroup( const String &rMake ) {_ReplaceGroup( rMake );}
84     static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
85 																				const SwLabItem& rItem);
86 	const String& GetBusinessCardStr() const {return sBusinessCardDlg;}
87 
88 	SwLabelConfig& GetLabelsConfig() {return aLabelsCfg;}
89 
90 };
91 
92 inline void SwLabDlg::ReplaceGroup( const String &rMake )
93 {
94 	if ( rMake != aLstGroup )
95         _ReplaceGroup( rMake );
96 }
97 
98 #endif
99 
100