Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / extensions / source / bibliography / toolbar.hxx
blob956ec905fa8eedcae0c56fc754e4d654c1288696
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _BIB_TOOLBAR_HXX
21 #define _BIB_TOOLBAR_HXX
23 #include <com/sun/star/frame/XController.hpp>
24 #include <com/sun/star/frame/XStatusListener.hpp>
27 #include <vcl/toolbox.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <vcl/edit.hxx>
30 #include <vcl/fixed.hxx>
31 #include <vcl/timer.hxx>
32 #include <cppuhelper/implbase1.hxx> // helper for implementations
33 #include <boost/ptr_container/ptr_vector.hpp>
35 class BibDataManager;
36 class BibToolBar;
38 class BibToolBarListener: public cppu::WeakImplHelper1 < ::com::sun::star::frame::XStatusListener>
40 private:
42 sal_uInt16 nIndex;
43 rtl::OUString aCommand;
45 protected:
47 BibToolBar *pToolBar;
49 public:
51 BibToolBarListener(BibToolBar *pTB,rtl::OUString aStr,sal_uInt16 nId);
52 ~BibToolBarListener();
54 rtl::OUString GetCommand() const;
56 // ::com::sun::star::lang::XEventListener
57 // we do not hold References to dispatches, so there is nothing to do on disposal
58 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& /*Source*/)
59 throw( ::com::sun::star::uno::RuntimeException ){};
61 // ::com::sun::star::frame::XStatusListener
62 virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event)
63 throw( ::com::sun::star::uno::RuntimeException );
67 class BibTBListBoxListener: public BibToolBarListener
69 public:
71 BibTBListBoxListener(BibToolBar *pTB,rtl::OUString aStr,sal_uInt16 nId);
72 ~BibTBListBoxListener();
74 virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event)
75 throw( ::com::sun::star::uno::RuntimeException );
79 class BibTBEditListener: public BibToolBarListener
81 public:
83 BibTBEditListener(BibToolBar *pTB,rtl::OUString aStr,sal_uInt16 nId);
84 ~BibTBEditListener();
86 virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event)
87 throw( ::com::sun::star::uno::RuntimeException );
91 class BibTBQueryMenuListener: public BibToolBarListener
93 public:
95 BibTBQueryMenuListener(BibToolBar *pTB,rtl::OUString aStr,sal_uInt16 nId);
96 ~BibTBQueryMenuListener();
98 virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event)
99 throw( ::com::sun::star::uno::RuntimeException );
104 typedef ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener> BibToolBarListenerRef;
105 typedef boost::ptr_vector<BibToolBarListenerRef> BibToolBarListenerArr;
107 class BibToolBar: public ToolBox
109 private:
111 BibToolBarListenerArr aListenerArr;
112 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController;
113 Timer aTimer;
114 ImageList aImgLst;
115 ImageList aImgLstHC;
116 ImageList aBigImgLst;
117 ImageList aBigImgLstHC;
118 FixedText aFtSource;
119 ListBox aLBSource;
120 FixedText aFtQuery;
121 Edit aEdQuery;
122 PopupMenu aPopupMenu;
123 sal_uInt16 nMenuId;
124 sal_uInt16 nSelMenuItem;
125 rtl::OUString aQueryField;
126 Link aLayoutManager;
127 sal_Int16 nSymbolsSize;
128 sal_Int16 nOutStyle;
130 BibDataManager* pDatMan;
131 DECL_LINK( SelHdl, ListBox* );
132 DECL_LINK( SendSelHdl, Timer* );
133 DECL_LINK( MenuHdl, ToolBox* );
134 DECL_LINK( OptionsChanged_Impl, void* );
135 DECL_LINK( SettingsChanged_Impl, void* );
137 void ApplyImageList();
138 void RebuildToolbar();
140 protected:
142 void DataChanged( const DataChangedEvent& rDCEvt );
143 void InitListener();
144 virtual void Select();
145 virtual void Click();
146 long PreNotify( NotifyEvent& rNEvt );
149 public:
151 BibToolBar(Window* pParent, Link aLink, WinBits nStyle = WB_3DLOOK );
152 ~BibToolBar();
154 void SetXController(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &);
156 void ClearSourceList();
157 void UpdateSourceList(sal_Bool bFlag=sal_True);
158 void EnableSourceList(sal_Bool bFlag=sal_True);
159 void InsertSourceEntry(const XubString&,sal_uInt16 nPos=LISTBOX_APPEND );
160 void SelectSourceEntry(const XubString& );
162 void EnableQuery(sal_Bool bFlag=sal_True);
163 void SetQueryString(const XubString& );
164 void AdjustToolBox();
166 void ClearFilterMenu();
167 sal_uInt16 InsertFilterItem(const XubString& );
168 void SelectFilterItem(sal_uInt16 nId);
170 void statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event)
171 throw( ::com::sun::star::uno::RuntimeException );
173 void SetDatMan(BibDataManager& rDatMan) {pDatMan = &rDatMan;}
174 void SendDispatch(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs);
180 #endif
182 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */