xref: /trunk/main/sfx2/source/dialog/navigat.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1*d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d119d52dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d119d52dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d119d52dSAndrew Rist  * distributed with this work for additional information
6*d119d52dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d119d52dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d119d52dSAndrew Rist  * "License"); you may not use this file except in compliance
9*d119d52dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*d119d52dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*d119d52dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d119d52dSAndrew Rist  * software distributed under the License is distributed on an
15*d119d52dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d119d52dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d119d52dSAndrew Rist  * specific language governing permissions and limitations
18*d119d52dSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*d119d52dSAndrew Rist  *************************************************************/
21*d119d52dSAndrew Rist 
22*d119d52dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // includes *******************************************************************
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef GCC
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <sfx2/navigat.hxx>
33cdf0e10cSrcweir #include <sfx2/sfx.hrc>
34cdf0e10cSrcweir #include <sfx2/app.hxx>
35cdf0e10cSrcweir #include "sfx2/sfxresid.hxx"
36cdf0e10cSrcweir #include "helpid.hrc"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper , SID_NAVIGATOR );
39cdf0e10cSrcweir 
SfxNavigatorWrapper(Window * pParentWnd,sal_uInt16 nId,SfxBindings * pBindings,SfxChildWinInfo * pInfo)40cdf0e10cSrcweir SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd ,
41cdf0e10cSrcweir                                                 sal_uInt16 nId ,
42cdf0e10cSrcweir                                                 SfxBindings* pBindings ,
43cdf0e10cSrcweir                                                 SfxChildWinInfo* pInfo )
44cdf0e10cSrcweir                     : SfxChildWindow( pParentWnd , nId )
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     pWindow = new SfxNavigator( pBindings, this, pParentWnd,
47cdf0e10cSrcweir         WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
48cdf0e10cSrcweir     eChildAlignment = SFX_ALIGN_NOALIGNMENT;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
51cdf0e10cSrcweir     pWindow->SetOutputSizePixel( Size( 270, 240 ) );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
54cdf0e10cSrcweir     SetHideNotDelete( sal_True );
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
SfxNavigator(SfxBindings * pBind,SfxChildWindow * pChildWin,Window * pParent,WinBits nBits)57cdf0e10cSrcweir SfxNavigator::SfxNavigator( SfxBindings* pBind ,
58cdf0e10cSrcweir                             SfxChildWindow* pChildWin ,
59cdf0e10cSrcweir                             Window* pParent ,
60cdf0e10cSrcweir                             WinBits nBits )
61cdf0e10cSrcweir                         : SfxDockingWindow( pBind ,
62cdf0e10cSrcweir                                             pChildWin ,
63cdf0e10cSrcweir                                             pParent ,
64cdf0e10cSrcweir                                             nBits )
65cdf0e10cSrcweir                         , pWrapper( pChildWin )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     SetText( String( SfxResId( SID_NAVIGATOR ) ) );
68cdf0e10cSrcweir }
69cdf0e10cSrcweir 
Resize()70cdf0e10cSrcweir void SfxNavigator::Resize()
71cdf0e10cSrcweir {
72cdf0e10cSrcweir     SfxDockingWindow::Resize();
73cdf0e10cSrcweir     if ( pWrapper->GetContextWindow() )
74cdf0e10cSrcweir         pWrapper->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
Resizing(Size & rSize)77cdf0e10cSrcweir void SfxNavigator::Resizing( Size &rSize )
78cdf0e10cSrcweir {
79cdf0e10cSrcweir     SfxDockingWindow::Resizing( rSize );
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
82cdf0e10cSrcweir     DBG_ASSERT( pCon, "Kein Context!" );
83cdf0e10cSrcweir     if ( pCon )
84cdf0e10cSrcweir         pCon->Resizing( rSize );
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
Close()87cdf0e10cSrcweir sal_Bool SfxNavigator::Close()
88cdf0e10cSrcweir {
89cdf0e10cSrcweir     SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
90cdf0e10cSrcweir     DBG_ASSERT( pCon, "Kein Context!" );
91cdf0e10cSrcweir     if ( !pCon || pCon->Close() )
92cdf0e10cSrcweir         return SfxDockingWindow::Close();
93cdf0e10cSrcweir     else
94cdf0e10cSrcweir         return sal_False;
95cdf0e10cSrcweir }
96