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