1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_FRMDIRLBOX_HXX
21 #define INCLUDED_SVX_FRMDIRLBOX_HXX
23 #include <vcl/lstbox.hxx>
24 #include <sfx2/itemconnect.hxx>
25 #include <editeng/frmdir.hxx>
26 #include <svx/svxdllapi.h>
28 class SvxFrameDirectionItem
;
33 /** This listbox contains entries to select horizontal text direction.
35 The control works on the SvxFrameDirection enumeration (i.e. left-to-right,
36 right-to-left), used i.e. in conjunction with the SvxFrameDirectionItem.
38 class SAL_WARN_UNUSED SVX_DLLPUBLIC FrameDirectionListBox
: public ListBox
41 explicit FrameDirectionListBox( vcl::Window
* pParent
, WinBits nBits
);
43 /** Inserts a string with corresponding direction enum into the listbox. */
44 void InsertEntryValue(
45 const OUString
& rString
,
46 SvxFrameDirection eDirection
);
47 /** Removes the entry, that represents the specified frame direction. */
48 void RemoveEntryValue( SvxFrameDirection eDirection
);
50 /** Selects the specified frame direction. */
51 void SelectEntryValue( SvxFrameDirection eDirection
);
52 /** Returns the currently selected frame direction. */
53 SvxFrameDirection
GetSelectEntryValue() const;
55 /** Saves the currently selected frame direction. */
56 void SaveValue() { meSaveValue
= GetSelectEntryValue(); }
59 SvxFrameDirection meSaveValue
; /// Saved value for later comparison.
62 typedef FrameDirectionListBox FrameDirListBox
;
65 /** Wrapper for usage of a FrameDirectionListBox in item connections. */
66 class SAL_WARN_UNUSED SVX_DLLPUBLIC FrameDirListBoxWrapper
: public sfx::SingleControlWrapper
< FrameDirListBox
, SvxFrameDirection
>
69 explicit FrameDirListBoxWrapper( FrameDirListBox
& rListBox
);
71 virtual bool IsControlDontKnow() const override
;
72 virtual void SetControlDontKnow( bool bSet
) override
;
74 virtual SvxFrameDirection
GetControlValue() const override
;
75 virtual void SetControlValue( SvxFrameDirection eValue
) override
;
78 /** Wrapper for usage of a SvxFrameDirectionItem in item connections. */
79 typedef sfx::ValueItemWrapper
< SvxFrameDirectionItem
, SvxFrameDirection
> FrameDirItemWrapper
;
81 /** An item<->control connection for a FrameDirectionListBox. */
82 typedef sfx::ItemControlConnection
< FrameDirItemWrapper
, FrameDirListBoxWrapper
> FrameDirListBoxConnection
;
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */