1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26
27 #include "NavigatorChildWindow.hxx"
28 #include "navigatr.hxx"
29 #include "app.hrc"
30 #include "navigatr.hrc"
31 #include <sfx2/app.hxx>
32 #include <sfx2/bindings.hxx>
33 #include <sfx2/dispatch.hxx>
34 #include <svl/eitem.hxx>
35 #include <boost/bind.hpp>
36
37
38 namespace sd {
39
SFX_IMPL_CHILDWINDOWCONTEXT(NavigatorChildWindow,SID_NAVIGATOR)40 SFX_IMPL_CHILDWINDOWCONTEXT(NavigatorChildWindow, SID_NAVIGATOR)
41
42 void RequestNavigatorUpdate (SfxBindings* pBindings)
43 {
44 if (pBindings != NULL
45 && pBindings->GetDispatcher() != NULL)
46 {
47 SfxBoolItem aItem (SID_NAVIGATOR_INIT, sal_True);
48 pBindings->GetDispatcher()->Execute(
49 SID_NAVIGATOR_INIT,
50 SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
51 &aItem,
52 0L);
53 }
54 }
55
56
NavigatorChildWindow(::Window * pParent,sal_uInt16 nId,SfxBindings * pBindings,SfxChildWinInfo *)57 NavigatorChildWindow::NavigatorChildWindow (
58 ::Window* pParent,
59 sal_uInt16 nId,
60 SfxBindings* pBindings,
61 SfxChildWinInfo* )
62 : SfxChildWindowContext( nId )
63 {
64 SdNavigatorWin* pNavWin = new SdNavigatorWin(
65 pParent,
66 this,
67 SdResId( FLT_NAVIGATOR ),
68 pBindings,
69 ::boost::bind(RequestNavigatorUpdate, pBindings));
70
71 SetWindow( pNavWin );
72 }
73
74 } // end of namespace sd
75