xref: /aoo41x/main/sw/source/ui/inc/label.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _LABEL_HXX
24 #define _LABEL_HXX
25 
26 #ifndef _SVSTDARR_HXX
27 #define _SVSTDARR_STRINGSDTOR
28 #define _SVSTDARR_USHORTS
29 #include <svl/svstdarr.hxx>
30 #endif
31 #include <sfx2/tabdlg.hxx>
32 #include <com/sun/star/frame/XModel.hpp>
33 #include <labelcfg.hxx>
34 class SwLabRec;
35 class SwLabRecs;
36 class SwLabItem;
37 class SwLabPrtPage;
38 class SwNewDBMgr;
39 class Printer;
40 
41 class SwLabDlg : public SfxTabDialog
42 {
43 	SwLabelConfig	aLabelsCfg;
44 	SwNewDBMgr*   	pNewDBMgr;
45 	SwLabPrtPage* 	pPrtPage;
46 
47 	SvUShorts	  	aTypeIds;
48 	SvStringsDtor 	aMakes;
49 
50 	SwLabRecs*		pRecs;
51 	String 		  	aLstGroup;
52 	String 			sBusinessCardDlg;
53 	String 			sFormat;
54 	String 			sMedium;
55 	sal_Bool			m_bLabel;
56     void          _ReplaceGroup( const String &rMake );
57 
58 	virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
59 public:
60 
61 	 SwLabDlg( Window* pParent, const SfxItemSet& rSet,
62 	 			SwNewDBMgr* pNewDBMgr, sal_Bool bLabel);
63 	~SwLabDlg();
64 
65 	SwLabRec*	GetRecord(const String &rRecName, sal_Bool bCont);
66 	void		GetLabItem(SwLabItem &rItem);
67 
Recs()68 		  SwLabRecs &Recs() 	  	  { return *pRecs;	 }
Recs() const69 	const SwLabRecs &Recs()		const { return *pRecs;	 }
70 
TypeIds()71 		  SvUShorts  &TypeIds() 	  { return aTypeIds; }
TypeIds() const72 	const SvUShorts  &TypeIds() const { return aTypeIds; }
73 
Makes()74 		  SvStringsDtor  &Makes()		  { return aMakes;	 }
Makes() const75 	const SvStringsDtor  &Makes()	const { return aMakes;	 }
76 
77 	Printer *GetPrt();
78     inline void ReplaceGroup( const String &rMake );
UpdateGroup(const String & rMake)79     void UpdateGroup( const String &rMake ) {_ReplaceGroup( rMake );}
80     static void UpdateFieldInformation(::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& xModel,
81 																				const SwLabItem& rItem);
GetBusinessCardStr() const82 	const String& GetBusinessCardStr() const {return sBusinessCardDlg;}
83 
GetLabelsConfig()84 	SwLabelConfig& GetLabelsConfig() {return aLabelsCfg;}
85 
86 };
87 
ReplaceGroup(const String & rMake)88 inline void SwLabDlg::ReplaceGroup( const String &rMake )
89 {
90 	if ( rMake != aLstGroup )
91         _ReplaceGroup( rMake );
92 }
93 
94 #endif
95 
96