xref: /aoo41x/main/sw/source/ui/inc/selglos.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 _SELGLOS_HXX
28 #define _SELGLOS_HXX
29 
30 #ifndef _DIALOG_HXX //autogen
31 #include <vcl/dialog.hxx>
32 #endif
33 
34 #ifndef _LSTBOX_HXX //autogen
35 #include <vcl/lstbox.hxx>
36 #endif
37 #include <vcl/fixed.hxx>
38 
39 #ifndef _BUTTON_HXX //autogen
40 #include <vcl/button.hxx>
41 #endif
42 
43 class SwSelGlossaryDlg : public ModalDialog
44 {
45 protected:
46 	ListBox 		aGlosBox;
47     FixedLine       aGlosFL;
48 	OKButton 		aOKBtn;
49 	CancelButton 	aCancelBtn;
50 	HelpButton 		aHelpBtn;
51 
52 	DECL_LINK(DoubleClickHdl, ListBox*);
53 public:
54 	SwSelGlossaryDlg(Window * pParent, const String &rShortName);
55 	~SwSelGlossaryDlg();
56 	void InsertGlos(const String &rRegion, const String &rGlosName);	// inline
57 	sal_uInt16 GetSelectedIdx() const;	// inline
58 	void SelectEntryPos(sal_uInt16 nIdx); 	// inline
59 };
60 
61 inline void SwSelGlossaryDlg::InsertGlos(const String &rRegion,
62 								const String &rGlosName)
63 {
64 	String aTmp( rRegion );
65 	aTmp += ':';
66 	aTmp += rGlosName;
67 	aGlosBox.InsertEntry( aTmp );
68 }
69 inline sal_uInt16 SwSelGlossaryDlg::GetSelectedIdx() const
70 {	return aGlosBox.GetSelectEntryPos(); }
71 inline void SwSelGlossaryDlg::SelectEntryPos(sal_uInt16 nIdx)
72 {	aGlosBox.SelectEntryPos(nIdx); }
73 
74 #endif
75