2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
#ifndef _SWLBOX_HXX
|
|
|
|
#define _SWLBOX_HXX
|
|
|
|
|
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#include <vcl/combobox.hxx>
|
2004-08-23 08:01:33 +00:00
|
|
|
#include "swdllapi.h"
|
2012-04-25 11:55:08 +02:00
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
2004-08-23 08:01:33 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwBoxEntry;
|
|
|
|
class Window;
|
|
|
|
|
2012-04-25 11:55:08 +02:00
|
|
|
typedef boost::ptr_vector<SwBoxEntry> SwEntryLst;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2011-04-21 21:52:58 +02:00
|
|
|
Description: SwBoxEntry
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
2004-08-23 08:01:33 +00:00
|
|
|
class SW_DLLPUBLIC SwBoxEntry
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
friend class SwComboBox;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bModified : 1;
|
|
|
|
sal_Bool bNew : 1;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-09-27 11:10:54 +00:00
|
|
|
String aName;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nId;
|
2007-09-27 11:10:54 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2011-01-17 15:06:54 +01:00
|
|
|
SwBoxEntry(const String& aName, sal_uInt16 nId=0);
|
2000-09-18 16:15:01 +00:00
|
|
|
SwBoxEntry(const SwBoxEntry& rOrg);
|
|
|
|
SwBoxEntry();
|
|
|
|
|
2007-09-27 11:10:54 +00:00
|
|
|
const String& GetName() const { return aName;}
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
2011-04-21 21:52:58 +02:00
|
|
|
Description: for combo boxes
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
2004-08-23 08:01:33 +00:00
|
|
|
class SW_DLLPUBLIC SwComboBox : public ComboBox
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SwEntryLst aEntryLst;
|
|
|
|
SwEntryLst aDelEntryLst;
|
|
|
|
SwBoxEntry aDefault;
|
|
|
|
|
2012-11-29 21:44:20 +00:00
|
|
|
SW_DLLPRIVATE void InitComboBox();
|
|
|
|
SW_DLLPRIVATE void InsertSorted(SwBoxEntry* pEntry);
|
|
|
|
SW_DLLPRIVATE void Init();
|
2004-08-23 08:01:33 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
public:
|
2007-10-22 14:23:58 +00:00
|
|
|
|
2013-08-07 22:20:19 +02:00
|
|
|
SwComboBox(Window* pParent);
|
|
|
|
SwComboBox(Window* pParent, const ResId& rId);
|
2000-09-18 16:15:01 +00:00
|
|
|
~SwComboBox();
|
|
|
|
|
2013-08-07 22:09:06 +02:00
|
|
|
void InsertSwEntry(const SwBoxEntry&);
|
|
|
|
virtual sal_uInt16 InsertEntry(const OUString& rStr, sal_uInt16 = 0) SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-08-07 22:09:06 +02:00
|
|
|
virtual void RemoveEntryAt(sal_uInt16 nPos) SAL_OVERRIDE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2013-08-07 22:09:06 +02:00
|
|
|
sal_uInt16 GetSwEntryPos(const SwBoxEntry& rEntry) const;
|
|
|
|
const SwBoxEntry& GetSwEntry(sal_uInt16) const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetRemovedCount() const;
|
|
|
|
const SwBoxEntry& GetRemovedEntry(sal_uInt16 nPos) const;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2004-08-23 08:01:33 +00:00
|
|
|
#endif /* _SWLBOX_HXX */
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|