1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swlbox.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <svtools/svarray.hxx>
35 #ifndef _LSTBOX_HXX //autogen
36 #include <vcl/lstbox.hxx>
39 #ifndef _COMBOBOX_HXX //autogen
40 #include <vcl/combobox.hxx>
47 SV_DECL_PTRARR_DEL(SwEntryLst
, SwBoxEntry
*, 10, 10)
49 /*--------------------------------------------------------------------
50 Beschreibung: SwBoxEntry
51 --------------------------------------------------------------------*/
53 class SW_DLLPUBLIC SwBoxEntry
55 friend class SwComboBox
;
64 SwBoxEntry(const String
& aName
, USHORT nId
=0);
65 SwBoxEntry(const SwBoxEntry
& rOrg
);
68 const String
& GetName() const { return aName
;}
71 /*--------------------------------------------------------------------
72 Beschreibung: fuer ComboBoxen
73 --------------------------------------------------------------------*/
75 typedef USHORT SwComboBoxStyle
;
76 namespace nsSwComboBoxStyle
78 const SwComboBoxStyle CBS_UPPER
= 0x01;
79 const SwComboBoxStyle CBS_LOWER
= 0x02;
80 const SwComboBoxStyle CBS_ALL
= 0x04;
81 const SwComboBoxStyle CBS_FILENAME
= 0x08;
83 const SwComboBoxStyle CBS_SW_FILENAME
= CBS_FILENAME
| CBS_LOWER
;
85 const SwComboBoxStyle CBS_SW_FILENAME
= CBS_FILENAME
;
89 class SW_DLLPUBLIC SwComboBox
: public ComboBox
92 SwEntryLst aDelEntryLst
;
96 SW_DLLPRIVATE
void InitComboBox();
97 SW_DLLPRIVATE
void InsertSorted(SwBoxEntry
* pEntry
);
99 using ComboBox::InsertEntry
;
100 using ComboBox::RemoveEntry
;
101 using Window::SetStyle
;
105 using ComboBox::GetEntryPos
;
107 SwComboBox(Window
* pParent
, const ResId
& rId
,
108 USHORT nStyleBits
= nsSwComboBoxStyle::CBS_ALL
);
111 virtual void KeyInput( const KeyEvent
& rKEvt
);
113 void InsertEntry(const SwBoxEntry
&);
114 USHORT
InsertEntry( const XubString
& rStr
, USHORT
= 0)
115 { InsertEntry( SwBoxEntry( rStr
) ); return 0; }
117 void RemoveEntry(USHORT nPos
);
119 USHORT
GetEntryPos(const SwBoxEntry
& rEntry
) const;
120 const SwBoxEntry
& GetEntry(USHORT
) const;
122 USHORT
GetRemovedCount() const;
123 const SwBoxEntry
& GetRemovedEntry(USHORT nPos
) const;
125 USHORT
GetStyle() const { return nStyle
; }
126 void SetStyle(const USHORT nSt
) { nStyle
= nSt
; }
128 String
GetText() const;
131 #endif /* _SWLBOX_HXX */