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_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
21 #define INCLUDED_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
23 #include <svl/stritem.hxx>
24 #include <sfx2/tbxctrl.hxx>
25 #include <vcl/lstbox.hxx>
30 class LibBoxControl
: public SfxToolBoxControl
33 SFX_DECL_TOOLBOX_CONTROL();
35 LibBoxControl( sal_uInt16 nSlotId
, sal_uInt16 nId
, ToolBox
& rTbx
);
37 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
,
38 const SfxPoolItem
* pState
) SAL_OVERRIDE
;
39 virtual VclPtr
<vcl::Window
> CreateItemWindow( vcl::Window
*pParent
) SAL_OVERRIDE
;
42 /** base class for list boxes which need to update their content according to the list
45 class DocListenerBox
:public ListBox
46 ,public DocumentEventListener
49 DocListenerBox( vcl::Window
* pParent
);
50 virtual ~DocListenerBox();
51 virtual void dispose() SAL_OVERRIDE
;
54 virtual void FillBox() = 0;
57 // DocumentEventListener
58 virtual void onDocumentCreated( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
59 virtual void onDocumentOpened( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
60 virtual void onDocumentSave( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
61 virtual void onDocumentSaveDone( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
62 virtual void onDocumentSaveAs( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
63 virtual void onDocumentSaveAsDone( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
64 virtual void onDocumentClosed( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
65 virtual void onDocumentTitleChanged( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
66 virtual void onDocumentModeChanged( const ScriptDocument
& _rDocument
) SAL_OVERRIDE
;
69 DocumentEventNotifier m_aNotifier
;
74 class LibBox
: public DocListenerBox
80 com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
82 static void ReleaseFocus();
83 void InsertEntries( const ScriptDocument
& rDocument
, LibraryLocation eLocation
);
89 virtual void FillBox() SAL_OVERRIDE
;
92 virtual void Select() SAL_OVERRIDE
;
93 virtual bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
96 LibBox( vcl::Window
* pParent
,
97 const com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
);
99 virtual void dispose() SAL_OVERRIDE
;
101 using Window::Update
;
102 void Update( const SfxStringItem
* pItem
);
105 class LanguageBoxControl
: public SfxToolBoxControl
108 SFX_DECL_TOOLBOX_CONTROL();
110 LanguageBoxControl( sal_uInt16 nSlotId
, sal_uInt16 nId
, ToolBox
& rTbx
);
112 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
) SAL_OVERRIDE
;
113 virtual VclPtr
<vcl::Window
> CreateItemWindow( vcl::Window
*pParent
) SAL_OVERRIDE
;
116 class LanguageBox
: public DocListenerBox
119 OUString m_sNotLocalizedStr
;
120 OUString m_sDefaultLanguageStr
;
121 OUString m_sCurrentText
;
123 bool m_bIgnoreSelect
;
129 virtual void FillBox() SAL_OVERRIDE
;
132 virtual void Select() SAL_OVERRIDE
;
133 virtual bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
136 LanguageBox( vcl::Window
* pParent
);
137 virtual ~LanguageBox();
138 virtual void dispose() SAL_OVERRIDE
;
140 using Window::Update
;
141 void Update( const SfxStringItem
* pItem
);
144 } // namespace basctl
146 #endif // INCLUDED_BASCTL_SOURCE_BASICIDE_BASICBOX_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */